src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java
Print this page
rev 2819 : imported patch my-classpath-deps-00
@@ -28,16 +28,15 @@
import java.io.UncheckedIOException;
import java.lang.ref.SoftReference;
import java.net.URI;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
import java.nio.file.FileSystemNotFoundException;
+import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.ProviderNotFoundException;
-import java.nio.file.spi.FileSystemProvider;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
@@ -48,10 +47,11 @@
import javax.tools.FileObject;
import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
import com.sun.tools.javac.nio.PathFileObject;
import com.sun.tools.javac.util.Context;
+import com.sun.tools.sjavac.comp.JavaFileObjectWithLocation;
/**
* A package-oriented index into the jrt: filesystem.
*/
public class JRTIndex {
@@ -228,10 +228,13 @@
}
return e;
}
public boolean isInJRT(FileObject fo) {
+ if (fo instanceof JavaFileObjectWithLocation) {
+ fo = ((JavaFileObjectWithLocation<?>) fo).getDelegate();
+ }
if (fo instanceof PathFileObject) {
Path path = ((PathFileObject) fo).getPath();
return (path.getFileSystem() == jrtfs);
} else {
return false;