178 new Option(false, "-R", "-recursive") { |
178 new Option(false, "-R", "-recursive") { |
179 void process(JdepsTask task, String opt, String arg) { |
179 void process(JdepsTask task, String opt, String arg) { |
180 task.options.depth = 0; |
180 task.options.depth = 0; |
181 } |
181 } |
182 }, |
182 }, |
|
183 new Option(false, "-jdkinternals") { |
|
184 void process(JdepsTask task, String opt, String arg) { |
|
185 task.options.findJDKInternals = true; |
|
186 task.options.verbose = Analyzer.Type.CLASS; |
|
187 if (task.options.includePattern == null) { |
|
188 task.options.includePattern = Pattern.compile(".*"); |
|
189 } |
|
190 } |
|
191 }, |
183 new Option(false, "-version") { |
192 new Option(false, "-version") { |
184 void process(JdepsTask task, String opt, String arg) { |
193 void process(JdepsTask task, String opt, String arg) { |
185 task.options.version = true; |
194 task.options.version = true; |
186 } |
195 } |
187 }, |
196 }, |
679 |
694 |
680 private String pkg = ""; |
695 private String pkg = ""; |
681 @Override |
696 @Override |
682 public void visitDependence(String origin, Archive source, |
697 public void visitDependence(String origin, Archive source, |
683 String target, Archive archive, Profile profile) { |
698 String target, Archive archive, Profile profile) { |
684 if (!origin.equals(pkg)) { |
699 if (options.findJDKInternals && |
685 pkg = origin; |
700 !(archive instanceof JDKArchive && profile == null)) { |
686 writer.format(" %s (%s)%n", origin, source.getFileName()); |
701 // filter dependences other than JDK internal APIs |
687 } |
702 return; |
688 writer.format(" -> %-50s %s%n", target, getProfileArchiveInfo(archive, profile)); |
703 } |
|
704 if (options.verbose == Analyzer.Type.VERBOSE) { |
|
705 writer.format(" %-50s -> %-50s %s%n", |
|
706 origin, target, getProfileArchiveInfo(archive, profile)); |
|
707 } else { |
|
708 if (!origin.equals(pkg)) { |
|
709 pkg = origin; |
|
710 writer.format(" %s (%s)%n", origin, source.getFileName()); |
|
711 } |
|
712 writer.format(" -> %-50s %s%n", |
|
713 target, getProfileArchiveInfo(archive, profile)); |
|
714 } |
689 } |
715 } |
690 |
716 |
691 @Override |
717 @Override |
692 public void visitArchiveDependence(Archive origin, Archive target, Profile profile) { |
718 public void visitArchiveDependence(Archive origin, Archive target, Profile profile) { |
693 writer.format("%s -> %s", origin.getPathName(), target.getPathName()); |
719 writer.format("%s -> %s", origin.getPathName(), target.getPathName()); |
715 } |
741 } |
716 |
742 |
717 @Override |
743 @Override |
718 public void visitDependence(String origin, Archive source, |
744 public void visitDependence(String origin, Archive source, |
719 String target, Archive archive, Profile profile) { |
745 String target, Archive archive, Profile profile) { |
|
746 if (options.findJDKInternals && |
|
747 !(archive instanceof JDKArchive && profile == null)) { |
|
748 // filter dependences other than JDK internal APIs |
|
749 return; |
|
750 } |
720 // if -P option is specified, package name -> profile will |
751 // if -P option is specified, package name -> profile will |
721 // be shown and filter out multiple same edges. |
752 // be shown and filter out multiple same edges. |
722 String name = getProfileArchiveInfo(archive, profile); |
753 String name = getProfileArchiveInfo(archive, profile); |
723 writeEdge(writer, new Edge(origin, target, getProfileArchiveInfo(archive, profile))); |
754 writeEdge(writer, new Edge(origin, target, getProfileArchiveInfo(archive, profile))); |
724 } |
755 } |