Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55911

java lint warning about annotation processor is not recognized

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • analysis-model
    • jenkins: 2.162
      warnings-ng-plugin: 2.1.2
      analysis-model-api-plugin: 2.0.2
      openjdk version "1.8.0_191"

      maven build warning:

      [INFO] -------------------------------------------------------------
      [WARNING] Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'
      [INFO] 1 warning
      

      from javac -Xlint is not recognized/reported by plugin.

          [JENKINS-55911] java lint warning about annotation processor is not recognized

          Ulli Hafner added a comment -

          Which parser?

          Ulli Hafner added a comment - Which parser?

          Which parser?

          Java:

          <io.jenkins.plugins.analysis.core.steps.IssuesRecorder plugin="warnings-ng@2.1.2">
           <analysisTools>
            <io.jenkins.plugins.analysis.warnings.Java>
          

          Piotrek Zygielo added a comment - Which parser? Java: <io.jenkins.plugins.analysis.core.steps.IssuesRecorder plugin= "warnings-ng@2.1.2" > <analysisTools> <io.jenkins.plugins.analysis.warnings.Java>

          Ulli Hafner added a comment -

          I see, the format is totally different. Shouldn’t it make more sense if such warnings will be rather catched by the maven parser only?

          Ulli Hafner added a comment - I see, the format is totally different. Shouldn’t it make more sense if such warnings will be rather catched by the maven parser only?

          Piotrek Zygielo added a comment - - edited

           

          I see, the format is totally different

           
          Right, sadly it is. But it is emitted by javac, and only with `-Xlint` option used.
          The result from command line call:

           

          $ javac -Xlint -Xlint:-processing -cp ../glassfish-embedded-all-5.1.0.jar:../jakarta.ejb-api-3.2.5.jar:../api.jar src/main/java/.../XXX.java 
          warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'
          

          Also - I could not find any way of explicitly disabling this check/warning, and have other still enabled. (After all the end result is as I want - it is effectively ignored...)

          It seems this warning was not fully linted/integrated to -Xlint option (https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7184902 and others).

          Shouldn’t it make more sense if such warnings will be rather catched by the maven parser only?

          I reported this, with expectation that e.h.h.a.p.JavacParser was supposed to catch it.
          My assumption could be wrong, or for any other reason it could be not feasible to add it to JavacParser.

          Unfortunately, with two tools configured (Java, Maven) or Maven alone - in Maven Warnings report, some other warnings are correctly collected, but not this one - it is not present at all.

          For example, from console
           

          [INFO] --- buildnumber-maven-plugin:1.4:create (default) @ integration-tests ---
          [INFO] ShortRevision tag detected. The value is '8'.
          [INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD'
          [INFO] Working directory: .../integration-tests
          [INFO] Storing buildNumber: 20190201.183514-r369adafc at timestamp: 1549042514164
          [WARNING] Cannot get the branch information from the git repository: 
          Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref
          
          [INFO] ShortRevision tag detected. The value is '8'.
          [INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD'
          [INFO] Working directory: .../integration-tests
          [INFO] Storing buildScmBranch: UNKNOWN
          [INFO] 
          [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ integration-tests ---
          [INFO] Using 'UTF-8' encoding to copy filtered resources.
          [INFO] skip non existing resourceDirectory .../integration-tests/src/main/resources
          [INFO] 
          [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ integration-tests ---
          [INFO] Changes detected - recompiling the module!
          [INFO] Compiling 5 source files to .../target/classes
          [WARNING] Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8'
          [INFO] ------------------------------------------------------------------------
          

          the 1st warn (Cannot get the branch...) is present, and the 2nd (Supported source...) is not.

          Probably due to https://github.com/jenkinsci/analysis-model/blob/0e953832b82e0f8d611b84a30146cbb00b9f0ea7/src/main/java/edu/hm/hafner/analysis/parser/MavenConsoleParser.java#L73?

          Piotrek Zygielo added a comment - - edited   I see, the format is totally different   Right, sadly it is. But it is emitted by javac, and only with `-Xlint` option used. The result from command line call:   $ javac -Xlint -Xlint:-processing -cp ../glassfish-embedded-all-5.1.0.jar:../jakarta.ejb-api-3.2.5.jar:../api.jar src/main/java/.../XXX.java warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8' Also - I could not find any way of explicitly disabling this check/warning, and have other still enabled. (After all the end result is as I want - it is effectively ignored...) It seems this warning was not fully linted /integrated to -Xlint option ( https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7184902 and others). Shouldn’t it make more sense if such warnings will be rather catched by the maven parser only? I reported this, with expectation that e.h.h.a.p.JavacParser was supposed to catch it. My assumption could be wrong, or for any other reason it could be not feasible to add it to JavacParser . Unfortunately, with two tools configured (Java, Maven) or Maven alone - in Maven Warnings report, some other warnings are correctly collected, but not this one - it is not present at all. For example, from console   [INFO] --- buildnumber-maven-plugin:1.4:create (default) @ integration-tests --- [INFO] ShortRevision tag detected. The value is '8'. [INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD' [INFO] Working directory: .../integration-tests [INFO] Storing buildNumber: 20190201.183514-r369adafc at timestamp: 1549042514164 [WARNING] Cannot get the branch information from the git repository: Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref [INFO] ShortRevision tag detected. The value is '8'. [INFO] Executing: /bin/sh -c cd '.../integration-tests' && 'git' 'rev-parse' '--verify' '--short=8' 'HEAD' [INFO] Working directory: .../integration-tests [INFO] Storing buildScmBranch: UNKNOWN [INFO] [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ integration-tests --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory .../integration-tests/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ integration-tests --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 5 source files to .../target/classes [WARNING] Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.schema2beansdev.Schema2BeansProcessor' less than -source '1.8' [INFO] ------------------------------------------------------------------------ the 1st warn ( Cannot get the branch... ) is present, and the 2nd ( Supported source... ) is not. Probably due to https://github.com/jenkinsci/analysis-model/blob/0e953832b82e0f8d611b84a30146cbb00b9f0ea7/src/main/java/edu/hm/hafner/analysis/parser/MavenConsoleParser.java#L73 ?

          Ulli Hafner added a comment -

          When this option is part of javac then it is better suited for the javac parser. I think I need to add some tweaks to the regexp so it gets picked up as well.

          Ulli Hafner added a comment - When this option is part of javac then it is better suited for the javac parser. I think I need to add some tweaks to the regexp so it gets picked up as well.

          Just to make it complete of all I know.
          My latest finding is:

          This warning is produced by javac, but it is not from compiler, but rather from annotation processor. Thus turning off a. processing (-proc:none) - if one does not need it - frees console from this message.

          I didn't find separate analysisTool for [non-existing today] apt (which functionality I guess was merged into javac in 1.8, and apt itself was removed from JDK). Maybe new tool could be created, to parse annotation processing results? Just idea.

          Piotrek Zygielo added a comment - Just to make it complete of all I know. My latest finding is: This warning is produced by javac, but it is not from compiler, but rather from annotation processor. Thus turning off a. processing ( -proc:none ) - if one does not need it - frees console from this message. I didn't find separate analysisTool for [non-existing today] apt (which functionality I guess was merged into javac in 1.8, and apt itself was removed from JDK). Maybe new tool could be created, to parse annotation processing results? Just idea.

          Arjan Tijms added a comment -

          The exact definition of this warning comes from the version protection previously set here, but now removed. See:

          https://github.com/Obsidian-StudiosInc/incubator-netbeans/blob/master/schema2beans/src/org/netbeans/modules/schema2beansdev/Schema2BeansProcessor.java#L52

          Arjan Tijms added a comment - The exact definition of this warning comes from the version protection previously set here, but now removed. See: https://github.com/Obsidian-StudiosInc/incubator-netbeans/blob/master/schema2beans/src/org/netbeans/modules/schema2beansdev/Schema2BeansProcessor.java#L52

          Ulli Hafner added a comment -

          Thanks for referencing the commit.

          Ulli Hafner added a comment - Thanks for referencing the commit.

            Unassigned Unassigned
            pzygielo Piotrek Zygielo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: