From 7f3f479c4a8edbc83a4aa38f6c82eb6b27d6547c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:00:37 +0000 Subject: [PATCH 1/2] Initial plan From 668044bff2b9a3e35ef8d574dc65e7a59327bbd7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:10:50 +0000 Subject: [PATCH 2/2] Remove retrolambda and custom functional interfaces, use java.util.function Agent-Logs-Url: https://github.com/jMonkeyEngine/jmonkeyengine/sessions/cb42d986-3665-4a49-adf0-eb4a85119711 Co-authored-by: riccardobl <4943530+riccardobl@users.noreply.github.com> --- build.gradle | 11 +----- gradle/libs.versions.toml | 1 - .../bufferobject/layout/BufferLayout.java | 8 ++--- .../com/jme3/util/functional/Function.java | 36 ------------------- .../jme3/util/functional/NoArgFunction.java | 36 ------------------- .../util/functional/NoArgVoidFunction.java | 36 ------------------- .../jme3/util/functional/VoidFunction.java | 36 ------------------- 7 files changed, 5 insertions(+), 159 deletions(-) delete mode 100644 jme3-core/src/main/java/com/jme3/util/functional/Function.java delete mode 100644 jme3-core/src/main/java/com/jme3/util/functional/NoArgFunction.java delete mode 100644 jme3-core/src/main/java/com/jme3/util/functional/NoArgVoidFunction.java delete mode 100644 jme3-core/src/main/java/com/jme3/util/functional/VoidFunction.java diff --git a/build.gradle b/build.gradle index 4aa9a96d4a..7976b3d6ff 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,6 @@ buildscript { } dependencies { classpath libs.android.build.gradle - classpath libs.gradle.retrolambda classpath libs.spotbugs.gradle.plugin } } @@ -33,8 +32,6 @@ apply plugin: 'base' apply plugin: 'com.github.spotbugs' apply from: file('version.gradle') -apply plugin: 'me.tatarka.retrolambda' - // This is applied to all sub projects subprojects { if(!project.name.equals('jme3-android-examples')) { @@ -245,10 +242,4 @@ if (skipPrebuildLibraries != "true" && buildNativeProjects != "true") { assemble.dependsOn extractPrebuiltNatives } -} - -retrolambda { - javaVersion JavaVersion.VERSION_1_7 - incremental true - jvmArgs '-noverify' -} +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3ac3ad8371..410fb5772d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,6 @@ android-support-appcompat = "com.android.support:appcompat-v7:28.0.0" androidx-annotation = "androidx.annotation:annotation:1.3.0" androidx-lifecycle-common = "androidx.lifecycle:lifecycle-common:2.4.0" gradle-git = "org.ajoberstar:gradle-git:1.2.0" -gradle-retrolambda = "me.tatarka:gradle-retrolambda:3.7.1" groovy-test = "org.codehaus.groovy:groovy-test:3.0.24" gson = "com.google.code.gson:gson:2.13.2" j-ogg-vorbis = "com.github.stephengold:j-ogg-vorbis:1.0.6" diff --git a/jme3-core/src/main/java/com/jme3/shader/bufferobject/layout/BufferLayout.java b/jme3-core/src/main/java/com/jme3/shader/bufferobject/layout/BufferLayout.java index 84b0b9ed24..265aa8f563 100644 --- a/jme3-core/src/main/java/com/jme3/shader/bufferobject/layout/BufferLayout.java +++ b/jme3-core/src/main/java/com/jme3/shader/bufferobject/layout/BufferLayout.java @@ -36,7 +36,7 @@ import java.util.List; import com.jme3.math.FastMath; -import com.jme3.util.functional.Function; +import java.util.function.Predicate; /** * Layout serializer for buffers @@ -46,7 +46,7 @@ public abstract class BufferLayout { public static abstract class ObjectSerializer { - private Function filter; + private Predicate filter; public ObjectSerializer(Class cls) { this(obj -> { @@ -56,12 +56,12 @@ public ObjectSerializer(Class cls) { } - public ObjectSerializer(Function filter) { + public ObjectSerializer(Predicate filter) { this.filter = filter; } public final boolean canSerialize(Object obj) { - return filter.eval(obj); + return filter.test(obj); } public abstract int length(BufferLayout layout, T obj); diff --git a/jme3-core/src/main/java/com/jme3/util/functional/Function.java b/jme3-core/src/main/java/com/jme3/util/functional/Function.java deleted file mode 100644 index c4948072e3..0000000000 --- a/jme3-core/src/main/java/com/jme3/util/functional/Function.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2009-2024 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.util.functional; - -public interface Function { - R eval(T t); -} \ No newline at end of file diff --git a/jme3-core/src/main/java/com/jme3/util/functional/NoArgFunction.java b/jme3-core/src/main/java/com/jme3/util/functional/NoArgFunction.java deleted file mode 100644 index 63dec2f682..0000000000 --- a/jme3-core/src/main/java/com/jme3/util/functional/NoArgFunction.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2009-2024 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.util.functional; - -public interface NoArgFunction { - R eval(); -} diff --git a/jme3-core/src/main/java/com/jme3/util/functional/NoArgVoidFunction.java b/jme3-core/src/main/java/com/jme3/util/functional/NoArgVoidFunction.java deleted file mode 100644 index 42dd416908..0000000000 --- a/jme3-core/src/main/java/com/jme3/util/functional/NoArgVoidFunction.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2009-2024 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.util.functional; - -public interface NoArgVoidFunction { - void eval(); -} diff --git a/jme3-core/src/main/java/com/jme3/util/functional/VoidFunction.java b/jme3-core/src/main/java/com/jme3/util/functional/VoidFunction.java deleted file mode 100644 index ccafb2e5c8..0000000000 --- a/jme3-core/src/main/java/com/jme3/util/functional/VoidFunction.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2009-2024 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.util.functional; - -public interface VoidFunction { - void eval(T t); -}