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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java

Issue 9692002: Step back and remove more getNode() invocations (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/resolver/ClassElementImplementation.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java b/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
index 9615b84ff8024b844ae185c7b89c903b8ca27289..9b0891d8a3cee8c63d819122601d8125314c7d4b 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
@@ -6,8 +6,10 @@ package com.google.dart.compiler.resolver;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartDeclaration;
+import com.google.dart.compiler.ast.DartParameterizedTypeNode;
import com.google.dart.compiler.ast.DartStringLiteral;
import com.google.dart.compiler.ast.Modifiers;
+import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.type.InterfaceType;
import com.google.dart.compiler.type.Type;
@@ -30,6 +32,8 @@ class ClassElementImplementation extends AbstractElement implements ClassElement
private final Modifiers modifiers;
private final AtomicReference<List<InterfaceType>> allSupertypes =
new AtomicReference<List<InterfaceType>>();
+ private final SourceInfo nameLocation;
+ private final String declarationNameWithTypeParameter;
// declared volatile for thread-safety
@SuppressWarnings("unused")
@@ -58,9 +62,13 @@ class ClassElementImplementation extends AbstractElement implements ClassElement
if (node != null) {
isInterface = node.isInterface();
modifiers = node.getModifiers();
+ nameLocation = node.getName().getSourceInfo();
+ declarationNameWithTypeParameter = new DartParameterizedTypeNode(node.getName(), node.getTypeParameters()).toSource();
} else {
isInterface = false;
modifiers = Modifiers.NONE;
+ nameLocation = SourceInfo.UNKNOWN;
+ declarationNameWithTypeParameter = "";
}
}
@@ -68,6 +76,11 @@ class ClassElementImplementation extends AbstractElement implements ClassElement
public DartDeclaration<?> getNode() {
return (DartClass) super.getNode();
}
+
+ @Override
+ public SourceInfo getNameLocation() {
+ return nameLocation;
+ }
@Override
public void setType(InterfaceType type) {
@@ -158,6 +171,11 @@ class ClassElementImplementation extends AbstractElement implements ClassElement
public String getNativeName() {
return nativeName;
}
+
+ @Override
+ public String getDeclarationNameWithTypeParameters() {
+ return declarationNameWithTypeParameter;
+ }
void addMethod(MethodElement member) {
String name = member.getName();

Powered by Google App Engine
This is Rietveld 408576698