incubator-sling-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=730341&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=730341&r1=730340&r2=730341&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:07 2008
@@ -125,8 +125,10 @@
             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 {
-            val = fac.createValue((String)value);
+            val = null;
         }
         return val;
     }



Mime
View raw message