--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java Mon Jul 13 16:57:52 2015 +0400
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java Mon Jul 13 16:33:42 2015 +0200
@@ -344,6 +344,10 @@
checker.scan(dc, p);
}
+ public boolean shouldCheck(CompilationUnitTree unit) {
+ return env.shouldCheck(unit);
+ }
+
public void reportStats(PrintWriter out) {
env.messages.reportStats(out);
}
@@ -406,26 +410,8 @@
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitCompilationUnit(CompilationUnitTree node, Void p) {
- if (env.includePackages != null) {
- String packageName = node.getPackageName() != null
- ? node.getPackageName().toString()
- : "";
- if (!env.includePackages.isEmpty()) {
- boolean included = false;
- for (Pattern pack : env.includePackages) {
- if (pack.matcher(packageName).matches()) {
- included = true;
- break;
- }
- }
- if (!included)
- return null;
- }
- for (Pattern pack : env.excludePackages) {
- if (pack.matcher(packageName).matches()) {
- return null;
- }
- }
+ if (!env.shouldCheck(node)) {
+ return null;
}
return super.visitCompilationUnit(node, p);
}