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(); |
} |