1
0
Fork 0

fixed bug: "name" turned out to be not real name, but boolean "is name".

master
Alexey Skorokhodov 2015-05-30 12:24:03 -07:00
parent fec5da7ab4
commit 24e8e04927
1 changed files with 4 additions and 4 deletions

View File

@ -281,19 +281,19 @@ public class Issue extends Resource {
this.transitions = transitions;
}
private Transition getTransition(String id, boolean name) throws JiraException {
private Transition getTransition(String id, boolean isName) throws JiraException {
Transition result = null;
for (Transition transition : transitions) {
if((name && id.equals(transition.getName())
|| (!name && id.equals(transition.getId())))){
if((isName && id.equals(transition.getName())
|| (!isName && id.equals(transition.getId())))){
result = transition;
}
}
if (result == null) {
final String allTransitionNames = Arrays.toString(transitions.toArray());
throw new JiraException("Transition '" + name + "' was not found. Known transitions are:" + allTransitionNames);
throw new JiraException("Transition '" + id + "' was not found. Known transitions are:" + allTransitionNames);
}
return result;