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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/builder/CompilerListener.java

Issue 9030024: Suppress compiler warnings in dart:// code - the user is unable to take any action wrt these erro... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 12 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 | « editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/builder/CompilerListener.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/builder/CompilerListener.java (revision 3005)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/builder/CompilerListener.java (working copy)
@@ -25,6 +25,7 @@
import com.google.dart.indexer.standard.StandardDriver;
import com.google.dart.indexer.workspace.index.IndexingTarget;
import com.google.dart.tools.core.DartCore;
+import com.google.dart.tools.core.DartCoreDebug;
import com.google.dart.tools.core.internal.indexer.task.CompilationUnitIndexingTarget;
import com.google.dart.tools.core.internal.util.ResourceUtil;
import com.google.dart.tools.core.model.CompilationUnit;
@@ -133,7 +134,17 @@
Source source = error.getSource();
IResource res = ResourceUtil.getResource(source);
if (res == null) {
- if (missingSourceCount <= MISSING_SOURCE_REPORT_LIMIT) {
+ if (source != null && source.getUri().toString().startsWith("dart://")) {
+ // We can't find the source associated with this error. However, this is in system
+ // code that the user has no control over. Don't complain to the user about these
+ // errors.
+
+ if (DartCoreDebug.VERBOSE) {
+ DartCore.logInformation(error.toString());
+ }
+
+ return null;
+ } else if (missingSourceCount <= MISSING_SOURCE_REPORT_LIMIT) {
// Don't flood the log
missingSourceCount++;
StringBuilder builder = new StringBuilder();
@@ -151,15 +162,15 @@
builder.append("): ");
}
builder.append(error.getMessage());
- RuntimeException exception = new RuntimeException(builder.toString());
- DartCore.logInformation(exception.getMessage(), exception);
- // TODO (danrubel): generalize the logging mechanism for all plugins
+ DartCore.logInformation(builder.toString());
}
+
try {
res = library.getDefiningCompilationUnit().getCorrespondingResource();
} catch (DartModelException exception) {
// Fall through to use the project as a resource
}
+
if (res == null) {
res = project;
}
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698