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

Unified Diff: editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java

Issue 14322008: Version 0.4.7.3 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 8 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.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java (revision 21601)
+++ editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/internal/correction/QuickAssistProcessorImpl.java (working copy)
@@ -41,6 +41,7 @@
import com.google.dart.engine.ast.VariableDeclarationList;
import com.google.dart.engine.ast.VariableDeclarationStatement;
import com.google.dart.engine.ast.visitor.NodeLocator;
+import com.google.dart.engine.element.Element;
import com.google.dart.engine.formatter.edit.Edit;
import com.google.dart.engine.internal.type.BottomTypeImpl;
import com.google.dart.engine.internal.type.DynamicTypeImpl;
@@ -371,7 +372,11 @@
return;
}
// prepare "declaration" statement
- int declOffset = ((SimpleIdentifier) node).getElement().getNameOffset();
+ Element element = ((SimpleIdentifier) node).getElement();
+ if (element == null) {
+ return;
+ }
+ int declOffset = element.getNameOffset();
ASTNode declNode = new NodeLocator(declOffset).searchWithin(unit);
if (declNode != null && declNode.getParent() instanceof VariableDeclaration
&& ((VariableDeclaration) declNode.getParent()).getName() == declNode

Powered by Google App Engine
This is Rietveld 408576698