When AnnotationProcessor throws a runtime exception, APT prints the stack trace, then returns with exit code 0 as if nothing went wrong.
Tracing the code, Main.compile(String[],Context) correctly exits with EXIT_ABNORMAL, but when it comes back to Main.compile(String[],AnnotationProcessorFactory), it simply records this value to a local "returnCode" variable and it then goes on to invoke javac with the generated code.
If javac doesn't fail, the returnCode is overwritten by javac's return code (line 1044), and hence the problem.
A non-zero exit code in earlier stage shouldn't trigger javac, or I suggest the returnCode to be OR-ed or added so that a failure in any one of the steps would cause the exit code to be non-zero.
###@###.### 2005-2-01 02:04:01 GMT