--- a/langtools/src/share/classes/com/sun/tools/jdeps/Archive.java Thu Oct 17 13:50:00 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/Archive.java Thu Oct 17 13:19:48 2013 -0700
@@ -25,7 +25,7 @@
package com.sun.tools.jdeps;
import com.sun.tools.classfile.Dependency.Location;
-import java.io.File;
+import java.nio.file.Path;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -35,21 +35,20 @@
* Represents the source of the class files.
*/
public class Archive {
- private final File file;
+ private final Path path;
private final String filename;
private final ClassFileReader reader;
- private final Map<Location, Set<Location>> deps
- = new HashMap<Location, Set<Location>>();
+ private final Map<Location, Set<Location>> deps = new HashMap<>();
public Archive(String name) {
- this.file = null;
+ this.path = null;
this.filename = name;
this.reader = null;
}
- public Archive(File f, ClassFileReader reader) {
- this.file = f;
- this.filename = f.getName();
+ public Archive(Path p, ClassFileReader reader) {
+ this.path = p;
+ this.filename = path.getFileName().toString();
this.reader = reader;
}
@@ -64,14 +63,14 @@
public void addClass(Location origin) {
Set<Location> set = deps.get(origin);
if (set == null) {
- set = new HashSet<Location>();
+ set = new HashSet<>();
deps.put(origin, set);
}
}
public void addClass(Location origin, Location target) {
Set<Location> set = deps.get(origin);
if (set == null) {
- set = new HashSet<Location>();
+ set = new HashSet<>();
deps.put(origin, set);
}
set.add(target);
@@ -87,7 +86,7 @@
}
public String toString() {
- return file != null ? file.getPath() : filename;
+ return path != null ? path.toString() : filename;
}
interface Visitor {