Fix wrong event object comparison
- Classic case of using == vs. equals if Strings are involved. - In DefaultStateMachineExecutor change event comparison from == to equals. - Tests using enums naturally work, but some tests using Strings had a wrong checks. - Fixes #253
This commit is contained in:
@@ -366,8 +366,8 @@ public class DefaultStateMachineExecutor<S, E> extends LifecycleObjectSupport im
|
||||
Trigger<S, E> tri = e.getKey();
|
||||
E ee = tri.getEvent();
|
||||
Transition<S, E> tra = e.getValue();
|
||||
if (event == ee) {
|
||||
if (tra.getSource().getId() == id && !trans.contains(tra)) {
|
||||
if (event.equals(ee)) {
|
||||
if (tra.getSource().getId().equals(id) && !trans.contains(tra)) {
|
||||
trans.add(tra);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user