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

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

Issue 10951031: fix PackageLibraryManager to resolve self links to right file (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/PackageLibraryManager.java
===================================================================
--- compiler/java/com/google/dart/compiler/PackageLibraryManager.java (revision 12565)
+++ compiler/java/com/google/dart/compiler/PackageLibraryManager.java (working copy)
@@ -5,6 +5,7 @@
package com.google.dart.compiler;
import java.io.File;
+import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
@@ -46,8 +47,8 @@
public static final String DART_SCHEME = "dart";
public static final String DART_SCHEME_SPEC = "dart:";
+
-
/**
* Answer <code>true</code> if the string is a dart spec
*/
@@ -171,8 +172,13 @@
}
for (URI rootUri : packageRootsUri){
URI fileUri = rootUri.resolve(relPath);
- if (new File(fileUri).exists()){
- return fileUri;
+ File file = new File(fileUri);
+ if (file.exists()){
+ try {
+ return file.getCanonicalFile().toURI();
+ } catch (IOException e) {
+ file.toURI();
+ }
}
}
// don't return null for package scheme
@@ -254,7 +260,11 @@
fileUri = getResolvedPackageUri(uri, rootUri);
File file = new File(fileUri);
if (file.exists()){
- return file.toURI();
+ try {
+ return file.getCanonicalFile().toURI();
+ } catch (IOException e) {
+ return file.toURI();
+ }
}
}
// resolve against first package root
@@ -263,6 +273,7 @@
}
return uri;
}
+
/**
* Given a uri, resolve against the list of package roots, used to find generated files
« 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