This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
new abee1eaf35 Revert "Upgrade from Java 11 to Java 12" because some users
still need Java 11. This is a partial revert of commit
b05e8580ae821a42c5e0c836b74b6649c9acc841.
abee1eaf35 is described below
commit abee1eaf35de7de48aa12d475070d7a256d41f44
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Mon Nov 2 19:32:01 2026 +0100
Revert "Upgrade from Java 11 to Java 12" because some users still need Java
11.
This is a partial revert of commit b05e8580ae821a42c5e0c836b74b6649c9acc841.
---
README.md | 2 +-
endorsed/build.gradle.kts | 2 +-
.../sis/storage/internal/InputStreamAdapter.java | 2 +-
.../main/org/apache/sis/pending/jdk/JDK12.java | 37 ++++++++++++++++++++++
.../main/org/apache/sis/util/Classes.java | 3 +-
optional/README.md | 2 +-
optional/src/org.apache.sis.gui/bundle/README | 2 +-
parent/overview.html | 2 +-
parent/pom.xml | 4 +--
9 files changed, 47 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 4b85c5ce08..c1df4f7f39 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ project logo are trademarks of The Apache Software Foundation.
## Build from sources
-Running the library part of Apache SIS requires Java 12 or higher.
+Running the library part of Apache SIS requires Java 11 or higher.
Running the JavaFX application part requires Java 22 or higher.
Building SIS requires Java 22 or higher
together with [Gradle](https://gradle.org/) 8 build system.
diff --git a/endorsed/build.gradle.kts b/endorsed/build.gradle.kts
index 2785080913..d2d53a4cd9 100644
--- a/endorsed/build.gradle.kts
+++ b/endorsed/build.gradle.kts
@@ -101,7 +101,7 @@ dependencies {
var srcDir = file("src") // Must be the same as the hard-coded
value in `BuildHelper.java`.
tasks.compileJava {
dependsOn(":geoapi:rebuild")
- options.release.set(12) // The version of both Java source code
and compiled byte code.
+ options.release.set(11) // The version of both Java source code
and compiled byte code.
}
tasks.compileTestJava {
options.compilerArgs.add("-source") // "source", not "release",
because we accept any target version.
diff --git
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/internal/InputStreamAdapter.java
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/internal/InputStreamAdapter.java
index ad4fb6189d..bff6009366 100644
---
a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/internal/InputStreamAdapter.java
+++
b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/internal/InputStreamAdapter.java
@@ -169,7 +169,7 @@ public final class InputStreamAdapter extends InputStream
implements Markable {
* @param count number of bytes to skip.
* @throws IOException if an I/O error occurs.
*/
- @Override
+// @Override // Pending JDK12.
public void skipNBytes(final long count) throws IOException {
input.seek(Math.addExact(input.getStreamPosition(), count));
}
diff --git
a/endorsed/src/org.apache.sis.util/main/org/apache/sis/pending/jdk/JDK12.java
b/endorsed/src/org.apache.sis.util/main/org/apache/sis/pending/jdk/JDK12.java
new file mode 100644
index 0000000000..cbf795b43d
--- /dev/null
+++
b/endorsed/src/org.apache.sis.util/main/org/apache/sis/pending/jdk/JDK12.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.pending.jdk;
+
+import java.lang.reflect.Array;
+
+
+/**
+ * Place holder for some functionalities defined in a JDK more recent than
Java 11.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ */
+public final class JDK12 {
+ /**
+ * Do not allow instantiation of this class.
+ */
+ private JDK12() {
+ }
+
+ public static Class<?> arrayType(final Class<?> c) {
+ return Array.newInstance(c, 0).getClass();
+ }
+}
diff --git
a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Classes.java
b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Classes.java
index 97885ca378..d772cb2d83 100644
--- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Classes.java
+++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Classes.java
@@ -34,6 +34,7 @@ import java.lang.reflect.GenericDeclaration;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Modifier;
import org.opengis.annotation.UML;
+import org.apache.sis.pending.jdk.JDK12;
/**
@@ -115,7 +116,7 @@ public final class Classes {
do element = element.getComponentType();
while (element!=null && ++change != 0);
} else if (element != Void.TYPE) {
- do element = element.arrayType();
+ do element = JDK12.arrayType(element);
while (--change != 0);
}
}
diff --git a/optional/README.md b/optional/README.md
index a28046e530..32cccd5bf5 100644
--- a/optional/README.md
+++ b/optional/README.md
@@ -8,7 +8,7 @@ If those dependencies are not provided, Apache SIS
[endorsed](../endorsed)
modules will still work but without Graphical User Interface (GUI).
GDAL is temporarily provided as an optional module despite its permissive
license
-because it requires Java 22, while the main Apache SIS modules target Java 12.
+because it requires Java 22, while the main Apache SIS modules target Java 11.
## Configuration
diff --git a/optional/src/org.apache.sis.gui/bundle/README
b/optional/src/org.apache.sis.gui/bundle/README
index b088dbb0c1..a5fc2aab27 100644
--- a/optional/src/org.apache.sis.gui/bundle/README
+++ b/optional/src/org.apache.sis.gui/bundle/README
@@ -14,7 +14,7 @@ Installation
============
For developing applications using the SIS library or for using on command-line,
-the only requirement is Java 12 or later, except the GDAL module which requires
+the only requirement is Java 11 or later, except the GDAL module which requires
Java 22. For launching the desktop application, requirements are Java 22 or
later
and JavaFX 24 or later.
diff --git a/parent/overview.html b/parent/overview.html
index 495ed4c0c7..f4201c443f 100644
--- a/parent/overview.html
+++ b/parent/overview.html
@@ -28,7 +28,7 @@
Overview of <a href="http://sis.apache.org">Apache SIS™ (Spatial
Information System)</a>.
<h1>Requirements</h1>
- <p>Apache <abbr>SIS</abbr> requires Java 12 Standard Edition.</p>
+ <p>Apache <abbr>SIS</abbr> requires Java 11 Standard Edition.</p>
<h1>Classes naming</h1>
<p>Implementations of <a href="http://www.geoapi.org/">GeoAPI
interfaces</a> usually (but not always)
diff --git a/parent/pom.xml b/parent/pom.xml
index f8cab48455..21483755aa 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -425,8 +425,8 @@
=================================================================== -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.compiler.source>12</maven.compiler.source>
- <maven.compiler.target>12</maven.compiler.target>
+ <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.target>11</maven.compiler.target>
</properties>
</project>