svn commit: r753334 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util: StringUtil.java UtilHttp.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r753334 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util: StringUtil.java UtilHttp.java

doogie-3
Author: doogie
Date: Fri Mar 13 18:03:33 2009
New Revision: 753334

URL: http://svn.apache.org/viewvc?rev=753334&view=rev
Log:
Fix generics warnings.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java?rev=753334&r1=753333&r2=753334&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/StringUtil.java Fri Mar 13 18:03:33 2009
@@ -718,7 +718,7 @@
                     return StringUtil.defaultWebEncoder.encodeForHTML((String) theObject);
                 }
             } else if (theObject instanceof Map) {
-                return HtmlEncodingMapWrapper.getHtmlEncodingMapWrapper((Map) theObject, this.encoder);
+                return HtmlEncodingMapWrapper.getHtmlEncodingMapWrapper(UtilGenerics.<K, Object>checkMap(theObject), this.encoder);
             }
             return theObject;
         }

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java?rev=753334&r1=753333&r2=753334&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java Fri Mar 13 18:03:33 2009
@@ -113,7 +113,7 @@
         Map<String, Object> paramMap = FastMap.newInstance();
 
         // add all the actual HTTP request parameters
-        Enumeration<String> e = request.getParameterNames();
+        Enumeration<String> e = UtilGenerics.cast(request.getParameterNames());
         while (e.hasMoreElements()) {
             String name = (String) e.nextElement();
             if (nameSet != null && (onlyIncludeOrSkipPrim ^ nameSet.contains(name))) {
@@ -234,7 +234,7 @@
                 paramEntry.setValue(canonicalizeParameter((String) paramEntry.getValue()));
             } else if (paramEntry.getValue() instanceof Collection) {
                 List<String> newList = FastList.newInstance();
-                for (String listEntry: ((Collection<String>) paramEntry.getValue())) {
+                for (String listEntry: UtilGenerics.<String>checkCollection(paramEntry.getValue())) {
                     newList.add(canonicalizeParameter((String) listEntry));
                 }
                 paramEntry.setValue(newList);