Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1169

Constants defined in interface not visible to subclasses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0-JSR-4
    • 1.0-JSR-5
    • bytecode
    • None

    Description

      The latest release of Groovy does not recognise public static constants defined in an interface implemented by a super class. This worked in previous versions but is broken in the latest JSR release.

      The problem occurs for me as I write XWork actions in Groovy. XWork has an Action interface which defines constants for the different response types (see http://www.opensymphony.com/xwork/api/com/opensymphony/xwork/Action.html)

      This interface is implemented by ActionSupport (see http://www.opensymphony.com/xwork/api/com/opensymphony/xwork/ActionSupport.html). I have sub classed ActionSupport with my own class called "AbstractAction".

      This is the class that is extended by my Groovy actions. However they throw errors like the below when loaded:

      Caused by: script1133545392341.groovy: 29: The variable ERROR is undefined in the current scope
      @ line 29, column 11.script1133545392341.groovy: 32: The variable SUCCESS is undefined in the current scope
      @ line 32, column 10.

      This does not make sense as these should clearly be visible given that the Groovy actions extend AbstractAction which extends ActionSupport which implements Action gasp!

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: