code cleanup

This commit is contained in:
Greg Wilkins 2016-10-13 10:51:01 +11:00
parent 8e4c595b52
commit 438ecb8dc3
2 changed files with 6 additions and 23 deletions

View File

@ -273,7 +273,7 @@ public class Modules implements Iterable<Module>
Set<Module> providers = _provided.get(name); Set<Module> providers = _provided.get(name);
if (providers!=null) if (providers!=null)
{ {
providers.forEach(p-> for (Module p:providers)
{ {
if (p!=module && p.isEnabled()) if (p!=module && p.isEnabled())
{ {
@ -283,16 +283,14 @@ public class Modules implements Iterable<Module>
p.clearTransitiveEnable(); p.clearTransitiveEnable();
if (p.hasDefaultConfig()) if (p.hasDefaultConfig())
{ {
p.getDefaultConfig().forEach(a-> for (String a : p.getDefaultConfig())
{
_args.removeProperty(a,p.getName()); _args.removeProperty(a,p.getName());
});
} }
} }
else else
throw new UsageException("%s provides %s, which is already provided by %s enabled in %s",module.getName(),name,p.getName(),p.getEnableSources()); throw new UsageException("%s provides %s, which is already provided by %s enabled in %s",module.getName(),name,p.getName(),p.getEnableSources());
} }
}); };
} }
} }

View File

@ -752,11 +752,7 @@ public class StartArgs
public List<String> getListModules() public List<String> getListModules()
{ {
if (listModules == null || listModules.contains("internal") || listModules.contains("-internal")) return listModules;
return listModules;
List<String> modules = new ArrayList<>(listModules);
modules.add("-internal");
return modules;
} }
public boolean isRun() public boolean isRun()
@ -953,7 +949,7 @@ public class StartArgs
// Module Management // Module Management
if ("--list-modules".equals(arg)) if ("--list-modules".equals(arg))
{ {
listModules = Collections.emptyList(); listModules = Collections.singletonList("-internal");
run = false; run = false;
return; return;
} }
@ -1134,18 +1130,7 @@ public class StartArgs
list.add(source); list.add(source);
} }
} }
public void parseModule(Module module)
{
if (module.hasDefaultConfig())
{
for (String line : module.getDefaultConfig())
{
parse(line,module.getName(),false);
}
}
}
public void resolveExtraXmls(BaseHome baseHome) throws IOException public void resolveExtraXmls(BaseHome baseHome) throws IOException
{ {
// Find and Expand XML files // Find and Expand XML files