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

Eric Milles commented on GROOVY-10594:
--------------------------------------

Can you retry using the latest Groovy 3 snapshot?  The java compiler creates 
public bridge methods in {{StringBuilder}} and {{StringBuffer}} for the public 
methods of {{AbstractStringBuilder}} (the package-private super class).  A 
change was rolled back in the type checker so that the bridge methods regain 
preference.  I don't know if the meta-object protocol (MOP -- the runtime 
selection algorithms) do the same.

> Unable to Call StringBuilder.substring() method (JDK17, Groovy 3)
> -----------------------------------------------------------------
>
>                 Key: GROOVY-10594
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10594
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Gurpreet
>            Assignee: Eric Milles
>            Priority: Major
>         Attachments: demo.zip
>
>
> I am attaching a sample project that will simply print Hello on console. JDK 
> target is set to 11.
> Project can be run using command
> {code:java}
> ./gradlew clean run
> {code}
> When running project with JDK11 it will successfully print Hello to console
> But when running with JDK17, it fails with error
> {code:java}
> groovy.lang.MissingMethodException: No signature of method: 
> java.lang.StringBuilder.substring() is applicable for argument types: 
> (Integer, Integer) values: [0, 5] {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to