v4: Return List<String> instead of List

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9353]
This commit is contained in:
sharwell 2011-11-17 18:22:59 -08:00
parent b27441346b
commit 24b354e0a5
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}