geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r769111 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
Date Mon, 27 Apr 2009 19:17:33 GMT
Author: gnodet
Date: Mon Apr 27 19:17:32 2009
New Revision: 769111

URL: http://svn.apache.org/viewvc?rev=769111&view=rev
Log:
Make sure key / value for properties are specified

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

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java?rev=769111&r1=769110&r2=769111&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
Mon Apr 27 19:17:32 2009
@@ -587,9 +587,16 @@
 
     private MapEntry parseProperty(Element element) {
         // Parse attributes
+        if (!element.hasAttribute(KEY_ATTRIBUTE)) {
+            throw new ComponentDefinitionException(KEY_ATTRIBUTE + " attribute is required");
+        }
+        if (!element.hasAttribute(VALUE_ATTRIBUTE)) {
+            throw new ComponentDefinitionException(VALUE_ATTRIBUTE + " attribute is required");
+        }
         String key = element.getAttribute(KEY_ATTRIBUTE);
-        String value = element.hasAttribute(VALUE_ATTRIBUTE) ? element.getAttribute(VALUE_ATTRIBUTE)
: null;
-        return new MapEntryImpl(new ValueMetadataImpl(key), value != null ? new ValueMetadataImpl(value)
: NullMetadata.NULL);
+        String value = element.getAttribute(VALUE_ATTRIBUTE);
+        return new MapEntryImpl(new ValueMetadataImpl(key, String.class.getName()),
+                                new ValueMetadataImpl(value, String.class.getName()));
     }
 
     public MapMetadata parseMap(Element element, ComponentMetadata enclosingComponent) {



Mime
View raw message