--- old/src/share/classes/com/sun/tools/jdeps/JdepsTask.java 2013-11-26 13:42:54.000000000 -0800 +++ new/src/share/classes/com/sun/tools/jdeps/JdepsTask.java 2013-11-26 13:42:54.000000000 -0800 @@ -180,6 +180,15 @@ task.options.depth = 0; } }, + new Option(false, "-jdkinternals") { + void process(JdepsTask task, String opt, String arg) { + task.options.findJDKInternals = true; + task.options.verbose = Analyzer.Type.CLASS; + if (task.options.includePattern == null) { + task.options.includePattern = Pattern.compile(".*"); + } + } + }, new Option(false, "-version") { void process(JdepsTask task, String opt, String arg) { task.options.version = true; @@ -248,6 +257,11 @@ showHelp(); return EXIT_CMDERR; } + if (options.findJDKInternals && + (options.regex != null || options.packageNames.size() > 0 || options.showSummary)) { + showHelp(); + return EXIT_CMDERR; + } if (options.showSummary && options.verbose != Analyzer.Type.SUMMARY) { showHelp(); return EXIT_CMDERR; @@ -571,6 +585,7 @@ boolean wildcard; boolean apiOnly; boolean showLabel; + boolean findJDKInternals; String dotOutputDir; String classpath = ""; int depth = 1; @@ -681,6 +696,11 @@ @Override public void visitDependence(String origin, Archive source, String target, Archive archive, Profile profile) { + if (options.findJDKInternals && + !(archive instanceof JDKArchive && profile == null)) { + // filter dependences other than JDK internal APIs + return; + } if (!origin.equals(pkg)) { pkg = origin; writer.format(" %s (%s)%n", origin, source.getFileName()); @@ -717,6 +737,11 @@ @Override public void visitDependence(String origin, Archive source, String target, Archive archive, Profile profile) { + if (options.findJDKInternals && + !(archive instanceof JDKArchive && profile == null)) { + // filter dependences other than JDK internal APIs + return; + } // if -P option is specified, package name -> profile will // be shown and filter out multiple same edges. String name = getProfileArchiveInfo(archive, profile); --- old/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties 2013-11-26 13:42:55.000000000 -0800 +++ new/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties 2013-11-26 13:42:55.000000000 -0800 @@ -59,10 +59,17 @@ main.opt.dotoutput=\ \ -dotoutput Destination directory for DOT file output +main.opt.jdkinternals=\ +\ -jdkinternals Finds class-level dependences on JDK internal APIs.\n\ +\ By default, it analyzes all classes on -classpath\n\ +\ and input files unless -include option is specified.\n\ +\ This option cannot be used with -p, -e and -s options. + main.opt.depth=\ \ -depth= Specify the depth of the transitive\n\ \ dependency analysis + err.unknown.option=unknown option: {0} err.missing.arg=no value given for {0} err.internal.error=internal error: {0} {1} {2}