if (modules != null) {
cModules = new ArrayList();
for (int i = 0; i < modules.size(); i++) {
Module module = (Module) modules.get(i);
Module clonedModule = null;
try {
if (module instanceof DCModule) {
clonedModule = new DCModuleImpl();
} else if (module instanceof SyModule) {
clonedModule = new SyModuleImpl();
}
clonedModule.copyFrom(module);
cModules.add(clonedModule);
} catch (Exception ex) {
throw new RuntimeException("Cloning modules", ex);
}
}