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

JavacTrees never allows multiple error messages on the same tree

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 9
    • 8, 9
    • tools
    • None

      When using JavacTrees to report multiple errors on a tree, only the first one appears.
      The JavacTrees implementation of printMessage saves and restores the value of log.multipleErrors, but doesn't set it to true.
      In contrast, the JavacMessager implementation of printMessage also sets log.multipleErrors to true.

      I notice that in the JDK 9 implementation of these messages, both take
      DiagnosticFlag.MULTIPLE as first argument.

      The attached Test.java illustrates the problem. Test.out contains the expected output. At the moment the last output line is missing.
      The attached FixTest.diff fixes the problem and produces the expected outcome.
      (Sorry, my jtreg skills are failing me and the jtreg annotations are wrong.)

        1. FixTest.diff
          0.5 kB
        2. Test.java
          3 kB
        3. Test.out
          0.2 kB

            jlahoda Jan Lahoda
            wmdietl Werner Dietl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: