geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/console/cli/controller ListDeployments.java
Date Thu, 22 Jul 2004 03:14:48 GMT
gdamour     2004/07/21 20:14:48

  Modified:    modules/core/src/java/org/apache/geronimo/console/cli/controller
                        ListDeployments.java
  Log:
  getAvailableModules returns null if no module exist.
  
  Revision  Changes    Path
  1.5       +22 -7     incubator-geronimo/modules/core/src/java/org/apache/geronimo/console/cli/controller/ListDeployments.java
  
  Index: ListDeployments.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/console/cli/controller/ListDeployments.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ListDeployments.java	10 Mar 2004 09:58:41 -0000	1.4
  +++ ListDeployments.java	22 Jul 2004 03:14:48 -0000	1.5
  @@ -104,14 +104,29 @@
                   ids = context.deployer.getAvailableModules(type, context.targets);
               } else {
                   List list = new ArrayList();
  -                list.addAll(Arrays.asList(context.deployer.getAvailableModules(ModuleType.CAR,
context.targets)));
  -                list.addAll(Arrays.asList(context.deployer.getAvailableModules(ModuleType.EAR,
context.targets)));
  -                list.addAll(Arrays.asList(context.deployer.getAvailableModules(ModuleType.EJB,
context.targets)));
  -                list.addAll(Arrays.asList(context.deployer.getAvailableModules(ModuleType.RAR,
context.targets)));
  -                list.addAll(Arrays.asList(context.deployer.getAvailableModules(ModuleType.WAR,
context.targets)));
  +                TargetModuleID[] modules = context.deployer.getAvailableModules(ModuleType.CAR,
context.targets);
  +                if ( null != modules ) {
  +                    list.addAll(Arrays.asList(modules));
  +                }
  +                modules = context.deployer.getAvailableModules(ModuleType.EAR, context.targets);
  +                if ( null != modules ) {
  +                    list.addAll(Arrays.asList(modules));
  +                }
  +                modules = context.deployer.getAvailableModules(ModuleType.EJB, context.targets);
  +                if ( null != modules ) {
  +                    list.addAll(Arrays.asList(modules));
  +                }
  +                modules = context.deployer.getAvailableModules(ModuleType.RAR, context.targets);
  +                if ( null != modules ) {
  +                    list.addAll(Arrays.asList(modules));
  +                }
  +                modules = context.deployer.getAvailableModules(ModuleType.WAR, context.targets);
  +                if ( null != modules ) {
  +                    list.addAll(Arrays.asList(modules));
  +                }
                   ids = (TargetModuleID[])list.toArray(new TargetModuleID[list.size()]);
               }
  -            println(ids.length == 0 ? "No matching modules found." : "Found "+ids.length+"
matching module"+(ids.length == 1 ? "" : "s"));
  +            println(null == ids || ids.length == 0 ? "No matching modules found." : "Found
"+ids.length+" matching module"+(ids.length == 1 ? "" : "s"));
               for(int i=0; i<ids.length; i++) {
                   println("  "+ids[i].toString());
               }
  
  
  

Mime
View raw message