incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r730342 - /incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
Date Wed, 31 Dec 2008 07:47:48 GMT
Author: cziegeler
Date: Tue Dec 30 23:47:48 2008
New Revision: 730342

URL: http://svn.apache.org/viewvc?rev=730342&view=rev
Log:
SLING-797 - Fix potential class cast exception if value is not a string.

Modified:
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java?rev=730342&r1=730341&r2=730342&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrResourceUtil.java
Tue Dec 30 23:47:48 2008
@@ -125,8 +125,8 @@
             val = fac.createValue(((Number)value).doubleValue());
         } else if (value instanceof Boolean) {
             val = fac.createValue((Boolean) value);
-        } else if ( value != null ){
-            val = fac.createValue(value.toString());
+        } else if ( value instanceof String ){
+            val = fac.createValue((String)value);
         } else {
             val = null;
         }



Mime
View raw message