--- a/langtools/src/jdk.dev/share/classes/com/sun/tools/jdeps/Archive.java Tue Jan 27 15:11:57 2015 -0800
+++ b/langtools/src/jdk.dev/share/classes/com/sun/tools/jdeps/Archive.java Tue Jan 27 19:50:41 2015 -0800
@@ -75,20 +75,11 @@
}
public void addClass(Location origin) {
- Set<Location> set = deps.get(origin);
- if (set == null) {
- set = new HashSet<>();
- deps.put(origin, set);
- }
+ deps.computeIfAbsent(origin, _k -> new HashSet<>());
}
public void addClass(Location origin, Location target) {
- Set<Location> set = deps.get(origin);
- if (set == null) {
- set = new HashSet<>();
- deps.put(origin, set);
- }
- set.add(target);
+ deps.computeIfAbsent(origin, _k -> new HashSet<>()).add(target);
}
public Set<Location> getClasses() {
@@ -115,6 +106,10 @@
return filename;
}
+ public Path path() {
+ return path;
+ }
+
interface Visitor {
void visit(Location origin, Location target);
}