GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-944

static outter class causes error "Illegal modifier for the class"

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1Release, 2.1.2Release
    • Fix Version/s: 2.1.2Release
    • Component/s: None
    • Labels:
      None
    • Environment:
      STS 2.5.1.RELEASE w/ GRECLIPSE 2.1.2.xx-20101222-1200-e36
    • Number of attachments :
      1

      Description

      If an outer class has a static modifier eclipse displays "Illegal modifier for the class". An example file is attached. The full error is displayed below:

      Illegal modifier for the class Bug; only public, abstract & final are permitted PublicClass.groovy /groovy-privclassbug/src/bug line 7 Java Problem

        Activity

        Hide
        Andy Clement added a comment -

        Ok... I've made us 'compatible' with groovy. I'm not sure what groovyc is supposed to be doing with a static outer class but from what I can see it does nothing special. The compiled class is identical to one compiled without specifying static, it doesn't stop me writing a constructor in the type. It feels like it is something they forgot to police when adding inner type support to groovy - and are just discarding the static modifier.

        In case I'm missing something, can I ask what you are expecting to be different when you make your outer class static?

        Show
        Andy Clement added a comment - Ok... I've made us 'compatible' with groovy. I'm not sure what groovyc is supposed to be doing with a static outer class but from what I can see it does nothing special. The compiled class is identical to one compiled without specifying static, it doesn't stop me writing a constructor in the type. It feels like it is something they forgot to police when adding inner type support to groovy - and are just discarding the static modifier. In case I'm missing something, can I ask what you are expecting to be different when you make your outer class static?
        Hide
        Robert Winch added a comment -

        Thanks for the quick response to this issue. To be honest I was confused about this too. The only reason I found this issue was because I wanted to compile gradle which has a static outer class within OutputEventRendererTest named TestListener.

        Show
        Robert Winch added a comment - Thanks for the quick response to this issue. To be honest I was confused about this too. The only reason I found this issue was because I wanted to compile gradle which has a static outer class within OutputEventRendererTest named TestListener.

          People

          • Assignee:
            Andy Clement
            Reporter:
            Robert Winch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: