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

APT exit code isn't correct

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0
    • tools
    • None
    • apt
    • generic
    • generic

      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

            darcy Joe Darcy
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: