Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8176482

Use of DirectiveVisitor needs @DefinedBy annotation for RunCodingRules.java

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Resolved In Build:
      b161
    • Verification:
      Verified

      Backports

        Description

        tools/all/RunCodingRules.java failed with This method implements a public API method, and should be marked with @DefinedBy.

        ----------System.err:(58/5180)----------
        java.lang.RuntimeException: java.lang.AssertionError: /scratch/mesos/work_dir/slaves/312d6566-622b-464b-aaa4-3bf578ae320f-S18/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/829c3833-7ba1-42b4-885f-84b681e6dcd8/runs/a22f808f-ef2a-42b1-916e-8de09b841c7a/srcBundle/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java:338: error: This method implements a public API method, and should be marked with @DefinedBy.
                    public Void visitExports(ExportsDirective d, Void p) {
                                ^
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:158)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
        at RunCodingRules.run(RunCodingRules.java:187)
        at RunCodingRules.main(RunCodingRules.java:66)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:547)
        at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:230)
        at java.base/java.lang.Thread.run(Thread.java:844)
        Caused by: java.lang.AssertionError: /scratch/mesos/work_dir/slaves/312d6566-622b-464b-aaa4-3bf578ae320f-S18/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/829c3833-7ba1-42b4-885f-84b681e6dcd8/runs/a22f808f-ef2a-42b1-916e-8de09b841c7a/srcBundle/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java:338: error: This method implements a public API method, and should be marked with @DefinedBy.
                    public Void visitExports(ExportsDirective d, Void p) {
                                ^
        at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:162)
        at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:95)
        at RunCodingRules.lambda$run$2(RunCodingRules.java:99)
        at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedDiagnosticListener.report(ClientCodeWrapper.java:725)
        at jdk.compiler/com.sun.tools.javac.util.Log.writeDiagnostic(Log.java:712)
        at jdk.compiler/com.sun.tools.javac.util.Log$DefaultDiagnosticHandler.report(Log.java:696)
        at jdk.compiler/com.sun.tools.javac.util.Log.report(Log.java:656)
        at jdk.compiler/com.sun.tools.javac.util.AbstractLog.error(AbstractLog.java:126)
        at jdk.compiler/com.sun.tools.javac.util.AbstractLog.error(AbstractLog.java:117)
        at crules.AbstractCodingRulesAnalyzer$Messages.error(AbstractCodingRulesAnalyzer.java:89)
        at crules.DefinedByAnalyzer$DefinedByVisitor.visitMethodDef(DefinedByAnalyzer.java:89)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:866)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitClassDef(TreeScanner.java:118)
        at crules.DefinedByAnalyzer$DefinedByVisitor.visitClassDef(DefinedByAnalyzer.java:63)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:774)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitClassDef(TreeScanner.java:118)
        at crules.DefinedByAnalyzer$DefinedByVisitor.visitClassDef(DefinedByAnalyzer.java:63)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:774)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.visitClassDef(TreeScanner.java:118)
        at crules.DefinedByAnalyzer$DefinedByVisitor.visitClassDef(DefinedByAnalyzer.java:63)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:774)
        at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at crules.CodingRulesAnalyzerPlugin$PostAnalyzeTaskListener.finished(CodingRulesAnalyzerPlugin.java:120)
        at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.finished(ClientCodeWrapper.java:817)
        at jdk.compiler/com.sun.tools.javac.api.MultiTaskListener.finished(MultiTaskListener.java:120)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1425)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1384)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:980)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
        at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
        ... 10 more

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  darcy Joe Darcy
                  Reporter:
                  mli Hamlin Li
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: