67 // analyze dependences |
67 // analyze dependences |
68 boolean rc = super.run(); |
68 boolean rc = super.run(); |
69 |
69 |
70 // A visitor to record the module-level dependences as well as |
70 // A visitor to record the module-level dependences as well as |
71 // use of JDK internal APIs |
71 // use of JDK internal APIs |
72 Analyzer.Visitor visitor = new Analyzer.Visitor() { |
72 Analyzer.Visitor visitor = (origin, originArchive, target, targetArchive) -> { |
73 @Override |
73 Set<String> jdkInternals = |
74 public void visitDependence(String origin, Archive originArchive, |
74 deps.computeIfAbsent(originArchive, _k -> new HashMap<>()) |
75 String target, Archive targetArchive) |
75 .computeIfAbsent(targetArchive, _k -> new HashSet<>()); |
76 { |
|
77 Set<String> jdkInternals = |
|
78 deps.computeIfAbsent(originArchive, _k -> new HashMap<>()) |
|
79 .computeIfAbsent(targetArchive, _k -> new HashSet<>()); |
|
80 |
76 |
81 Module module = targetArchive.getModule(); |
77 Module module = targetArchive.getModule(); |
82 if (originArchive.getModule() != module && |
78 if (originArchive.getModule() != module && |
83 module.isJDK() && !module.isExported(target)) { |
79 module.isJDK() && !module.isExported(target)) { |
84 // use of JDK internal APIs |
80 // use of JDK internal APIs |
85 jdkInternals.add(target); |
81 jdkInternals.add(target); |
86 } |
|
87 } |
82 } |
88 }; |
83 }; |
89 |
84 |
90 // visit the dependences |
85 // visit the dependences |
91 archives.stream() |
86 archives.stream() |