Author: rwesten
Date: Thu Jun 28 04:24:25 2012
New Revision: 1354814

URL: http://svn.apache.org/viewvc?rev=1354814&view=rev
Log:
fixes STANBOL-661: values that can not be transformed to the requested XSD type 
are now silently ignored.

Modified:
    
incubator/stanbol/trunk/entityhub/ldpath/src/main/java/org/apache/stanbol/entityhub/ldpath/backend/AbstractBackend.java

Modified: 
incubator/stanbol/trunk/entityhub/ldpath/src/main/java/org/apache/stanbol/entityhub/ldpath/backend/AbstractBackend.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/ldpath/src/main/java/org/apache/stanbol/entityhub/ldpath/backend/AbstractBackend.java?rev=1354814&r1=1354813&r2=1354814&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/entityhub/ldpath/src/main/java/org/apache/stanbol/entityhub/ldpath/backend/AbstractBackend.java
 (original)
+++ 
incubator/stanbol/trunk/entityhub/ldpath/src/main/java/org/apache/stanbol/entityhub/ldpath/backend/AbstractBackend.java
 Thu Jun 28 04:24:25 2012
@@ -370,22 +370,24 @@ public abstract class AbstractBackend im
      */
     @SuppressWarnings("unchecked")
     private <T> T convert(DataTypeEnum type, Object value){
-        T converted;
+//        T converted;
         Object convertedObject = valueConverter.convert(value, type.getUri(), 
getValueFactory());
         try {
-            converted = (T)convertedObject;
+            return (T)convertedObject;
         } catch (ClassCastException e) {
             //this is something unexpected ... fail cleanly
             throw new IllegalStateException("Convert value for Node'"+
                 value+"' has not the expected java type "+type.getJavaType()+
                 "(for type '"+type.getShortName()+"') but 
'"+convertedObject.getClass()+"'!");
         }
-        if(converted == null){
-            throw new IllegalArgumentException("Unable to convert value '"+
-                value+"' to dataType '"+type.getShortName()+"' (java: "+
-                type.getJavaType()+")!");
-        }
-        return converted;
+        //STANBOL-661: silently ignore values that can not be transformed to 
the
+        //  requested xsd data type
+//        if(converted == null){
+//            throw new IllegalArgumentException("Unable to convert value '"+
+//                value+"' to dataType '"+type.getShortName()+"' (java: "+
+//                type.getJavaType()+")!");
+//        }
+//        return converted;
     }
     /*
      * Utility methods for managing the local cache


Reply via email to