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

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

Issue 8322016: Always use / with URI (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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 | compiler/java/com/google/dart/compiler/UrlDartSource.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/SystemLibrary.java
diff --git a/compiler/java/com/google/dart/compiler/SystemLibrary.java b/compiler/java/com/google/dart/compiler/SystemLibrary.java
index 2f05761afff4b9a09da31daba713762e64d386ac..ad37ceaca95b3429391784cacb0197c851858d9a 100644
--- a/compiler/java/com/google/dart/compiler/SystemLibrary.java
+++ b/compiler/java/com/google/dart/compiler/SystemLibrary.java
@@ -53,12 +53,13 @@ public class SystemLibrary {
if (!dirOrZip.exists()) {
throw new RuntimeException("System library for " + dartUri + " does not exist: " + dirOrZip.getPath());
}
- String spec = "file:" + dirOrZip.getPath();
- if (dirOrZip.isFile()) {
- spec = "jar:" + spec + "!";
- }
try {
- return new URI(spec + dartUri.getPath());
+ URI dirOrZipURI = dirOrZip.toURI();
+ if (dirOrZip.isFile()) {
+ return new URI("jar", "file:" + dirOrZipURI.getPath() + "!" + dartUri.getPath(), null);
+ } else {
+ return dirOrZipURI.resolve("." + dartUri.getPath());
+ }
} catch (URISyntaxException e) {
throw new AssertionError();
}
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/UrlDartSource.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698