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/07/26 01:35:00 UTC
[jira] [Created] (GROOVY-11136) NoSuchMethodError thrown when execute groovy script
Pan Jian created GROOVY-11136:
---------------------------------
Summary: NoSuchMethodError thrown when execute groovy script
Key: GROOVY-11136
URL: https://issues.apache.org/jira/browse/GROOVY-11136
Project: Groovy
Issue Type: Bug
Components: ast builder
Affects Versions: 2.5.22
Environment: Java 1.7
Reporter: Pan Jian
v2.5.x in for Java 1.7.
There is an method called getOrDefault in GROOVY_2_5_X branch, which causes NoSuchMethodError, because Map.getOrDefault is 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)