Skip to content

Commit 9542a04

Browse files
committedMay 31, 2013
Not started required modules error message should not include modules
that are already started - TRUNK-3999(cherry picked from commit b598f28)
1 parent 466cd8b commit 9542a04

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
 

‎api/src/main/java/org/openmrs/module/ModuleFactory.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,21 @@ public int compare(Module left, Module right) {
346346
private static List<String> getMissingRequiredModules(Module module) {
347347
List<String> ret = new ArrayList<String>();
348348
for (String moduleName : module.getRequiredModules()) {
349-
String moduleVersion = module.getRequiredModuleVersion(moduleName);
350-
ret.add(moduleName + (moduleVersion != null ? " " + moduleVersion : ""));
349+
boolean started = false;
350+
for (Module mod : getStartedModules()) {
351+
if (mod.getPackageName().equals(moduleName)) {
352+
String reqVersion = module.getRequiredModuleVersion(moduleName);
353+
if (reqVersion == null || ModuleUtil.compareVersion(mod.getVersion(), reqVersion) >= 0) {
354+
started = true;
355+
}
356+
break;
357+
}
358+
}
359+
360+
if (!started) {
361+
String moduleVersion = module.getRequiredModuleVersion(moduleName);
362+
ret.add(moduleName + (moduleVersion != null ? " " + moduleVersion : ""));
363+
}
351364
}
352365
return ret;
353366
}

0 commit comments

Comments
 (0)
Please sign in to comment.