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

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

Issue 1131423002: Clean up many generated constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment change 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
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 3d0814a82f05030e4acbb1971ccd5bbc83e701c4..13dd77cb48b008c0c802bcc45e5234f65ba10933 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -89,13 +89,30 @@ class AnalysisError {
bool isStaticOnly = false;
/**
+ * 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.
+ */
+ AnalysisError(this.source, this.offset, int length, this.errorCode,
+ [List<Object> arguments]) {
+ this._length = length;
+ this._message = formatList(errorCode.message, arguments);
+ String correctionTemplate = errorCode.correction;
+ if (correctionTemplate != null) {
+ this._correction = formatList(correctionTemplate, arguments);
+ }
+ }
+
+ /**
* Initialize a newly created analysis error for the specified [source]. The
* error will have the given [errorCode] and the list of [arguments] will be
* used to complete the message. The error has no location information.
*/
- AnalysisError.con1(this.source, this.errorCode, [List<Object> arguments]) {
- this._message = formatList(errorCode.message, arguments);
- }
+ @deprecated // Use new AnalysisError(source, 0, 0, errorCode, arguments)
+ AnalysisError.con1(Source source, ErrorCode errorCode,
+ [List<Object> arguments])
+ : this(source, 0, 0, errorCode, arguments);
/**
* Initialize a newly created analysis error for the specified [source] at the
@@ -103,15 +120,10 @@ class AnalysisError {
* [errorCode] and the list of [arguments] will be used to complete the
* message.
*/
- AnalysisError.con2(this.source, this.offset, int length, this.errorCode,
- [List<Object> arguments]) {
- this._length = length;
- this._message = formatList(errorCode.message, arguments);
- String correctionTemplate = errorCode.correction;
- if (correctionTemplate != null) {
- this._correction = formatList(correctionTemplate, arguments);
- }
- }
+ @deprecated // Use new AnalysisError(source, offset, length, errorCode, arguments)
+ AnalysisError.con2(Source source, int offset, int length, ErrorCode errorCode,
+ [List<Object> arguments])
+ : this(source, offset, length, errorCode, arguments);
/**
* Return the template used to create the correction to be displayed for this
@@ -244,13 +256,25 @@ class AnalysisErrorWithProperties extends AnalysisError {
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);
+
+ /**
* Initialize a newly created analysis error for the specified [source]. The
* error will have the given [errorCode] and the list of [arguments] will be
* used to complete the message. The error has no location information.
*/
+ @deprecated // Use new AnalysisErrorWithProperties(source, 0, 0, errorCode, arguments)
AnalysisErrorWithProperties.con1(Source source, ErrorCode errorCode,
[List<Object> arguments])
- : super.con1(source, errorCode, arguments);
+ : this(source, 0, 0, errorCode, arguments);
/**
* Initialize a newly created analysis error for the specified [source] at the
@@ -258,10 +282,11 @@ class AnalysisErrorWithProperties extends AnalysisError {
* [errorCode] and the list of [arguments] will be used to complete the
* message.
*/
+ @deprecated // Use new AnalysisErrorWithProperties(source, offset, length, errorCode, arguments)
AnalysisErrorWithProperties.con2(
Source source, int offset, int length, ErrorCode errorCode,
[List<Object> arguments])
- : super.con2(source, offset, length, errorCode, arguments);
+ : this(source, offset, length, errorCode, arguments);
@override
Object getProperty(ErrorProperty property) => _propertyMap[property];
@@ -2471,7 +2496,7 @@ class ErrorReporter {
*/
AnalysisErrorWithProperties newErrorWithProperties(
ErrorCode errorCode, AstNode node, List<Object> arguments) =>
- new AnalysisErrorWithProperties.con2(
+ new AnalysisErrorWithProperties(
_source, node.offset, node.length, errorCode, arguments);
/**
@@ -2519,7 +2544,7 @@ class ErrorReporter {
void reportErrorForOffset(ErrorCode errorCode, int offset, int length,
[List<Object> arguments]) {
_errorListener.onError(
- new AnalysisError.con2(_source, offset, length, errorCode, arguments));
+ new AnalysisError(_source, offset, length, errorCode, arguments));
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698