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

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

Issue 1413563004: Make IndexableObjectKind parameterized. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Clean up IndexableElementKind. Created 5 years, 2 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: pkg/analysis_server/lib/src/services/index/index.dart
diff --git a/pkg/analysis_server/lib/src/services/index/index.dart b/pkg/analysis_server/lib/src/services/index/index.dart
index 7ef15138bfae5017cce31650a415e0083e744394..5b2204cdffc6334c9ceb3992ac4f01ab16558b51 100644
--- a/pkg/analysis_server/lib/src/services/index/index.dart
+++ b/pkg/analysis_server/lib/src/services/index/index.dart
@@ -81,7 +81,7 @@ class IndexableName implements IndexableObject {
String get filePath => null;
@override
- IndexableObjectKind get kind => IndexableNameKind.INSTANCE;
+ IndexableNameKind get kind => IndexableNameKind.INSTANCE;
@override
int get offset {
@@ -99,7 +99,7 @@ class IndexableName implements IndexableObject {
/**
* The kind of an indexable name.
*/
-class IndexableNameKind implements IndexableObjectKind {
+class IndexableNameKind implements IndexableObjectKind<IndexableName> {
/**
* The unique instance of this class.
*/
@@ -119,14 +119,14 @@ class IndexableNameKind implements IndexableObjectKind {
}
@override
- IndexableObject decode(AnalysisContext context, String filePath, int offset) {
+ IndexableName decode(AnalysisContext context, String filePath, int offset) {
throw new UnsupportedError(
'Indexable names cannot be decoded through their kind');
}
@override
- int encodeHash(StringToInt stringToInt, IndexableObject indexable) {
- String name = (indexable as IndexableName).name;
+ int encodeHash(StringToInt stringToInt, IndexableName indexable) {
+ String name = indexable.name;
return stringToInt(name);
}
}

Powered by Google App Engine
This is Rietveld 408576698