groovy
  1. groovy
  2. GROOVY-5274

CLONE - Problem with @InheritConstructors with multiple level of inheritance

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.4
    • Fix Version/s: 1.8.6, 2.0-beta-3
    • Component/s: Compiler
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      See test eclipse project attached.

      • Class Hierarchy : A <-- inherit – B <-- inherit – C
      • A define constructor public A(String dummy) {...}
      • B and C use @InheritConstructors.
      • In the main(...) : C.class.newInstance("tata")
      • Result : Exception in thread "main" groovy.lang.GroovyRuntimeException: Could not find matching constructor for: data.C(java.lang.String)
        at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1474)
        at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1390)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:824)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.newInstance(DefaultGroovyMethods.java:17689)
        at org.codehaus.groovy.runtime.dgm$511.doMethodInvoke(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43)
        at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at Main.MainLaunch.main(MainLaunch.groovy:7)

        Issue Links

          Activity

          Hide
          Paul King added a comment -

          this issue is the actual fix whereas GROOVY-5221 is to fix the doco in the meantime

          Show
          Paul King added a comment - this issue is the actual fix whereas GROOVY-5221 is to fix the doco in the meantime
          Hide
          blackdrag blackdrag added a comment -

          assigned to Paul

          Show
          blackdrag blackdrag added a comment - assigned to Paul
          Hide
          Paul King added a comment -

          This should now be resolved and the temporary warning about the limitations has been removed.

          Show
          Paul King added a comment - This should now be resolved and the temporary warning about the limitations has been removed.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: