You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by st...@apache.org on 2014/05/16 14:36:57 UTC

svn commit: r1595178 - /sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltNodeTypeFactory.java

Author: stefanegli
Date: Fri May 16 12:36:57 2014
New Revision: 1595178

URL: http://svn.apache.org/r1595178
Log:
SLING-3571 : applied patch from Robert Munteanu, thanks!

Modified:
    sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltNodeTypeFactory.java

Modified: sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltNodeTypeFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltNodeTypeFactory.java?rev=1595178&r1=1595177&r2=1595178&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltNodeTypeFactory.java (original)
+++ sling/trunk/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltNodeTypeFactory.java Fri May 16 12:36:57 2014
@@ -161,28 +161,32 @@ public class VltNodeTypeFactory {
         
         // load mandatory
         String[] mandatoryProperties = (String[]) child.getProperties().get("rep:mandatoryProperties");
-        for (int i = 0; i < mandatoryProperties.length; i++) {
-            String aMandatoryProperty = mandatoryProperties[i];
-            VltPropertyDefinition vpd = pds.get(aMandatoryProperty);
-            if (vpd==null) {
-                vpd = new VltPropertyDefinition();
-                vpd.setName(aMandatoryProperty);
-                pds.put(aMandatoryProperty, vpd);
+        if (mandatoryProperties!=null) {
+            for (int i = 0; i < mandatoryProperties.length; i++) {
+                String aMandatoryProperty = mandatoryProperties[i];
+                VltPropertyDefinition vpd = pds.get(aMandatoryProperty);
+                if (vpd==null) {
+                    vpd = new VltPropertyDefinition();
+                    vpd.setName(aMandatoryProperty);
+                    pds.put(aMandatoryProperty, vpd);
+                }
+                vpd.setMandatory(true);
             }
-            vpd.setMandatory(true);
         }
         
         // load protected
         String[] protectedProperties = (String[]) child.getProperties().get("rep:protectedProperties");
-        for (int i = 0; i < protectedProperties.length; i++) {
-            String aProtectedProperties = protectedProperties[i];
-            VltPropertyDefinition vpd = pds.get(aProtectedProperties);
-            if (vpd==null) {
-                vpd = new VltPropertyDefinition();
-                vpd.setName(aProtectedProperties);
-                pds.put(aProtectedProperties, vpd);
+        if (protectedProperties!=null) {
+            for (int i = 0; i < protectedProperties.length; i++) {
+                String aProtectedProperties = protectedProperties[i];
+                VltPropertyDefinition vpd = pds.get(aProtectedProperties);
+                if (vpd==null) {
+                    vpd = new VltPropertyDefinition();
+                    vpd.setName(aProtectedProperties);
+                    pds.put(aProtectedProperties, vpd);
+                }
+                vpd.setProtected(true);
             }
-            vpd.setProtected(true);
         }
         
         nt.setDeclaredPropertyDefinitions(pds.values().toArray(new VltPropertyDefinition[pds.size()]));