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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java

Issue 10692002: pass library files not directories to analysis server (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java (revision 9145)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Context.java (working copy)
@@ -102,6 +102,12 @@
* <code>null</code> if none
*/
public void parse(File libraryFile, File dartFile, ParseCallback callback) {
+ if (!libraryFile.isAbsolute()) {
+ throw new IllegalArgumentException("File path must be absolute: " + libraryFile);
+ }
+ if (libraryFile.isDirectory()) {
+ throw new IllegalArgumentException("Cannot parse a directory: " + libraryFile);
+ }
String relPath = libraryFile.toURI().relativize(dartFile.toURI()).getPath();
server.queueNewTask(new ParseFileTask(server, this, libraryFile, relPath, dartFile, callback));
}
@@ -137,6 +143,9 @@
if (!libraryFile.isAbsolute()) {
throw new IllegalArgumentException("File path must be absolute: " + libraryFile);
}
+ if (libraryFile.isDirectory()) {
+ throw new IllegalArgumentException("Cannot resolve a directory: " + libraryFile);
+ }
server.queueNewTask(new AnalyzeLibraryTask(server, this, libraryFile, callback));
}

Powered by Google App Engine
This is Rietveld 408576698