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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java

Issue 11648026: Issue 7532. Fix for NPE in SemanticHighlightings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/LibraryElementImplementation.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
index e62cd0bc17fed3204caf808e476b3f5b51e2cbac..35791702e33032bfebb7498e22c9cf458c0c2668 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
@@ -331,7 +331,8 @@ public class SemanticHighlightings {
DartNode node = token.getNode();
if (node instanceof DartStringLiteral && node.getParent() instanceof DartImportDirective) {
Element element = node.getElement();
- return element != null && element.getMetadata().isDeprecated();
+ return element != null && element.getMetadata() != null
+ && element.getMetadata().isDeprecated();
}
return false;
}
@@ -340,7 +341,8 @@ public class SemanticHighlightings {
public boolean consumesIdentifier(SemanticToken token) {
DartIdentifier node = token.getNodeIdentifier();
Element element = node.getElement();
- return element != null && element.getMetadata().isDeprecated();
+ return element != null && element.getMetadata() != null
+ && element.getMetadata().isDeprecated();
}
@Override
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/LibraryElementImplementation.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698