Author: jacopoc
Date: Fri Apr 10 12:00:09 2009
New Revision: 763915
URL:
http://svn.apache.org/viewvc?rev=763915&view=revLog:
Applied patch from Ashish and Vikas, part of issue OFBIZ-1901 (Class cast exception on doing survey [ take survey ] on Customer Profile).
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java
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=763915&r1=763914&r2=763915&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 Apr 10 12:00:09 2009
@@ -26,6 +26,7 @@
import java.io.OutputStream;
import java.net.FileNameMap;
import java.net.URLConnection;
+import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
@@ -395,13 +396,23 @@
if (suffix != null && suffix.length() > 0) {
if (parameterName.endsWith(suffix)) {
String key = parameterName.substring(prefix.length(), parameterName.length() - (suffix.length()));
- String value = (String)entry.getValue();
- paramMap.put(key, value);
+ if (entry.getValue() instanceof ByteBuffer) {
+ ByteBuffer value = (ByteBuffer) entry.getValue();
+ paramMap.put(key, value);
+ } else {
+ String value = (String) entry.getValue();
+ paramMap.put(key, value);
+ }
}
} else {
String key = parameterName.substring(prefix.length());
- String value = (String)entry.getValue();
- paramMap.put(key, value);
+ if (context.get(parameterName) instanceof ByteBuffer) {
+ ByteBuffer value = (ByteBuffer) entry.getValue();
+ paramMap.put(key, value);
+ } else {
+ String value = (String) entry.getValue();
+ paramMap.put(key, value);
+ }
}
}
}