langtools/src/jdk.dev/share/classes/com/sun/tools/jdeps/Archive.java
changeset 28706 a724585645ce
parent 27579 d1a63c99cdd5
equal deleted inserted replaced
28705:675cb37e74a8 28706:a724585645ce
    73     public String getName() {
    73     public String getName() {
    74         return filename;
    74         return filename;
    75     }
    75     }
    76 
    76 
    77     public void addClass(Location origin) {
    77     public void addClass(Location origin) {
    78         Set<Location> set = deps.get(origin);
    78         deps.computeIfAbsent(origin, _k -> new HashSet<>());
    79         if (set == null) {
       
    80             set = new HashSet<>();
       
    81             deps.put(origin, set);
       
    82         }
       
    83     }
    79     }
    84 
    80 
    85     public void addClass(Location origin, Location target) {
    81     public void addClass(Location origin, Location target) {
    86         Set<Location> set = deps.get(origin);
    82         deps.computeIfAbsent(origin, _k -> new HashSet<>()).add(target);
    87         if (set == null) {
       
    88             set = new HashSet<>();
       
    89             deps.put(origin, set);
       
    90         }
       
    91         set.add(target);
       
    92     }
    83     }
    93 
    84 
    94     public Set<Location> getClasses() {
    85     public Set<Location> getClasses() {
    95         return deps.keySet();
    86         return deps.keySet();
    96     }
    87     }
   113 
   104 
   114     public String toString() {
   105     public String toString() {
   115         return filename;
   106         return filename;
   116     }
   107     }
   117 
   108 
       
   109     public Path path() {
       
   110         return path;
       
   111     }
       
   112 
   118     interface Visitor {
   113     interface Visitor {
   119         void visit(Location origin, Location target);
   114         void visit(Location origin, Location target);
   120     }
   115     }
   121 }
   116 }