jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r698332 - /jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
Date Tue, 23 Sep 2008 20:14:46 GMT
Author: clombart
Date: Tue Sep 23 13:14:45 2008
New Revision: 698332

URL: http://svn.apache.org/viewvc?rev=698332&view=rev
Log:
Apply patch provided by Boni Gopalan for issue JCR-1758 (Improvement to UndefinedTypeConverterImpl
to map super types effectively). 

Modified:
    jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/atomictypeconverter/impl/UndefinedTypeConverterImpl.java

Modified: jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/atomictypeconverter/impl/UndefinedTypeConverterImpl.java?rev=698332&r1=698331&r2=698332&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-ocm/src/main/java/org/apache/jackrabbit/ocm/manager/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
Tue Sep 23 13:14:45 2008
@@ -32,10 +32,11 @@
 
 /**
  *
- * String Type Converter
+ * Undefined Type Converter
  *
  * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
  * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
+ * @author : <a href="mailto:boni.g@bioimagene.com">Boni Gopalan</a>
  */
 public class UndefinedTypeConverterImpl implements AtomicTypeConverter
 {
@@ -43,6 +44,8 @@
 	 *
 	 * @see org.apache.jackrabbit.ocm.manager.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
+	
+	
 	public Value getValue(ValueFactory valueFactory, Object propValue)
 	{
 
@@ -51,55 +54,44 @@
 			return null;
 		  }
 		
-          if (propValue.getClass() == String.class)
+          if (propValue instanceof String )
           {
         	  return valueFactory.createValue((String) propValue);
           }
 
-          if (propValue.getClass() == InputStream.class)
+          if (propValue instanceof InputStream)
           {
         	  return valueFactory.createValue((InputStream) propValue);
           }
 	
-          if ((propValue.getClass() == Long.class) ||(propValue.getClass() == Integer.class))
+          if ((propValue instanceof Long || propValue instanceof Integer))
           {
         	  return valueFactory.createValue(((Number) propValue).longValue());
           }
 
-          if (propValue.getClass() == Double.class )
+          if (propValue instanceof Double )
           {
         	  return valueFactory.createValue(((Double) propValue).doubleValue());
           }
 
-          if (propValue.getClass() == Boolean.class )
+          if (propValue instanceof Boolean )
           {
         	  return valueFactory.createValue(((Boolean) propValue).booleanValue());
           }
 
-          if (propValue.getClass() == Calendar.class )
+          if (propValue instanceof Calendar )
           {
         	
         	  return valueFactory.createValue((Calendar) propValue);
           }
 
-          if (propValue.getClass() == GregorianCalendar.class )
-          {
-        	  return valueFactory.createValue((GregorianCalendar) propValue);
-          }
-
-          if (propValue.getClass() == GregorianCalendar.class )
+          if (propValue instanceof GregorianCalendar )
           {
         	  return valueFactory.createValue((GregorianCalendar) propValue);
           }
 
-          if (propValue.getClass() == Date.class )
-          {
-        	  Calendar calendar = Calendar.getInstance();
-        	  calendar.setTime((Date) propValue);
-        	  return valueFactory.createValue(calendar);
-          }
 
-          if (propValue.getClass() == Date.class )
+          if (propValue instanceof Date )
           {
         	  Calendar calendar = Calendar.getInstance();
         	  calendar.setTime((Date) propValue);



Mime
View raw message