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

Unified Diff: pkg/analyzer/lib/src/task/model.dart

Issue 867563004: Improvements to task model (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/analyzer/lib/src/task/model.dart
diff --git a/pkg/analyzer/lib/src/task/model.dart b/pkg/analyzer/lib/src/task/model.dart
index 03e165f569d554e69f5999b6131fbacb6be13d88..5f43ebcada5438df5ddd4316a9c8bb634b947c72 100644
--- a/pkg/analyzer/lib/src/task/model.dart
+++ b/pkg/analyzer/lib/src/task/model.dart
@@ -19,9 +19,11 @@ class ContributionPointImpl<V> extends ResultDescriptorImpl<V> implements
final List<ResultDescriptor<V>> contributors = <ResultDescriptor<V>>[];
/**
- * Initialize a newly created contribution point to have the given [name].
+ * Initialize a newly created contribution point to have the given [name] and
+ * [defaultValue].
*/
- ContributionPointImpl(String name) : super(name);
+ ContributionPointImpl(String name, V defaultValue)
Paul Berry 2015/01/26 17:31:06 Since the "value" associated with a contribution p
Brian Wilkerson 2015/01/26 19:47:53 I think it doesn't. I'll make the change.
+ : super(name, defaultValue);
/**
* Record that the given analysis [result] contibutes to this result.
@@ -41,10 +43,17 @@ class ResultDescriptorImpl<V> implements ResultDescriptor<V> {
final String name;
/**
- * Initialize a newly created analysis result to have the given [name]. If a
- * contribution point is specified, then this result will contribute to it.
+ * Return the default value for results described by this descriptor.
*/
- ResultDescriptorImpl(this.name, {ContributionPoint contributesTo}) {
+ final V defaultValue;
Paul Berry 2015/01/26 17:31:06 This design forces all results to share the same d
Brian Wilkerson 2015/01/26 19:47:53 Good point! It isn't a problem at the moment becau
+
+ /**
+ * Initialize a newly created analysis result to have the given [name] and
+ * [defaultValue]. If a contribution point is specified, then this result will
+ * contribute to it.
+ */
+ ResultDescriptorImpl(this.name, this.defaultValue,
+ {ContributionPoint contributesTo}) {
if (contributesTo is ContributionPointImpl) {
contributesTo.recordContributor(this);
}

Powered by Google App Engine
This is Rietveld 408576698