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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/error/ErrorReporter.java

Issue 62683005: Issue 14426. Analyzer must warn when a getter & setter pair are not both static or both instance. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/error/ErrorReporter.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/error/ErrorReporter.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/error/ErrorReporter.java
index 051cdbbfa35b6d935303daba22d61011ec63f905..2ed0de6402b73ff3cc8f9b23f75c6d7c21f3fda9 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/error/ErrorReporter.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/error/ErrorReporter.java
@@ -14,6 +14,7 @@
package com.google.dart.engine.internal.error;
import com.google.dart.engine.ast.ASTNode;
+import com.google.dart.engine.element.Element;
import com.google.dart.engine.error.AnalysisError;
import com.google.dart.engine.error.AnalysisErrorListener;
import com.google.dart.engine.error.AnalysisErrorWithProperties;
@@ -101,6 +102,17 @@ public class ErrorReporter {
* Report an error with the given error code and arguments.
*
* @param errorCode the error code of the error to be reported
+ * @param element the element which name should be used as the location of the error
+ * @param arguments the arguments to the error, used to compose the error message
+ */
+ public void reportError(ErrorCode errorCode, Element element, Object... arguments) {
+ reportError(errorCode, element.getNameOffset(), element.getDisplayName().length(), arguments);
+ }
+
+ /**
+ * Report an error with the given error code and arguments.
+ *
+ * @param errorCode the error code of the error to be reported
* @param offset the offset of the location of the error
* @param length the length of the location of the error
* @param arguments the arguments to the error, used to compose the error message
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698