Commit 5a64aaca authored by DominikE's avatar DominikE

Extract method

parent 2fddcf0d
Pipeline #2517 passed with stage
in 42 seconds
......@@ -142,15 +142,7 @@ public class Moduli
Class<? extends AModule> id = (Class<? extends AModule>) Class
.forName(config.getString(moduleMessage(i, "[@id]")));
Class<? extends AModule> clazz;
final String implementationKey = moduleMessage(i, ".implementation");
if (config.containsKey(implementationKey))
{
clazz = (Class<? extends AModule>) Class.forName(config.getString(implementationKey));
} else
{
clazz = id;
}
Class<? extends AModule> clazz = getImplementation(i, id);
SubnodeConfiguration moduleConfig = getModuleConfig(moduleMessage(i, ".properties"));
......@@ -179,6 +171,19 @@ public class Moduli
}
@SuppressWarnings("unchecked")
private Class<? extends AModule> getImplementation(final int i, final Class<? extends AModule> id)
throws ClassNotFoundException
{
final String implementationKey = moduleMessage(i, ".implementation");
if (config.containsKey(implementationKey))
{
return (Class<? extends AModule>) Class.forName(config.getString(implementationKey));
}
return id;
}
private SubnodeConfiguration getModuleConfig(final String key)
{
try
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment