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);
if (providers!=null)
{
providers.forEach(p->
for (Module p:providers)
{
if (p!=module && p.isEnabled())
{
@ -283,16 +283,14 @@ public class Modules implements Iterable<Module>
p.clearTransitiveEnable();
if (p.hasDefaultConfig())
{
p.getDefaultConfig().forEach(a->
{
for (String a : p.getDefaultConfig())
_args.removeProperty(a,p.getName());
});
}
}
else
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()
{
if (listModules == null || listModules.contains("internal") || listModules.contains("-internal"))
return listModules;
List<String> modules = new ArrayList<>(listModules);
modules.add("-internal");
return modules;
return listModules;
}
public boolean isRun()
@ -953,7 +949,7 @@ public class StartArgs
// Module Management
if ("--list-modules".equals(arg))
{
listModules = Collections.emptyList();
listModules = Collections.singletonList("-internal");
run = false;
return;
}
@ -1135,17 +1131,6 @@ public class StartArgs
}
}
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
{
// Find and Expand XML files