Iterator allModules = modules.values().iterator();
Map<String,Version> defaultModules = new HashMap<String,Version>();
while (allModules.hasNext()) {
AxisModule axisModule = (AxisModule) allModules.next();
String name = axisModule.getName();
Version currentDefaultVersion = defaultModules.get(name);
Version version = axisModule.getVersion();
if (currentDefaultVersion == null ||
(version != null && version.compareTo(currentDefaultVersion) > 0)) {
defaultModules.put(name, version);
}
}
Iterator def_mod_itr = defaultModules.keySet().iterator();
while (def_mod_itr.hasNext()) {
String moduleName = (String) def_mod_itr.next();
Version version = defaultModules.get(moduleName);
axisConfig.addDefaultModuleVersion(moduleName, version == null ? null : version.toString());
}
}