* @compile/fail -Werror -Xlint:all,-path T4994049/ Serial.java
is nonsensical, and succeeding because the compilation fails for the wrong reason.
The line should be deleted.
There are three test failures:
2. The other two tests are expecting "less common" exit codes from javac. The best way to fix them is to write a library class, CompileFail, which emulates @compile/fail but which also allows the specific exit code to be tested.
Hmmm, we've uncovered a curiousity in TestReturnCode.java. Errors thrown from annotation processors are treated different (and less severely) than exceptions.
Errors cause EXIT_ERROR, exit code 1, equivalent to a compile-time error
Exceptions cause EXIT_SYSERR, exit code 3, system error or resource exhaustion