You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Pan Jian (Jira)" <ji...@apache.org> on 2023/08/23 01:28:00 UTC

[jira] [Closed] (GROOVY-11136) NoSuchMethodError thrown when executing Groovy script

     [ https://issues.apache.org/jira/browse/GROOVY-11136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pan Jian closed GROOVY-11136.
-----------------------------

Confirmed in version 2.5.23 .

> NoSuchMethodError thrown when executing Groovy script
> -----------------------------------------------------
>
>                 Key: GROOVY-11136
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11136
>             Project: Groovy
>          Issue Type: Bug
>          Components: ast builder, Compiler
>    Affects Versions: 2.5.22
>         Environment: Java 1.7
>            Reporter: Pan Jian
>            Assignee: Eric Milles
>            Priority: Critical
>             Fix For: 2.5.23
>
>         Attachments: CI.png, SystemRequirements.png, demo.groovy, error.png
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> v2.5.x is for Java 1.7.
> {{GROOVY_2_5_X}} branch has a method called {{getOrDefault}} that raises {{NoSuchMethodError}} because {{Map.getOrDefault}} was introduced in Java 1.8.
> [https://github.com/apache/groovy/blob/GROOVY_2_5_X/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L426C66-L426C78]
> [https://github.com/apache/groovy/commit/ccfd6053d1b52488577bcdb2ee4693b1cf907f10#diff-44c9e077575ae7093626dbc9bb5f59df0483975e7af0b87f62dc4a98aa5f4ecbR426]
> [https://docs.oracle.com/javase/7/docs/api/java/lang/NoSuchMethodError.html]
> [https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#getOrDefault-java.lang.Object-V-]
>  



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