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

@Delegate does not handle native methods correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.7.2, 1.6.9, 1.8-beta-1
    • None
    • None

    Description

      class MyString {
          @Delegate String str
      }
      
      assert MyString != null
      

      The code above fails with the error below

      Caught: java.lang.ClassFormatError: Code attribute in native or abstract methods in class file MyString
      

      It happens because String class has a native intern(). The delegate method that @Delegate adds to MyString continues to be marked native and now has code body added to it, which causes the ClassFormatError.

      Attachments

        Activity

          People

            roshandawrani Roshan Dawrani
            roshandawrani Roshan Dawrani
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: