[
https://issues.apache.org/jira/browse/GROOVY-2720?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-2720:
--------------------------------
Fix Version/s: (was: 4.x)
> Convert org.codehaus.groovy.control.Phases to an Enum
> -----------------------------------------------------
>
> Key: GROOVY-2720
> URL: https://issues.apache.org/jira/browse/GROOVY-2720
> Project: Groovy
> Issue Type: Sub-task
> Components: class generator, parser, parser-antlr2
> Affects Versions: 1.6-beta-1
> Reporter: Daniel Ferrin
> Priority: Major
> Attachments: Phases_as_enum.patch
>
>
> 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!
--
This message was sent by Atlassian Jira
(v8.20.1#820001)