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.)
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.)
- duplicates
-
JDK-8066843 Messager.printMessage cannot print multiple errors for same source position
-
- Closed
-