You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/08/31 09:56:00 UTC

[jira] [Comment Edited] (GROOVY-9707) TypeChecked: NoSuchMethodError: DefaultGroovyMethods.plus(java.lang.String, java.lang.Object)

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

Paul King edited comment on GROOVY-9707 at 8/31/20, 9:55 AM:
-------------------------------------------------------------

We'd need to see a bit more how you are using it. You should normally now point to {{StringGroovyMethods#plus(CharSequence, Object)}}.

I would not expect the {{NoSuchMethodError}} unless you had a class compiled with {{@CompileStatic}} from quite a few years ago on the classpath (an old plugin?) or perhaps a Java class compiled with an old Groovy and directly using the old DGM class. The {{StringGroovyMethods}} version is about 8.5 years old.


was (Author: paulk):
We'd need to see a bit more how you are using it. You should normally now point to {{StringGroovyMethods#plus(CharSequence, Object)}}.

I would not expect the {{NoSuchMethodError}} unless you had a class compiled with {{@CompileStatic}} from quite a few years ago or perhaps a Java class again, compiled against an old Groovy and directly using the old class. The {{StringGroovyMethods}} version is about 8.5 years old.

> TypeChecked: NoSuchMethodError: DefaultGroovyMethods.plus(java.lang.String, java.lang.Object)
> ---------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-9707
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9707
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 3.0.5
>            Reporter: Radoslav Ivanov
>            Priority: Major
>
> Looking for advice around resolving a problem after upgrading Groovy from 2.5.9 to 3.0.5. 
> Most of the @TypeChecked scripts start hitting NoSuchMethodError when concatenating two strings ("a" + "b"), which is resolved if @TypeChecked is removed... The removed method's deprecation java doc (in 2.4.7) says to "Use the CharSequence version"...
> {code:java}
> java.lang.NoSuchMethodError: 'java.lang.String org.codehaus.groovy.runtime.DefaultGroovyMethods.plus(java.lang.String, java.lang.Object){code}
> May be I am missing something.. any advice will be appreciated...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)