geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r675684 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/DependencyHelper.java
Date Thu, 10 Jul 2008 19:10:40 GMT
Author: mcconne
Date: Thu Jul 10 12:10:39 2008
New Revision: 675684

URL: http://svn.apache.org/viewvc?rev=675684&view=rev
Log:
GERONIMODEVTOOLS-428 Better handle null JAXBElements

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/DependencyHelper.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/DependencyHelper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/DependencyHelper.java?rev=675684&r1=675683&r2=675684&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/DependencyHelper.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/DependencyHelper.java
Thu Jul 10 12:10:39 2008
@@ -312,7 +312,7 @@
         for (Iterator ii = parents.iterator(); ii.hasNext();) {
             Artifact artifact = (Artifact)ii.next();
             if (dm.getParents(artifact).size() > 0 && !artifact.equals(terminatingArtifact)
&&
-               !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact))
{
+                !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact))
{
                 // Keep processing parents (as long as no circular dependencies)
                 processParents(dm.getParents(artifact), terminatingArtifact);
                 // Move self 
@@ -350,24 +350,32 @@
 
         Environment environment = null;
         if (GeronimoUtils.isWebModule(module)) {
-            WebApp plan = getWebDeploymentPlan(module).getValue();
-            if (plan != null)
-                environment = plan.getEnvironment();
+            if (getWebDeploymentPlan(module) != null) {
+                WebApp plan = getWebDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
         }
         else if (GeronimoUtils.isEjbJarModule(module)) {
-            OpenejbJar plan = getOpenEjbDeploymentPlan(module).getValue();
-            if (plan != null)
-                environment = plan.getEnvironment();
+            if (getOpenEjbDeploymentPlan(module) != null) {
+                OpenejbJar plan = getOpenEjbDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
         }
         else if (GeronimoUtils.isEarModule(module)) {
-            Application plan = getApplicationDeploymentPlan(module).getValue();
-            if (plan != null)
-                environment = plan.getEnvironment();
+            if (getApplicationDeploymentPlan(module) != null) {
+                Application plan = getApplicationDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
         }
         else if (GeronimoUtils.isRARModule(module)) {
-            Connector plan = getConnectorDeploymentPlan(module).getValue();
-            if (plan != null)
-                environment = plan.getEnvironment();
+            if (getConnectorDeploymentPlan(module) != null) {
+                Connector plan = getConnectorDeploymentPlan(module).getValue();
+                if (plan != null)
+                    environment = plan.getEnvironment();
+            }
         }
 
         Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
@@ -536,7 +544,7 @@
         for (Iterator ii = parents.iterator(); ii.hasNext();) {
             Artifact artifact = (Artifact)ii.next();
             if (dm.getParents(artifact).size() > 0 && !artifact.equals(terminatingArtifact)
&&
-               !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact))
{
+                !dm.getParents(artifact).contains(artifact) && !dm.getChildren(artifact).contains(artifact))
{
                 // Keep processing parents (as long as no circular dependencies)
                 processJaxbParents(dm.getParents(artifact), terminatingArtifact);
                 // Move self 
@@ -574,21 +582,19 @@
 
         Environment environment = null;
         Object plan = jaxbElement.getValue();
-        if (WebApp.class.isInstance(plan)) {
-            if (plan != null)
+        if (plan != null) {
+            if (WebApp.class.isInstance(plan)) {
                 environment = ((WebApp)plan).getEnvironment();
-        }
-        else if (OpenejbJar.class.isInstance(plan)) {
-            if (plan != null)
+            }
+            else if (OpenejbJar.class.isInstance(plan)) {
                 environment = ((OpenejbJar)plan).getEnvironment();
-        }
-        else if (Application.class.isInstance(plan)) {
-            if (plan != null)
+            }
+            else if (Application.class.isInstance(plan)) {
                 environment = ((Application)plan).getEnvironment();
-        }
-        else if (Connector.class.isInstance(plan)) {
-            if (plan != null)
+            }
+            else if (Connector.class.isInstance(plan)) {
                 environment = ((Connector)plan).getEnvironment();
+            }
         }
 
         Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);



Mime
View raw message