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
public final void clearDFA() {
decisionToDFA = new DFA[decisionToState.size()];
for (int i = 0; i < decisionToDFA.length; i++) {
decisionToDFA[i] = new DFA(decisionToState.get(i), i);
}
the clearDFA function of ATN.java first reinitializes the DFA array and then assigns the value to array elements, due to this when parallel parsers are in use, calling clearDFA from one parser results in getting nullpointer exception in multithreaded scenarios
java.lang.NullPointerException: null
at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:367) ~[antlr4-runtime-4.9.0.jar:4.9.0]
at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:357) ~[antlr4-runtime-4.9.0.jar:4.9.0]
From the ANTLR main release branch i can see the clearDFA logic is written without the reinitilization of DFA array.. so whether this is a bug in the optimized fork ?
public final void clearDFA() {
for (int i = 0; i < decisionToDFA.length; i++) {
decisionToDFA[i] = new DFA(decisionToState.get(i), i);
}
The text was updated successfully, but these errors were encountered:
@sharwell ,
i thought of customizing the clearDFA, but its defined as final method, any alternative way i can handle this issue without waiting for next release?
the clearDFA function of ATN.java first reinitializes the DFA array and then assigns the value to array elements, due to this when parallel parsers are in use, calling clearDFA from one parser results in getting nullpointer exception in multithreaded scenarios
From the ANTLR main release branch i can see the clearDFA logic is written without the reinitilization of DFA array.. so whether this is a bug in the optimized fork ?
The text was updated successfully, but these errors were encountered: