diff --git a/langtools/make/tools/crules/DefinedByAnalyzer.java b/langtools/make/tools/crules/DefinedByAnalyzer.java
index b0ab426239e..fe79c8eb745 100644
--- a/langtools/make/tools/crules/DefinedByAnalyzer.java
+++ b/langtools/make/tools/crules/DefinedByAnalyzer.java
@@ -23,10 +23,15 @@
package crules;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
import com.sun.source.util.JavacTask;
import com.sun.source.util.TaskEvent.Kind;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.MethodSymbol;
+import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.tree.TreeScanner;
import com.sun.tools.javac.util.DefinedBy;
@@ -44,7 +49,20 @@ public class DefinedByAnalyzer extends AbstractCodingRulesAnalyzer {
eventKind = Kind.ANALYZE;
}
+ //only java.compiler and jdk.compiler modules implement the APIs,
+ //so only these need the @DefinedBy annotation:
+ private static final Set