Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartTypeNode.java

Issue 9600049: Use NodeList where possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/ast/DartTypeNode.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartTypeNode.java b/compiler/java/com/google/dart/compiler/ast/DartTypeNode.java
index b6ccbd330b6cc834b656ea8998f86de423fef718..b181e6a8dee99a3617877519af212be845979300 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartTypeNode.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartTypeNode.java
@@ -4,9 +4,9 @@
package com.google.dart.compiler.ast;
+import com.google.common.collect.ImmutableList;
import com.google.dart.compiler.type.Type;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -15,16 +15,16 @@ import java.util.List;
public class DartTypeNode extends DartNode {
private DartNode identifier;
- private List<DartTypeNode> typeArguments = new ArrayList<DartTypeNode>();
+ private NodeList<DartTypeNode> typeArguments = NodeList.create(this);
private Type type;
public DartTypeNode(DartNode identifier) {
- this(identifier, new ArrayList<DartTypeNode>());
+ this(identifier, ImmutableList.<DartTypeNode>of());
Brian Wilkerson 2012/03/06 16:39:45 Given that NodeList.addAll handles an argument val
scheglov 2012/03/06 17:11:46 Done. Thank you for catching this.
}
public DartTypeNode(DartNode identifier, List<DartTypeNode> typeArguments) {
this.identifier = becomeParentOf(identifier);
- this.typeArguments = becomeParentOf(typeArguments);
+ this.typeArguments.addAll(typeArguments);
}
public DartNode getIdentifier() {
@@ -48,7 +48,7 @@ public class DartTypeNode extends DartNode {
@Override
public void visitChildren(ASTVisitor<?> visitor) {
identifier.accept(visitor);
- visitor.visit(typeArguments);
+ typeArguments.accept(visitor);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698