chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1457690 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
Date Mon, 18 Mar 2013 09:57:48 GMT
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) {



Mime
View raw message