geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r656677 - /geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
Date Thu, 15 May 2008 14:16:20 GMT
Author: gawor
Date: Thu May 15 07:16:20 2008
New Revision: 656677

URL: http://svn.apache.org/viewvc?rev=656677&view=rev
Log:
check for children (update to fix for GERONIMO-3944)

Modified:
    geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java

Modified: geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java?rev=656677&r1=656676&r2=656677&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
(original)
+++ geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
Thu May 15 07:16:20 2008
@@ -128,17 +128,18 @@
     private static Map<Object, List<XmlCursor>> createElementMap(XmlCursor cursor)
{        
         Map<Object, List<XmlCursor>> map = new HashMap<Object, List<XmlCursor>>();
  
         cursor.toStartDoc();
-        cursor.toFirstChild();
-        do {
-            QName name = cursor.getName();            
-            List<XmlCursor> locations = map.get(name);
-            if (locations == null) {
-                locations = new ArrayList<XmlCursor>();
-                map.put(name, locations);
-                map.put(name.getLocalPart(), locations);
-            }
-            locations.add(cursor.newCursor());
-        } while(cursor.toNextSibling());
+        if (cursor.toFirstChild()) {
+            do {
+                QName name = cursor.getName();            
+                List<XmlCursor> locations = map.get(name);
+                if (locations == null) {
+                    locations = new ArrayList<XmlCursor>();
+                    map.put(name, locations);
+                    map.put(name.getLocalPart(), locations);
+                }
+                locations.add(cursor.newCursor());
+            } while(cursor.toNextSibling());
+        }
         return map;
     }
     



Mime
View raw message