Code commits
openmrs-core
-
Ivo Ulrich <teleivo@users.noreply.github.com> 7606d3e69fbf433a9ccb91241408b6124d826610
Merge pull request #2180 from teleivo/TRUNK-5157
TRUNK-5157 ProgramWorkflowEditor tries to get state by uuid twice -
teleivo <mrteleivo@gmail.com> c1d26c728149614a7c1dce1db7557308a16da46c
TRUNK-5157 ProgramWorkflowEditor tries to get state by uuid twice
the catch block will never be reached since getByUuid() just returns
null if nothing is found. The exception in the try block is normally
thrown by Integer.valueOf() if the text is a uuid and not a number
* use getState(Integer) first to try to get the ProgramWorkflow by
its id
* is text is not an Integer, the exception in Integer.valueOf will lead
to the catch block being executed which then tries to fetch by the uuid
* added tests- api/src/main/java/org/openmrs/propertyeditor/ProgramWorkflowEditor.java (version c1d26c728149614a7c1dce1db7557308a16da46c)
- api/src/test/java/org/openmrs/propertyeditor/ProgramWorkflowEditorTest.java (version c1d26c728149614a7c1dce1db7557308a16da46c)