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

Spurious errors in unrelated sources after repeated annotation

XMLWordPrintable

    • x86_64
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      Project compiled with maven 3.6.3

      A DESCRIPTION OF THE PROBLEM :
      When a nonrepeatable annotation is repeated, a massive list of spurious, incorrect, syntax errors is produced from multiple files. Most errors are 'cannot find symbol'. Removing the repeated annotation makes the same maven step succeed without relevant diagnostics. Maven is run single-threaded.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Repeat a @SuppressWarnings("...") just before a class method :

      class myClass {

          @SuppressWarnings("CyclomaticComplexity")
          @SuppressWarnings("CyclomaticComplexity")
          public int myMethod(String arg) {
         ...
          }



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A warning or error for the repeated annotation but no spurious error in unrelated source files.
      ACTUAL -
      Spurious errors in other source files. Mostly 'cannot find symbol' whilst the symbols are present.

      ---------- BEGIN SOURCE ----------
      class myClass {

        @SuppressWarnings("OneStatementPerLine")
        @SuppressWarnings("OneStatementPerLine")
        int myMethod(int arg) {
          return arg + 1;
        }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            adev Anupam Dev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: