--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Archive.java Thu Nov 22 10:25:44 2018 +0530
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Archive.java Wed Nov 21 22:33:33 2018 -0800
@@ -37,10 +37,13 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
+import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
+import static com.sun.tools.jdeps.Module.trace;
+
/**
* Represents the source of the class files.
*/
@@ -132,6 +135,10 @@
return path != null ? path.toString() : filename;
}
+ public Optional<Path> path() {
+ return Optional.ofNullable(path);
+ }
+
@Override
public int hashCode() {
return Objects.hash(this.filename, this.path);
@@ -152,9 +159,6 @@
return filename;
}
- public Path path() {
- return path;
- }
public static boolean isSameLocation(Archive archive, Archive other) {
if (archive.path == null || other.path == null)
@@ -182,6 +186,7 @@
@Override
public void close() throws IOException {
+ trace("closing %s %n", getPathName());
if (reader != null)
reader.close();
}