incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r290784 - /incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java
Date Wed, 21 Sep 2005 18:45:40 GMT
Author: clombart
Date: Wed Sep 21 11:45:37 2005
New Revision: 290784

URL: http://svn.apache.org/viewcvs?rev=290784&view=rev
Log:
bug fix : if the collection class is a manageable class, return an instance of this class

Modified:
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java?rev=290784&r1=290783&r2=290784&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java
Wed Sep 21 11:45:37 2005
@@ -65,8 +65,16 @@
             {
                 return new ManageableArrayList();
             }
-
-            throw new JcrMappingException("Unsupported collection type :" + collectionClass.getName());
+            
+            Object collection  = collectionClass.newInstance();
+            if (! (collection instanceof ManageableCollection))
+            {
+               throw new JcrMappingException("Unsupported collection type :" + collectionClass.getName());
+            }
+            else
+            {
+                return (ManageableCollection) collection;
+            }
         }
         catch (Exception e)
         {



Mime
View raw message