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

Unified Diff: pkg/analysis_server/lib/src/services/index/index_contributor.dart

Issue 1162853004: Issue 23568. Fix for NPE in index when unresolved field formal parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/index/indexable_element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/index/index_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/index/index_contributor.dart b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
index 76dda831eefdab61b15c0730b01bad7ecf3a1fcd..d552fb236582853530208fe4155381182a88c4ee 100644
--- a/pkg/analysis_server/lib/src/services/index/index_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
@@ -442,16 +442,15 @@ class _IndexContributor extends GeneralizingAstVisitor {
@override
visitSimpleIdentifier(SimpleIdentifier node) {
- IndexableObject indexable =
- new IndexableElement(new NameElement(node.name));
+ Element nameElement = new NameElement(node.name);
Brian Wilkerson 2015/06/01 21:52:20 I understand why lines 484-485 need to change, but
scheglov 2015/06/01 22:07:24 We use "nameElement" only once, in different branc
LocationImpl location = _createLocationForNode(node);
if (location == null) {
return;
}
// name in declaration
if (node.inDeclarationContext()) {
- _store.recordRelationship(
- indexable, IndexConstants.NAME_IS_DEFINED_BY, location);
+ recordRelationship(
+ nameElement, IndexConstants.NAME_IS_DEFINED_BY, location);
return;
}
// prepare information
@@ -466,14 +465,12 @@ class _IndexContributor extends GeneralizingAstVisitor {
bool inGetterContext = node.inGetterContext();
bool inSetterContext = node.inSetterContext();
if (inGetterContext && inSetterContext) {
- _store.recordRelationship(
- indexable, IndexConstants.IS_READ_WRITTEN_BY, location);
+ recordRelationship(
+ nameElement, IndexConstants.IS_READ_WRITTEN_BY, location);
} else if (inGetterContext) {
- _store.recordRelationship(
- indexable, IndexConstants.IS_READ_BY, location);
+ recordRelationship(nameElement, IndexConstants.IS_READ_BY, location);
} else if (inSetterContext) {
- _store.recordRelationship(
- indexable, IndexConstants.IS_WRITTEN_BY, location);
+ recordRelationship(nameElement, IndexConstants.IS_WRITTEN_BY, location);
}
}
// this.field parameter
@@ -481,8 +478,7 @@ class _IndexContributor extends GeneralizingAstVisitor {
RelationshipImpl relationship = peekElement().element == element
? IndexConstants.IS_WRITTEN_BY
: IndexConstants.IS_REFERENCED_BY;
- _store.recordRelationship(
- new IndexableElement(element.field), relationship, location);
+ recordRelationship(element.field, relationship, location);
return;
}
// record specific relations
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/index/indexable_element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698