< prev index next >
src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsFilter.java
Print this page
*** 39,49 ****
* Filter configured based on the input jdeps option
* 1. -p and -regex to match target dependencies
* 2. -filter:package to filter out same-package dependencies
* This filter is applied when jdeps parses the class files
* and filtered dependencies are not stored in the Analyzer.
! * 3. -requires specifies to match target dependence from the given module
* This gets expanded into package lists to be filtered.
* 4. -filter:archive to filter out same-archive dependencies
* This filter is applied later in the Analyzer as the
* containing archive of a target class may not be known until
* the entire archive
--- 39,49 ----
* Filter configured based on the input jdeps option
* 1. -p and -regex to match target dependencies
* 2. -filter:package to filter out same-package dependencies
* This filter is applied when jdeps parses the class files
* and filtered dependencies are not stored in the Analyzer.
! * 3. --require specifies to match target dependence from the given module
* This gets expanded into package lists to be filtered.
* 4. -filter:archive to filter out same-archive dependencies
* This filter is applied later in the Analyzer as the
* containing archive of a target class may not be known until
* the entire archive
*** 164,181 ****
Location target, Archive targetArchive) {
if (findJDKInternals) {
// accepts target that is JDK class but not exported
Module module = targetArchive.getModule();
return originArchive != targetArchive &&
! module.isJDK() && !module.isExported(target.getPackageName());
} else if (filterSameArchive) {
// accepts origin and target that from different archive
return originArchive != targetArchive;
}
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("include pattern: ").append(includePattern).append("\n");
sb.append("filter same archive: ").append(filterSameArchive).append("\n");
--- 164,193 ----
Location target, Archive targetArchive) {
if (findJDKInternals) {
// accepts target that is JDK class but not exported
Module module = targetArchive.getModule();
return originArchive != targetArchive &&
! isJDKInternalPackage(module, target.getPackageName());
} else if (filterSameArchive) {
// accepts origin and target that from different archive
return originArchive != targetArchive;
}
return true;
}
+ /**
+ * Tests if the package is an internal package of the given module.
+ */
+ public boolean isJDKInternalPackage(Module module, String pn) {
+ if (module.isJDKUnsupported()) {
+ // its exported APIs are unsupported
+ return true;
+ }
+
+ return module.isJDK() && !module.isExported(pn);
+ }
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("include pattern: ").append(includePattern).append("\n");
sb.append("filter same archive: ").append(filterSameArchive).append("\n");
< prev index next >