Details
-
Sub-task
-
Status: Reopened
-
Major
-
Resolution: Unresolved
-
1.6-beta-1
-
None
-
None
-
Patch
Description
The attached patch deprecates org.codehaus.groovy.control.Phases and introduces a new enum org.codehaus.groovy.control.CompilePhase that lists the same phases (plus non-phases startup and finished). All uses of Phases were converted from ints to the enum.
Public APIs that were converted to enums had their int variant kept and deprecated, and each thunks to the enum variant.
Why enums? The biggest advantage I see is that we can add/move phases without having to require that all other code that ever read constants from Phases be re-compiled. Now that 1.6 is Java 5 based we can use enums. Look at the Joint compile stuff, classes are all loaded into the conversion phase without any good place to layer on any addition steps. We could add JOINT_STUB_PREPARATION (for the non-failing resolve step) and JOINT_STUB_GENERATION. w/o having to re-number or go to floats.
It even passes the retro tests!