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

Warnings plugin failing to parse javac warnings where [-1,-1] is in the end

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: warnings-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.336, Warnings 3.0, Maven 3-alpha 5

      Description

      We get warnings in our maven build output in the format:

      -----------------
      [WARNING] C:\build\hudson_home\jobs\calculator-app-maven3\workspace\maven3\com.company.demo.webservice.extender\src\com\company\webservice\extender\Activator.java (at line 39):[-1,-1]
      public Bundle bundle;
      ^^^^^^
      The field Activator.WebServiceBundle.bundle is never read locally
      -----------------

      We did some reengineering and found out that the javac parser class in the warnings.hpi misses these warnings due to the regular expression which expects the numbers in brackets to be positive. Why they are negative we do not know yet, but the plugin should display the warnings anyway. We created a byte code patch for us by changing the regexp to "[WARNING]\s*(.):[(.).,;# 0-9]\s(?:[(.)])?\s(.*)" but it is a hack only (to keep the line length in the class file). A more correct version should include the "-" and switch back to \d.

      In case somebody else has this issue I attached the patched HPI so that you can at least get the warnings rudimentarly.

        Activity

        Hide
        drulli Ulli Hafner added a comment -

        This warning message is totally different from the typical ones in ant:

        Example:

        javac:

        [javac] C:\Users\tiliven\.hudson\jobs\Hello THS Trunk - compile\workspace\HelloTHSTest\src\ths\Hallo.java:28: warning: begrussen() in ths.types.IGruss has been deprecated

        [javac] System.out.println(grussen[i].begrussen());

        [javac] ^

        Are all of your warnings in the format you described?

        Show
        drulli Ulli Hafner added a comment - This warning message is totally different from the typical ones in ant: Example: javac: [javac] C:\Users\tiliven\.hudson\jobs\Hello THS Trunk - compile\workspace\HelloTHSTest\src\ths\Hallo.java:28: warning: begrussen() in ths.types.IGruss has been deprecated [javac] System.out.println(grussen [i] .begrussen()); [javac] ^ Are all of your warnings in the format you described?
        Hide
        rwetzold rwetzold added a comment -

        Yes all our warnings have this format as far as I can see. Would we need a separate parser for this one?

        We reported the [-1,-1] for Tycho in https://issues.sonatype.org/browse/TYCHO-320

        Show
        rwetzold rwetzold added a comment - Yes all our warnings have this format as far as I can see. Would we need a separate parser for this one? We reported the [-1,-1] for Tycho in https://issues.sonatype.org/browse/TYCHO-320
        Hide
        drulli Ulli Hafner added a comment -

        Can you please try the Eclipse Parser? Doesn't tycho use the Eclipse compiler internally?

        Show
        drulli Ulli Hafner added a comment - Can you please try the Eclipse Parser? Doesn't tycho use the Eclipse compiler internally?
        Hide
        rwetzold rwetzold added a comment -

        We had all parsers activated and none picked up the pattern so far. I think this might be a new or extended case.

        Show
        rwetzold rwetzold added a comment - We had all parsers activated and none picked up the pattern so far. I think this might be a new or extended case.
        Hide
        drulli Ulli Hafner added a comment -

        This seems to be fixed now. When using tycho I always get 2 warning messages (in tycho) for each Java warning. However, the warnings plug-in will now only use the first one in the report.

        1. WARNING in /home/hudson/Hudson/jobs/Fallnavigator/workspace/fallnavigator/de.faktorlogik.prototyp/src/main/java/de/faktorlogik/prototyp/internal/navigation/ClassificationAction.java (at line 75)
        	protected abstract void toggleClassification(@SuppressWarnings("hiding") Classification classification);
        	                                                               ^^^^^^^^
        Unnecessary @SuppressWarnings("hiding")
        ----------
        
        3 problems (3 warnings)
        [WARNING] /home/hudson/Hudson/jobs/Fallnavigator/workspace/fallnavigator/de.faktorlogik.prototyp/src/main/java/de/faktorlogik/prototyp/internal/navigation/ClassificationAction.java (at line 75):[-1,-1] 
        	protected abstract void toggleClassification(@SuppressWarnings("hiding") Classification classification);
        	                                                               ^^^^^^^^
        Unnecessary @SuppressWarnings("hiding")
        
        
        Show
        drulli Ulli Hafner added a comment - This seems to be fixed now. When using tycho I always get 2 warning messages (in tycho) for each Java warning. However, the warnings plug-in will now only use the first one in the report. 1. WARNING in /home/hudson/Hudson/jobs/Fallnavigator/workspace/fallnavigator/de.faktorlogik.prototyp/src/main/java/de/faktorlogik/prototyp/internal/navigation/ClassificationAction.java (at line 75) protected abstract void toggleClassification(@SuppressWarnings("hiding") Classification classification); ^^^^^^^^ Unnecessary @SuppressWarnings("hiding") ---------- 3 problems (3 warnings) [WARNING] /home/hudson/Hudson/jobs/Fallnavigator/workspace/fallnavigator/de.faktorlogik.prototyp/src/main/java/de/faktorlogik/prototyp/internal/navigation/ClassificationAction.java (at line 75):[-1,-1] protected abstract void toggleClassification(@SuppressWarnings("hiding") Classification classification); ^^^^^^^^ Unnecessary @SuppressWarnings("hiding")

          People

          • Assignee:
            drulli Ulli Hafner
            Reporter:
            rwetzold rwetzold
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: