v4: Specify @Nullable

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9342]
This commit is contained in:
sharwell 2011-11-17 16:59:19 -08:00
parent 3526198105
commit 36a9af8b29
3 changed files with 7 additions and 3 deletions

View File

@ -29,6 +29,7 @@
package org.antlr.v4.runtime.atn;
import com.sun.istack.internal.Nullable;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.dfa.DFAState;
@ -104,7 +105,7 @@ public class LexerATNSimulator extends ATNSimulator {
this(null, atn);
}
public LexerATNSimulator(Lexer recog, ATN atn) {
public LexerATNSimulator(@Nullable Lexer recog, ATN atn) {
super(atn);
dfa = new DFA[atn.modeToStartState.size()];
for (int i=0; i<atn.modeToStartState.size(); i++) {

View File

@ -28,6 +28,7 @@
*/
package org.antlr.v4.runtime.dfa;
import com.sun.istack.internal.Nullable;
import org.antlr.v4.runtime.atn.ATNState;
import java.util.*;
@ -52,7 +53,7 @@ public class DFA {
public String toString() { return toString(null); }
public String toString(String[] tokenNames) {
public String toString(@Nullable String[] tokenNames) {
if ( s0==null ) return "";
DFASerializer serializer = new DFASerializer(this,tokenNames);
return serializer.toString();

View File

@ -29,12 +29,14 @@
package org.antlr.v4.runtime.dfa;
import com.sun.istack.internal.Nullable;
/** A DFA walker that knows how to dump them to serialized strings. */
public class DFASerializer {
String[] tokenNames;
DFA dfa;
public DFASerializer(DFA dfa, String[] tokenNames) {
public DFASerializer(DFA dfa, @Nullable String[] tokenNames) {
this.dfa = dfa;
this.tokenNames = tokenNames;
}