You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by je...@apache.org on 2013/03/18 10:57:48 UTC

svn commit: r1457690 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java

Author: jens
Date: Mon Mar 18 09:57:48 2013
New Revision: 1457690

URL: http://svn.apache.org/r1457690
Log:
InMemory: fix NPE when creating types without properties

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java?rev=1457690&r1=1457689&r2=1457690&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java Mon Mar 18 09:57:48 2013
@@ -155,14 +155,16 @@ public class TypeValidator {
         td.setTypeMutability(tm);
         td.setExtensions(td.getExtensions());
         
-        Map<String, PropertyDefinition<?>> propDefsNew = new HashMap<String, PropertyDefinition<?>>();
-        Map<String, PropertyDefinition<?>> propDefs = td.getPropertyDefinitions();
-        for (PropertyDefinition<?> pd : propDefs.values()) {
-            AbstractPropertyDefinition<?> pdNew = completePropertyDef(pd);
-            adjustPropertyNamesAndId(pdNew);
-            propDefsNew.put(pdNew.getId(), pd);
+        if (null != td.getPropertyDefinitions()) {
+            Map<String, PropertyDefinition<?>> propDefsNew = new HashMap<String, PropertyDefinition<?>>();
+            Map<String, PropertyDefinition<?>> propDefs = td.getPropertyDefinitions();
+            for (PropertyDefinition<?> pd : propDefs.values()) {
+                AbstractPropertyDefinition<?> pdNew = completePropertyDef(pd);
+                adjustPropertyNamesAndId(pdNew);
+                propDefsNew.put(pdNew.getId(), pd);
+            }
+            td.setPropertyDefinitions(propDefsNew);
         }
-        td.setPropertyDefinitions(propDefsNew);
     }
 
     private static void checkProperties(TypeManager tm, Collection<PropertyDefinition<?>> pds) {