You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2003/09/01 17:57:46 UTC
cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/util/uri TurbineURI.java
henning 2003/09/01 08:57:46
Modified: src/java/org/apache/turbine/util/uri TurbineURI.java
Log:
Doing an unconditional cast of the Value to String leads to class cast
if reflection put a non-string value into an URIParam. Replace this
with the canonical String.valueOf() to make sure that all values are
converted to a String correctly.
Remove an unnecessary cast.
Revision Changes Path
1.8 +3 -3 jakarta-turbine-2/src/java/org/apache/turbine/util/uri/TurbineURI.java
Index: TurbineURI.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/util/uri/TurbineURI.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TurbineURI.java 29 Aug 2003 20:33:10 -0000 1.7
+++ TurbineURI.java 1 Sep 2003 15:57:46 -0000 1.8
@@ -798,8 +798,8 @@
for(Iterator it = list.iterator(); it.hasNext();)
{
URIParam uriParam = (URIParam) it.next();
- String key = URLEncoder.encode((String) uriParam.getKey());
- String val = (String) uriParam.getValue();
+ String key = URLEncoder.encode(uriParam.getKey());
+ String val = String.valueOf(uriParam.getValue());
output.append(key);
output.append(valueDelim);