jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
groovy
  • groovy
  • GROOVY-4506 Groovy 3.0 code clean up (including b...
  • GROOVY-2720

Convert org.codehaus.groovy.control.Phases to an Enum

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Reopened Reopened
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.6-beta-1
  • Fix Version/s: 4.0
  • Component/s: class generator, command line processing, parser, parser-antlr
  • Labels:
    None
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

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!

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    Phases_as_enum.patch
    01/Apr/08 11:59 AM
    40 kB
    Danno Ferrin

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity

People

  • Assignee:
    Unassigned
    Reporter:
    Danno Ferrin
Vote (0)
Watch (0)

Dates

  • Created:
    01/Apr/08 11:59 AM
    Updated:
    29/Oct/12 6:36 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.