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

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

Issue 1265453005: Code clean-up, mostly constructors (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/html.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c667af7933dd43a1a5071670d9add0456b5e99ee..0964a8c5f622e373d001753161043b2ca71f476a 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -40,9 +40,9 @@ class AnalysisError {
ErrorCode errorCode2 = o2.errorCode;
ErrorSeverity errorSeverity1 = errorCode1.errorSeverity;
ErrorSeverity errorSeverity2 = errorCode2.errorSeverity;
- ErrorType errorType1 = errorCode1.type;
- ErrorType errorType2 = errorCode2.type;
if (errorSeverity1 == errorSeverity2) {
+ ErrorType errorType1 = errorCode1.type;
+ ErrorType errorType2 = errorCode2.type;
return errorType1.compareTo(errorType2);
} else {
return errorSeverity2.compareTo(errorSeverity1);
@@ -80,7 +80,7 @@ class AnalysisError {
* The number of characters from the offset to the end of the source which
* encompasses the compilation error.
*/
- int _length = 0;
+ int length = 0;
/**
* A flag indicating whether this error can be shown to be a non-issue because
@@ -94,9 +94,8 @@ class AnalysisError {
* [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,
+ AnalysisError(this.source, this.offset, this.length, this.errorCode,
[List<Object> arguments]) {
- this._length = length;
this._message = formatList(errorCode.message, arguments);
String correctionTemplate = errorCode.correction;
if (correctionTemplate != null) {
@@ -141,13 +140,6 @@ class AnalysisError {
}
/**
- * Return the length of the error location, that is, the number of characters
- * from the offset to the end of the source which encompasses the compilation
- * error.
- */
- int get length => _length;
-
- /**
* Return the message to be displayed for this error. The message should
* indicate what is wrong and why it is wrong.
*/
@@ -167,7 +159,7 @@ class AnalysisError {
if (!identical(errorCode, other.errorCode)) {
return false;
}
- if (offset != other.offset || _length != other._length) {
+ if (offset != other.offset || length != other.length) {
return false;
}
if (isStaticOnly != other.isStaticOnly) {
@@ -197,7 +189,7 @@ class AnalysisError {
buffer.write("(");
buffer.write(offset);
buffer.write("..");
- buffer.write(offset + _length - 1);
+ buffer.write(offset + length - 1);
buffer.write("): ");
//buffer.write("(" + lineNumber + ":" + columnNumber + "): ");
buffer.write(_message);
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698