forked from jasder/antlr
v4: Return List<String> instead of List
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9353]
This commit is contained in:
parent
b27441346b
commit
24b354e0a5
|
@ -278,11 +278,11 @@ public abstract class BaseRecognizer extends Recognizer<ParserATNSimulator> {
|
|||
/** A convenience method for use most often with template rewrites.
|
||||
* Convert a List<Token> to List<String>
|
||||
*/
|
||||
public List toStrings(List tokens) {
|
||||
public List<String> toStrings(List<? extends Token> tokens) {
|
||||
if ( tokens==null ) return null;
|
||||
List strings = new ArrayList(tokens.size());
|
||||
List<String> strings = new ArrayList<String>(tokens.size());
|
||||
for (int i=0; i<tokens.size(); i++) {
|
||||
strings.add(((Token)tokens.get(i)).getText());
|
||||
strings.add(tokens.get(i).getText());
|
||||
}
|
||||
return strings;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue