Details
-
Type:
New Feature
-
Status: Closed
-
Priority:
Could
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Core 2.1.0
-
Component/s: None
-
Labels:None
-
Complexity:Low
Description
I see a lot of this:
supportedOpenmrsVersions = subresourceAnnotation.supportedOpenmrsVersions(); if (supportedOpenmrsVersions.length != 0) { boolean supported = false; for (String supportedVersion : supportedOpenmrsVersions) { try { ModuleUtil.checkRequiredVersion(OpenmrsConstants.OPENMRS_VERSION_SHORT, supportedVersion); supported = true; continue; } catch (Exception e) {} } if (!supported) { continue; } }
in the REST module. (Forget about the bad practice of using try/catch for control flow; already opened an issue and am cleaning that up https://issues.openmrs.org/browse/RESTWS-609)
see for example
There are at least 5 places in the REST module where one needs to check if a requiredVersion is in an array of supportedVersions.
I therefore propose to add method
ModuleUtil.isOpenmrsVersionInVersions(String[] versions)
which does exactly that and is tested.
Gliffy Diagrams
Attachments
Issue Links
- is depended on by
-
RESTWS-616 Use ModuleUtil.isOpenmrsVersionInVersions()
-
- Closed
-