groovy
  1. groovy
  2. GROOVY-4965

shim classes generated incorrectly in 1.8.1 (was fine in 1.8.0) for some static inner-class usages

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2, 1.9-beta-3
    • Component/s: Compiler
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Static inner classes that are imported into Groovy scripts just fine in 1.8 are causing compilation issues in 1.8.1

      To reproduce:
      1) Java class Foo.Bar where Bar is public static within Foo.
      2) Groovy script references the Foo.Bar as a type with an arglist to a method.

      3) Groovy/Maven/Shim compiler puts a $ in the generated Java source name instead of a dot.

      As I said, all that changed between working and not working is the version of Groovy. This worked in 1.8.0 and at least some recent 1.7.x versions.

        Activity

        Hide
        Paul King added a comment -

        I have been unable to replicate an error case yet but the latest snapshot (I believe) should have the "replace" patch in place - the "printTypeName" patch broke some other behavior so I didn't go that way. It would be interesting to see if the latest snapshot fixes your issue.

        Show
        Paul King added a comment - I have been unable to replicate an error case yet but the latest snapshot (I believe) should have the "replace" patch in place - the "printTypeName" patch broke some other behavior so I didn't go that way. It would be interesting to see if the latest snapshot fixes your issue.
        Hide
        Paul Hammant added a comment -

        close this issue. i moved my inner class to outer.

        Show
        Paul Hammant added a comment - close this issue. i moved my inner class to outer.
        Hide
        Paul King added a comment -

        Just waiting feedback from Peter to see if this is still a problem for Gradle. If not I will close the issue.

        Show
        Paul King added a comment - Just waiting feedback from Peter to see if this is still a problem for Gradle. If not I will close the issue.
        Hide
        Peter Niederwieser added a comment -

        I eventually worked around it like Paul (converted the nested class to a top-level class). If you are interested, the groovy-1.8 branch of Gradle is available on GitHub.

        Show
        Peter Niederwieser added a comment - I eventually worked around it like Paul (converted the nested class to a top-level class). If you are interested, the groovy-1.8 branch of Gradle is available on GitHub.
        Hide
        Paul King added a comment -

        Fix to replace '$' with '.' was added but no test case could reproduce the original problem. Assuming fixed.

        Show
        Paul King added a comment - Fix to replace '$' with '.' was added but no test case could reproduce the original problem. Assuming fixed.

          People

          • Assignee:
            Paul King
            Reporter:
            Paul Hammant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: