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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java

Issue 8771050: Probable fix for http://code.google.com/p/dart/issues/detail?id=698 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years 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: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java (revision 2143)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java (working copy)
@@ -32,7 +32,11 @@
public static IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
/**
- * Answer the file for the specified Dart source or <code>null</code> if none
+ * Return the file corresponding to the specified Dart source, or <code>null</code> if there is no
+ * such file.
+ *
+ * @param source the source corresponding to the file to be returned
+ * @return the file corresponding to the specified Dart source
*/
public static File getFile(Source source) {
if (source == null) {
@@ -46,10 +50,13 @@
return new File(uri);
}
String relativePath = uri.getPath();
+ if (relativePath == null) {
+ DartCore.logError("Illegal file URI: " + uri, new Exception());
+ return null;
+ }
return new File(new File(".").getAbsoluteFile(), relativePath);
} catch (IllegalArgumentException ex) {
DartCore.logError("Illegal file URI: " + uri, ex);
-
return null;
}
}
« 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