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

Unified Diff: editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart

Issue 16357010: Basic dart^2 analyzer tests running. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/util/plugins/com.google.dart.java2dart/resources/java_io.dart
diff --git a/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart b/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart
index d0459a0bef2b4d6a0b6ca09442f33f8a7d24716b..7799d49811be3cb841ae513cf90f2c472cc10ca5 100644
--- a/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart
+++ b/editor/util/plugins/com.google.dart.java2dart/resources/java_io.dart
@@ -72,8 +72,17 @@ class JavaFile {
}
String getPath() => _path.toNativePath();
String getName() => _path.filename;
- String getParent() => _path.directoryPath.toNativePath();
- JavaFile getParentFile() => new JavaFile(getParent());
+ String getParent() {
+ var result = _path.directoryPath.toNativePath();
+ // "." or "/" or "C:\"
+ if (result.length < 4) return null;
+ return result;
+ }
+ JavaFile getParentFile() {
+ var parent = getParent();
+ if (parent == null) return null;
+ return new JavaFile(parent);
+ }
String getAbsolutePath() => _path.canonicalize().toNativePath();
String getCanonicalPath() => _path.canonicalize().toNativePath();
JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath());
« no previous file with comments | « no previous file | pkg/analyzer_experimental/bin/analyzer.dart » ('j') | pkg/analyzer_experimental/lib/src/error_formatter.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698