Open angellopez417 opened 1 year ago
When you use Enum states and want to persist the state machine, using persister.restore is not able to reset the state machine with the storage context.
This logic fails, the Enum does not match:
if (state instanceof Enum && ss.getId() instanceof Enum && state.getClass() == ss.getId().getClass() && ((Enum)ss.getId()).ordinal() == ((Enum)state).ordinal()) { enumMatch = true; }
This is due to this comparison: state.getClass() == ss.getId().getClass() always is false
When you use Enum states and want to persist the state machine, using persister.restore is not able to reset the state machine with the storage context.
This logic fails, the Enum does not match:
if (state instanceof Enum && ss.getId() instanceof Enum && state.getClass() == ss.getId().getClass() && ((Enum)ss.getId()).ordinal() == ((Enum)state).ordinal()) { enumMatch = true; }
This is due to this comparison: state.getClass() == ss.getId().getClass() always is false