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

Unified Diff: pkg/analyzer/lib/error/error.dart

Issue 2706123002: Remove AnalysisErrorWithProperties and ErrorProperty. (Closed)
Patch Set: Created 3 years, 10 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/analyzer/lib/error/listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/error/error.dart
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 28f9429eb9ca1678ed8ec59aa3a14c4cb892243d..0e9ad7b77e061e87743605922d1a1b27323fcd02 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -806,12 +806,6 @@ class AnalysisError {
return false;
}
- /**
- * Return the value of the given [property], or `null` if the given property
- * is not defined for this error.
- */
- Object/*=V*/ getProperty/*<V>*/(ErrorProperty/*<V>*/ property) => null;
-
@override
String toString() {
StringBuffer buffer = new StringBuffer();
@@ -838,75 +832,3 @@ class AnalysisError {
return errors.toList();
}
}
-
-/**
- * An [AnalysisError] that can have arbitrary properties associated with it.
- */
-class AnalysisErrorWithProperties extends AnalysisError {
- /**
- * The properties associated with this error.
- */
- HashMap<ErrorProperty, Object> _propertyMap =
- new HashMap<ErrorProperty, Object>();
-
- /**
- * Initialize a newly created analysis error. The error is associated with the
- * given [source] and is located at the given [offset] with the given
- * [length]. The error will have the given [errorCode] and the list of
- * [arguments] will be used to complete the message.
- */
- AnalysisErrorWithProperties(
- Source source, int offset, int length, ErrorCode errorCode,
- [List<Object> arguments])
- : super(source, offset, length, errorCode, arguments);
-
- @override
- Object/*=V*/ getProperty/*<V>*/(ErrorProperty/*<V>*/ property) =>
- _propertyMap[property] as Object/*=V*/;
-
- /**
- * Set the value of the given [property] to the given [value]. Using a value
- * of `null` will effectively remove the property from this error.
- */
- void setProperty/*<V>*/(ErrorProperty/*<V>*/ property, Object/*=V*/ value) {
- _propertyMap[property] = value;
- }
-}
-
-/**
- * The properties that can be associated with an [AnalysisError].
- */
-class ErrorProperty<V> implements Comparable<ErrorProperty> {
- /**
- * A property whose value is the name of the library that is used by all
- * of the "part of" directives, so should be used in the "library" directive.
- * Is `null` if there is no a single name used by all of the parts.
- */
- static const ErrorProperty<String> PARTS_LIBRARY_NAME =
- const ErrorProperty<String>('PARTS_LIBRARY_NAME', 1);
-
- static const List<ErrorProperty> values = const [
- PARTS_LIBRARY_NAME,
- ];
-
- /**
- * The name of this property.
- */
- final String name;
-
- /**
- * The ordinal value of the property.
- */
- final int ordinal;
-
- const ErrorProperty(this.name, this.ordinal);
-
- @override
- int get hashCode => ordinal;
-
- @override
- int compareTo(ErrorProperty other) => ordinal - other.ordinal;
-
- @override
- String toString() => name;
-}
« no previous file with comments | « no previous file | pkg/analyzer/lib/error/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698