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

ProxyGenerator.instantiateDelegate fails when there are overridden protected methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.4
    • 1.5.5, 1.6-rc-2
    • groovy-jdk
    • None
    • Patch

    Description

      When the delegate has inherited protected methods, the code gets generated more than once for them, resulting in a compilation error.

      def proxy = ProxyGenerator.instantiateDelegate([], [1, 2, 3])
      ==>
      groovy.lang.GroovyRuntimeException: Error creating proxy: startup failed, Script1.groovy: 109: Repetitive method name/signature for method 'void removeRange(int, int)' in class 'ArrayList_delegateProxy'.
       @ line 109, column 10.Script1.groovy: 113: Repetitive method name/signature for method 'void removeRange(int, int)' in class 'ArrayList_delegateProxy'.
       @ line 113, column 10.
      2 errors
      

      The trouble is in getInheritedMethods which makes a list of all of the protected methods, but it adds entries for overridden protected methods in the superclasses.

      Attachments

        1. patch_groovy_2705.txt
          2 kB
          James P. White

        Activity

          People

            jimwhite James P. White
            jimwhite James P. White
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: