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

Unified Diff: compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java

Issue 10832372: Issue 4544. Report only unit URI, without URI of library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Print only unit URI when report error Created 8 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
diff --git a/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java b/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
index 21d6c21d0ace52c570fa4b58fe16c4fbb375d188..947c6f1734f5bb18a36a2ed204a62c27171db687 100644
--- a/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
+++ b/compiler/java/com/google/dart/compiler/PrettyErrorFormatter.java
@@ -91,7 +91,7 @@ public class PrettyErrorFormatter extends DefaultErrorFormatter {
escapePipe(event.getErrorCode().getErrorSeverity().toString()),
escapePipe(event.getErrorCode().getSubSystem().toString()),
escapePipe(event.getErrorCode().toString()),
- escapePipe(sourceFile.getName()),
+ escapePipe(getSourceName(sourceFile)),
event.getLineNumber(),
1 + col,
length,
@@ -153,6 +153,13 @@ public class PrettyErrorFormatter extends DefaultErrorFormatter {
}
}
}
+
+ private static String getSourceName(Source source) {
+ if (source instanceof UrlDartSource) {
+ return source.getUri().toString();
+ }
+ return source.getName();
+ }
private String escapePipe(String input) {
StringBuilder result = new StringBuilder();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698