[ 
https://issues.apache.org/jira/browse/GROOVY-10136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17536789#comment-17536789
 ] 

Fabian Depry commented on GROOVY-10136:
---------------------------------------

We have just hit this problem ourselves. 

Here is a very simple way to reproduce the error in a Java class:
{code:java}
new GroovyShell().evaluate("new StringBuilder().setLength(1)"); {code}
What is interesting is that the exception happens in our Windows testing 
environment, but not in our Linux one!

We are using Groovy 3.0.10.

> [JDK16] Failed to find `public` method derived from `package` super class
> -------------------------------------------------------------------------
>
>                 Key: GROOVY-10136
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10136
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Daniel Sun
>            Priority: Major
>
> The {{public}} {{setLength()}} is defined in 
> {{java.lang.AbstractStringBuilder}}, whose visibility is {{package}}, the 
> following error happened if accessing {{setLength()}} via 
> {{java.lang.StringBuilder}}, which is derived from 
> {{java.lang.AbstractStringBuilder}}
> {code:java}
> TraitsSpecificationTest > testStackableTraits FAILED
>     groovy.lang.MissingMethodException: No signature of method: 
> java.lang.StringBuilder.setLength() is applicable for argument types: 
> (Integer) values: [0]
>     Possible solutions: setLength(int), length()
>         at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70)
>         at 
> org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
>         at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
>         at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
>         at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
>         at 
> TraitsSpecificationTest$PrintCategory.reset(TraitsSpecificationTest.groovy:838)
>         at 
> org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to