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

Eric Milles commented on GROOVY-10136:
--------------------------------------

Quick update (more details in GROOVY-10109 and GROOVY-10429): Java compiler 
creates a public bridge method in StringBuilder.  Groovy compiler now selects 
the public bridge method, so no package-private access issue.  Groovy 4.0.7, 
3.0.14 and 2.5.20 contain this fix.

> [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
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 4.0.0
>
>
> 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.10#820010)

Reply via email to