geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r765283 - /geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
Date Wed, 15 Apr 2009 17:42:47 GMT
Author: gawor
Date: Wed Apr 15 17:42:47 2009
New Revision: 765283

URL: http://svn.apache.org/viewvc?rev=765283&view=rev
Log:
null values are not allowed in map keys

Modified:
    geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java

Modified: geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java?rev=765283&r1=765282&r2=765283&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
(original)
+++ geronimo/sandbox/blueprint/org.apache.felix.blueprint/src/main/java/org/apache/felix/blueprint/context/Parser.java
Wed Apr 15 17:42:47 2009
@@ -496,7 +496,7 @@
         for (int i = 0; i < nl.getLength(); i++) {
             Node node = nl.item(i);
             if (node instanceof Element) {
-                Value val = parseValueElement((Element) node, enclosingComponent);
+                Value val = parseValueElement((Element) node, enclosingComponent, true);
                 list.add(val);
             }
         }
@@ -595,9 +595,9 @@
             if (node instanceof Element) {
                 Element e = (Element) node;
                 if (nodeNameEquals(e, KEY_ELEMENT)) {
-                    keyValue = parseValueElement(e, enclosingComponent);
+                    keyValue = parseValueElement(e, enclosingComponent, false);
                 } else {
-                    valValue = parseValueElement(e, enclosingComponent);
+                    valValue = parseValueElement(e, enclosingComponent, true);
                 }
             }
         }
@@ -896,7 +896,7 @@
                     if (isBlueprintNamespace(node.getNamespaceURI())) {
                         // Ignore description elements
                         if (!nodeNameEquals(node, DESCRIPTION_ELEMENT)) {
-                            return parseValueElement(e, enclosingComponent);
+                            return parseValueElement(e, enclosingComponent, true);
                         }
                     } else {
                         ComponentMetadata innerComponent = parseCustomElement(e, enclosingComponent);
@@ -908,11 +908,11 @@
         throw new ComponentDefinitionException("One of " + REF_ATTRIBUTE + " attribute, "
+ VALUE_ATTRIBUTE + " attribute or sub element must be set");
     }
 
-    private Value parseValueElement(Element element, ComponentMetadata enclosingComponent)
{
+    private Value parseValueElement(Element element, ComponentMetadata enclosingComponent,
boolean allowNull) {
         if (nodeNameEquals(element, COMPONENT_ELEMENT)) {
             LocalComponentMetadata inner = parseComponentMetadata(element);
             return new ComponentValueImpl(inner);
-        } else if (nodeNameEquals(element, NULL_ELEMENT)) {
+        } else if (nodeNameEquals(element, NULL_ELEMENT) && allowNull) {
             return NullValue.NULL;
         } else if (nodeNameEquals(element, VALUE_ELEMENT)) {
             String type = null;



Mime
View raw message