Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.25, 3.0.24
-
None
-
None
Description
A call to a private method in a BaseClass fails, if the MetaClass of an instance of a SubType is replace with a non-standard MetaClass.
The attached reproducer should call the method privateMethod(), but does fail with:
groovy.lang.MissingMethodException: No signature of method: SubClass.privateMethod() is applicable for argument types: () values: [] at CustomMetaClass.invokeMethod(test.groovy:40) at CustomMetaClass.super$2$invokeMethod(test.groovy) at CustomMetaClass.invokeMethod(test.groovy:30) at BaseClass.publicMethod(test.groovy:10) at CustomMetaClass.super$2$invokeMethod(test.groovy) at CustomMetaClass.invokeMethod(test.groovy:40) at CustomMetaClass.super$2$invokeMethod(test.groovy) at CustomMetaClass.invokeMethod(test.groovy:35) at test.run(test.groovy:5)
See also Groovy WebConsole.
It also seams to need to be compiled with Indy, but with Indy it fails in Groovy 3.x and Groovy 4.x.
The culprit seams somewhere around "org.codehaus.groovy.vmplugin.v8.Selector.getMetaClassImpl()" where the type of the meta class is checked, and for non standard MetaClass the code path deviates.
And then the Sender Class "BaseClass" is not used in the CustomMetaClass anymore, then failing with it could not find the private method.
Note: It does not fail, if the class is not compile with Indy.
Attachments
Attachments
Issue Links
- links to