From 302ffe4ff1cad367491647d1fdfdc38d85e5f3d7 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 27 Aug 2013 13:38:42 +1000 Subject: [PATCH] 415826 start.jar module --enable and --disable --- .../java/org/eclipse/jetty/start/Main.java | 6 +++--- .../java/org/eclipse/jetty/start/Modules.java | 21 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java index 7bdd5916efa..fdd4cf68abc 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Main.java @@ -704,9 +704,9 @@ public class Main // Process dependencies Modules modules = args.getAllModules(); Module module=modules.get(name); - - for (String parent:module.getParentNames()) - enable(args,parent,false); + if (module!=null) + for (String parent:module.getParentNames()) + enable(args,parent,false); } private void disable(StartArgs args, String name, boolean verbose) throws IOException diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index 7f0ae9c5d36..70a2861caa2 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -103,7 +103,12 @@ public class Modules implements Iterable for (String parentName : module.getParentNames()) { Module parent = get(parentName); - if (parent != null) + + if (parent == null) + { + System.err.printf("WARNING: module not found [%s]%n",parentName); + } + else { module.addParentEdge(parent); parent.addChildEdge(module); @@ -113,8 +118,11 @@ public class Modules implements Iterable for (String optionalParentName : module.getOptionalParentNames()) { Module optional = get(optionalParentName); - - if ((optional != null) && optional.isEnabled()) + if (optional==null) + { + System.err.printf("WARNING: module not found [%s]%n",optionalParentName); + } + else if (optional.isEnabled()) { module.addParentEdge(optional); optional.addChildEdge(module); @@ -301,12 +309,7 @@ public class Modules implements Iterable public Module get(String name) { - Module module = modules.get(name); - if (module == null) - { - System.err.printf("WARNING: module not found [%s]%n",name); - } - return module; + return modules.get(name); } @Override