Skip to content

Commit

Permalink
Remove inadvertent use of new Java 7 API
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Apr 7, 2014
1 parent 2ef1828 commit f7d6fa4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,11 @@ protected int execATN(@NotNull DFA dfa,
protected int handleNoViableAlt(@NotNull TokenStream input, int startIndex, @NotNull SimulatorState previous) {
if (previous.s0 != null) {
BitSet alts = new BitSet();
int maxAlt = 0;
for (ATNConfig config : previous.s0.configs) {
if (config.getReachesIntoOuterContext() || config.getState() instanceof RuleStopState) {
alts.set(config.getAlt());
maxAlt = Math.max(maxAlt, config.getAlt());
}
}

Expand Down Expand Up @@ -941,7 +943,7 @@ protected int handleNoViableAlt(@NotNull TokenStream input, int startIndex, @Not
* filteredConfigs, rather than restricting the evaluation to
* conflicting and/or unique configurations.
*/
SemanticContext[] altToPred = getPredsForAmbigAlts(alts, filteredConfigs, alts.previousSetBit(100));
SemanticContext[] altToPred = getPredsForAmbigAlts(alts, filteredConfigs, maxAlt);
if (altToPred != null) {
DFAState.PredPrediction[] predicates = getPredicatePredictions(alts, altToPred);
if (predicates != null) {
Expand Down

0 comments on commit f7d6fa4

Please sign in to comment.