groovy
  1. groovy
  2. GROOVY-5278

groovy allows top-level classes be marked as private

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta-3
    • Component/s: None
    • Labels:
    • Number of attachments :
      0

      Description

      Groovy allows to make a class like this: private class X{}.
      The result is a top level class, that will be having the private modifier set. But the JVM spec does not include this modifier in the allowed modifiers for classes. Instead this modifier is supposed to be a reserved flag for future use. The violation of this causes internal errors when using indy.

        Activity

        Hide
        blackdrag blackdrag added a comment -

        I reduced the priority a bit because I found it was not this, that causes the indy internal error. The same issue happens with package scoped classes. Also those private classes are quite a bit in use it seems. It would maybe be better to provide an implementation for example as static inner class or such

        Show
        blackdrag blackdrag added a comment - I reduced the priority a bit because I found it was not this, that causes the indy internal error. The same issue happens with package scoped classes. Also those private classes are quite a bit in use it seems. It would maybe be better to provide an implementation for example as static inner class or such
        Hide
        blackdrag blackdrag added a comment -

        we decided to make it fail at compilation for now

        Show
        blackdrag blackdrag added a comment - we decided to make it fail at compilation for now
        Hide
        blackdrag blackdrag added a comment -

        I implemented the compiler check, which will now throw an exception if it encounters a private top level class

        Show
        blackdrag blackdrag added a comment - I implemented the compiler check, which will now throw an exception if it encounters a private top level class

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            blackdrag blackdrag
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: