geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r662175 - in /geronimo/gshell/trunk: gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/ gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/ gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/
Date Sun, 01 Jun 2008 08:37:04 GMT
Author: jdillon
Date: Sun Jun  1 01:37:04 2008
New Revision: 662175

URL: http://svn.apache.org/viewvc?rev=662175&view=rev
Log:
Make accessors NPE safe

Modified:
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/Command.java
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/CommandSet.java
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/Command.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/Command.java?rev=662175&r1=662174&r2=662175&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/Command.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/Command.java
Sun Jun  1 01:37:04 2008
@@ -46,10 +46,6 @@
 
     private String version;
 
-    //
-    // FIXME: Make collection accessors null-safe
-    //
-    
     private List<Parameter> parameters;
 
     private List<Requirement> requirements;
@@ -95,6 +91,9 @@
     }
 
     public List<Parameter> getParameters() {
+        if (parameters == null) {
+            parameters = new ArrayList<Parameter>();
+        }
         return parameters;
     }
 
@@ -117,6 +116,9 @@
     }
 
     public List<Requirement> getRequirements() {
+        if (requirements == null) {
+            requirements = new ArrayList<Requirement>();
+        }
         return requirements;
     }
 

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/CommandSet.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/CommandSet.java?rev=662175&r1=662174&r2=662175&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/CommandSet.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/command/CommandSet.java
Sun Jun  1 01:37:04 2008
@@ -41,10 +41,6 @@
 
     private String description;
 
-    //
-    // FIXME: Make collection accessors null-safe
-    //
-
     private List<Command> commands;
 
     public CommandSet() {}
@@ -74,6 +70,9 @@
     }
 
     public List<Command> getCommands() {
+        if (commands == null) {
+            commands = new ArrayList<Command>();
+        }
         return commands;
     }
 

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java?rev=662175&r1=662174&r2=662175&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
Sun Jun  1 01:37:04 2008
@@ -46,10 +46,6 @@
 
     private List<DependencyGroup> dependencyGroups;
 
-    //
-    // FIXME: Make collection accessors null-safe
-    //
-
     private List<Command> commands;
 
     private Layout layout;

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java?rev=662175&r1=662174&r2=662175&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
(original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
Sun Jun  1 01:37:04 2008
@@ -181,7 +181,6 @@
         LocalRepository localRepository = application.getLocalRepository();
 
         if (localRepository != null) {
-            // FIXME: Need to root the local repo's directory to user.home if its relative
for now util ${user.home} expansion is supported
             artifactManager.getRepositoryManager().setLocalRepository(localRepository.getDirectoryFile());
         }
 



Mime
View raw message