You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2023/04/15 12:01:12 UTC
[groovy] branch GROOVY_4_0_X updated (a4dac87444 -> fb0b5f5bdb)
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a change to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
from a4dac87444 GROOVY-11011: SC: apply array flow type
new aaa6bb0768 Trivial refactoring: reuse `ArrayTypeUtils.dimension`
new c6459db64d Add JDK21 build
new fb0b5f5bdb GROOVY-11016: Bump javaparser to 3.25.2
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/workflows/groovy-build-test-ea.yml | 3 ++-
.../groovy/transform/stc/StaticTypeCheckingSupport.java | 10 ++++------
src/test/groovy/execute/ExecuteTest.groovy | 7 +++----
src/test/groovy/transform/stc/LambdaTest.groovy | 4 ++--
versions.properties | 2 +-
5 files changed, 12 insertions(+), 14 deletions(-)
[groovy] 02/03: Add JDK21 build
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit c6459db64d19e6c12fd074eb1edb32d5c0fa420e
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Apr 15 19:18:49 2023 +0800
Add JDK21 build
(cherry picked from commit 473112fddf7d0c1fcb6962cde22f5cc42630ce7e)
---
.github/workflows/groovy-build-test-ea.yml | 3 ++-
src/test/groovy/execute/ExecuteTest.groovy | 7 +++----
src/test/groovy/transform/stc/LambdaTest.groovy | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/groovy-build-test-ea.yml b/.github/workflows/groovy-build-test-ea.yml
index 1737f636c7..505fedaa0d 100644
--- a/.github/workflows/groovy-build-test-ea.yml
+++ b/.github/workflows/groovy-build-test-ea.yml
@@ -28,7 +28,8 @@ jobs:
os: [ubuntu-20.04]
java: [17]
# The jdk links of "install-jdk.sh" are sometimes outdated, so we have to download openjdk releases from https://jdk.java.net/ by ourselves.
- jdk: ["https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_linux-x64_bin.tar.gz"]
+ jdk: ["https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_linux-x64_bin.tar.gz",
+ "https://download.java.net/java/early_access/jdk21/18/GPL/openjdk-21-ea+18_linux-x64_bin.tar.gz"]
runs-on: ${{ matrix.os }}
steps:
- name: Download JDK ${{ matrix.jdk }}
diff --git a/src/test/groovy/execute/ExecuteTest.groovy b/src/test/groovy/execute/ExecuteTest.groovy
index f9bc1055f6..6c906a9658 100644
--- a/src/test/groovy/execute/ExecuteTest.groovy
+++ b/src/test/groovy/execute/ExecuteTest.groovy
@@ -19,9 +19,6 @@
package groovy.execute
import groovy.test.GroovyTestCase
-
-import static groovy.test.GroovyAssert.isAtLeastJdk
-
/**
* Cross platform tests for the DGM#execute() family of methods.
*/
@@ -157,7 +154,9 @@ final class ExecuteTest extends GroovyTestCase {
def err = new StringBuffer()
process.waitForProcessOutput(out, err)
- assert out.toString().startsWith('hello')
+ // Run on JDK21ea, we got the following warning:
+ // '[0.054s][warning][cds] Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "groovy.lang.GroovyClassLoader"). To use archived non-system classes, this property must not be set\nhello\n'
+ assert out.toString().contains('hello')
assert process.exitValue() == 0
}
}
diff --git a/src/test/groovy/transform/stc/LambdaTest.groovy b/src/test/groovy/transform/stc/LambdaTest.groovy
index c117fbac24..d3a2375d92 100644
--- a/src/test/groovy/transform/stc/LambdaTest.groovy
+++ b/src/test/groovy/transform/stc/LambdaTest.groovy
@@ -1140,7 +1140,7 @@ final class LambdaTest {
test()
'''
- assert err.message.contains('$Lambda$')
+ assert err.message.contains('$Lambda')
}
@Test
@@ -1756,7 +1756,7 @@ final class LambdaTest {
assertScript shell, '''
static void main(args) {
Function<String, String> lower = String::toLowerCase
- assert lower.toString().contains('$$Lambda$')
+ assert lower.toString().contains('$$Lambda')
}
'''
}
[groovy] 03/03: GROOVY-11016: Bump javaparser to 3.25.2
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit fb0b5f5bdbad9d996be794c1cb9260b0fcd483a2
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Apr 15 19:59:26 2023 +0800
GROOVY-11016: Bump javaparser to 3.25.2
---
versions.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/versions.properties b/versions.properties
index b7986400ff..4cef74c74f 100644
--- a/versions.properties
+++ b/versions.properties
@@ -31,7 +31,7 @@ jansi=2.4.0
jacksonDatabind=2.14.2
jackson=2.14.2
jarjar=1.8.0
-javaParser=3.25.1
+javaParser=3.25.2
jline=2.14.6
jmh=1.35
jmock=1.2.0
[groovy] 01/03: Trivial refactoring: reuse `ArrayTypeUtils.dimension`
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit aaa6bb076826b2ad6481317846458752ca4a0c35
Author: Daniel Sun <su...@apache.org>
AuthorDate: Wed Apr 12 05:47:31 2023 +0800
Trivial refactoring: reuse `ArrayTypeUtils.dimension`
---
.../groovy/transform/stc/StaticTypeCheckingSupport.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
index 0657c6854e..b0e040241e 100644
--- a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
+++ b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingSupport.java
@@ -47,6 +47,7 @@ import org.codehaus.groovy.ast.tools.WideningCategories;
import org.codehaus.groovy.control.CompilationUnit;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.control.Phases;
+import org.codehaus.groovy.runtime.ArrayTypeUtils;
import org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl;
import org.codehaus.groovy.syntax.Types;
import org.codehaus.groovy.tools.GroovyClass;
@@ -1574,14 +1575,11 @@ public abstract class StaticTypeCheckingSupport {
}
private static int dimensions(ClassNode cn) {
- int dims = 0;
- while (cn.isArray()) {
- cn = cn.getComponentType();
- dims += 1;
+ if (!cn.isArray()) {
+ return 0;
}
- return dims;
+ return ArrayTypeUtils.dimension(cn);
}
-
private static boolean compatibleConnection(final GenericsType resolved, final GenericsType connection) {
if (resolved.isPlaceholder()
&& resolved.getUpperBounds() != null