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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/indexer/contributor/DartContributor.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: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/indexer/contributor/DartContributor.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/indexer/contributor/DartContributor.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/indexer/contributor/DartContributor.java
index 62eabd764c01869754b5cc8e025580b35a17a928..0710a00d32dcb82648ad0bd13b2da2a8838eb367 100644
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/indexer/contributor/DartContributor.java
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/indexer/contributor/DartContributor.java
@@ -13,12 +13,12 @@
*/
package com.google.dart.tools.core.internal.indexer.contributor;
+import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartField;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNode;
-import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.resolver.ClassElement;
import com.google.dart.compiler.resolver.Element;
import com.google.dart.compiler.resolver.FieldElement;
@@ -154,10 +154,7 @@ public class DartContributor extends ASTVisitor<Void> implements Contributor {
}
}
if (range == null && element != null) {
- DartNode typeNode = element.getNode();
- if (typeNode != null) {
- range = new SourceRangeImpl(typeNode);
- }
+ range = new SourceRangeImpl(element);
}
if (range == null && sourceReference != null) {
try {
@@ -184,10 +181,7 @@ public class DartContributor extends ASTVisitor<Void> implements Contributor {
if (range == null && type != null) {
ClassElement classElement = type.getElement();
if (classElement != null) {
- DartNode typeNode = classElement.getNode();
- if (typeNode != null) {
- range = new SourceRangeImpl(typeNode);
- }
+ range = new SourceRangeImpl(classElement);
}
}
if (range == null && element != null) {

Powered by Google App Engine
This is Rietveld 408576698