geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r438104 - in /geronimo/server/trunk/modules: geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java
Date Tue, 29 Aug 2006 15:50:51 GMT
Author: djencks
Date: Tue Aug 29 08:50:48 2006
New Revision: 438104

URL: http://svn.apache.org/viewvc?rev=438104&view=rev
Log:
GERONIMO-2362 fix a couple npes

Modified:
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
    geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java?rev=438104&r1=438103&r2=438104&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
Tue Aug 29 08:50:48 2006
@@ -38,7 +38,8 @@
 
     public DeploymentConfiguration createConfiguration(DeployableObject deployable) {
         if (ModuleType.RAR.equals(deployable.getType())) {
-            if (deployable.getDDBeanRoot().getDDBeanRootVersion().equals("1.5")) {
+            String ddBeanRootVersion = deployable.getDDBeanRoot().getDDBeanRootVersion();
+            if (ddBeanRootVersion != null && ddBeanRootVersion.equals("1.5")) {
                 return new RARConfiguration(deployable, new Connector15DCBRoot(deployable.getDDBeanRoot()));
             }
             String[] specVersion = deployable.getDDBeanRoot().getText("connector/spec-version");

Modified: geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java?rev=438104&r1=438103&r2=438104&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java
Tue Aug 29 08:50:48 2006
@@ -32,8 +32,6 @@
 import org.apache.xmlbeans.XmlObject;
 
 /**
- *
- *
  * @version $Rev$ $Date$
  */
 public class DDBeanRootImpl implements DDBeanRoot {
@@ -45,21 +43,21 @@
         InputStream is = null;
         try {
             is = descriptor.openStream();
-        try {
-        XmlObject xmlObject = XmlBeansUtil.parse(is);
-            XmlCursor c = xmlObject.newCursor();
             try {
-                c.toStartDoc();
-                c.toFirstChild();
-                docBean = new DDBeanImpl(this, this, "/" + c.getName().getLocalPart(), c);
+                XmlObject xmlObject = XmlBeansUtil.parse(is);
+                XmlCursor c = xmlObject.newCursor();
+                try {
+                    c.toStartDoc();
+                    c.toFirstChild();
+                    docBean = new DDBeanImpl(this, this, "/" + c.getName().getLocalPart(),
c);
+                } finally {
+                    c.dispose();
+                }
             } finally {
-                c.dispose();
+                is.close();
             }
-        } finally {
-            is.close();
-        }
         } catch (Exception e) {
-            throw (DDBeanCreateException)new DDBeanCreateException("problem").initCause(e);
+            throw (DDBeanCreateException) new DDBeanCreateException("problem").initCause(e);
         }
     }
 
@@ -115,11 +113,13 @@
         String childName = (index == -1) ? xpath : xpath.substring(0, index);
         if (("/" + childName).equals(docBean.getXpath())) {
             if (index == -1) {
-                return new DDBean[] {new DDBeanImpl((DDBeanImpl)docBean, xpath)};
+                return new DDBean[]{new DDBeanImpl((DDBeanImpl) docBean, xpath)};
             } else {
-                DDBean[] newDDBeans = docBean.getChildBean(xpath.substring(index+1));
-                for (int i = 0; i < newDDBeans.length; i++) {
-                    newDDBeans[i] = new DDBeanImpl((DDBeanImpl)newDDBeans[i], xpath);
+                DDBean[] newDDBeans = docBean.getChildBean(xpath.substring(index + 1));
+                if (newDDBeans != null) {
+                    for (int i = 0; i < newDDBeans.length; i++) {
+                        newDDBeans[i] = new DDBeanImpl((DDBeanImpl) newDDBeans[i], xpath);
+                    }
                 }
                 return newDDBeans;
             }



Mime
View raw message