You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes (rarely) I encounter the following exception:
java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909) ~[na:1.8.0_161]
at java.util.ArrayList$Itr.next(ArrayList.java:859) ~[na:1.8.0_161]
at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042) ~[na:1.8.0_161]
at org.squirrelframework.foundation.fsm.impl.StateImpl.entry(StateImpl.java:128) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.TimedStateImpl.entry(TimedStateImpl.java:17) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.StateImpl.enterShallow(StateImpl.java:271) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.TimedStateImpl.enterShallow(TimedStateImpl.java:17) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.StateImpl.enterHistoryNone(StateImpl.java:295) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.StateImpl.enterByHistory(StateImpl.java:248) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.TransitionImpl.internalFire(TransitionImpl.java:203) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.StateImpl.internalFire(StateImpl.java:419) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.TimedStateImpl.internalFire(TimedStateImpl.java:17) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.AbstractStateMachine.processEvent(AbstractStateMachine.java:161) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.AbstractStateMachine.processEvents(AbstractStateMachine.java:215) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.AbstractStateMachine.internalFire(AbstractStateMachine.java:248) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.AbstractStateMachine.fire(AbstractStateMachine.java:268) ~[squirrel-foundation-0.3.8.jar:na]
at org.squirrelframework.foundation.fsm.impl.AbstractStateMachine.fire(AbstractStateMachine.java:279) ~[squirrel-foundation-0.3.8.jar:na]
Since I am unable to find code paths of action list modifications during FSM execution, I guess this is a memory visibility issue. The quick fix I use:
static {
// must be called before org.squirrelframework.foundation.fsm.impl.FSM.newActions()SquirrelProvider.getInstance().register(Actions.class, ThreadSafeActionsImpl.class);
}
publicstaticclassThreadSafeActionsImpl<TextendsStateMachine<T, S, E, C>, S, E, C>
implementsActions<T, S, E, C> {
privatestaticfinalComparator<Action<?, ?, ?, ?>> ACTION_COMPARATOR =
(o1, o2) -> o2.weight() - o1.weight();
privatefinalSortedSet<Action<T, S, E, C>> actions =
Collections.synchronizedSortedSet(newTreeSet<>(ACTION_COMPARATOR));
@Overridepublicvoidadd(Action<T, S, E, C> newAction) {
actions.add(newAction);
}
@OverridepublicvoidaddAll(List<? extendsAction<T, S, E, C>> newActions) {
actions.addAll(newActions);
}
@OverridepublicList<Action<T, S, E, C>> getAll() {
returnCollections.unmodifiableList(newArrayList<>(actions));
}
@Overridepublicvoidclear() {
thrownewUnsupportedOperationException("not implemented");
}
}
The text was updated successfully, but these errors were encountered:
Sometimes (rarely) I encounter the following exception:
Since I am unable to find code paths of action list modifications during FSM execution, I guess this is a memory visibility issue. The quick fix I use:
The text was updated successfully, but these errors were encountered: