[
https://issues.apache.org/jira/browse/GROOVY-9904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17270114#comment-17270114
]
Paul King commented on GROOVY-9904:
-----------------------------------
{{DefaultGroovyMethods.size(StringBuffer)}} was deprecated almost 9 years ago
and hasn't been one of the available extension methods since that time. Perhaps
you really meant to use the {{StringGroovyMethods}} version which still works?
In fact the {{CharSequence}} variant is the one available as an extension
method. If you just use the extension method from Groovy, you never have to
worry about such changes, e.g. {{new StringBuffer('test').size()}}.
> DefaultGroovyMethods.size() breaking change in 3.0.x
> ----------------------------------------------------
>
> Key: GROOVY-9904
> URL: https://issues.apache.org/jira/browse/GROOVY-9904
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 3.0.7
> Reporter: Romain Bioteau
> Priority: Major
>
> {code:java}
> org.codehaus.groovy.runtime.DefaultGroovyMethods.size(StringBuffer sb) {code}
> doesn't have the same behavior between 2.5.x and 3.0.x
> {code:java}
> assert org.codehaus.groovy.runtime.DefaultGroovyMethods.size(new
> StringBuffer('test')) == 4 // true in 2.5.x
> assert org.codehaus.groovy.runtime.DefaultGroovyMethods.size(new
> StringBuffer('test')) == 4 // false in 3.0.x, expected 1{code}
> I didn't find any explanation about this change in the release note.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)