This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new a06214355 Fix test failures on Java 28 and later
a06214355 is described below

commit a062143553e890bacae915a176248b56c5517995
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Nov 19 06:49:01 2026 -0500

    Fix test failures on Java 28 and later
    
    Add a Maven profile activated on JDK [28,) that sets
    -Djdk.reflect.allowNonSerializableConstruction=true for
    Mockito/Objenesis.
    Preserve JaCoCo support and the existing --add-opens argument.
    
    Assisted-By: OpenAI Codex
---
 pom.xml                 | 18 ++++++++++++++++++
 src/changes/changes.xml |  1 +
 2 files changed, 19 insertions(+)

diff --git a/pom.xml b/pom.xml
index 814e18f72..2ea2de560 100644
--- a/pom.xml
+++ b/pom.xml
@@ -648,6 +648,24 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>java28</id>
+      <activation>
+        <jdk>[28,)</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <!-- For Mockito/Objenesis on Java 28 and later. -->
+              <argLine>@{argLine} --add-opens java.base/java.lang=ALL-UNNAMED 
-Djdk.reflect.allowNonSerializableConstruction=true</argLine>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
     <profile>
       <id>java8</id>
       <activation>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ce4c85b19..16a92f640 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -75,6 +75,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Naveed Khan, Gary Gregory">Fix 
FtpProviderUserDirTest on Java 8 on Ubuntu (#779).</action>
       <action type="fix" dev="ggregory" due-to="Naveed Khan, Gary Gregory">Fix 
UrlFileObject when Java 8's KeepAliveStream reuse causes IOException: Stream 
closed.</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Fix HTTP random 
reads when range requests are ignored.</action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">Fix 
Mockito/Objenesis test failures on Java 28 and later by enabling 
jdk.reflect.allowNonSerializableConstruction in a Maven profile.</action>
       <!-- ADD -->
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add 
org.apache.commons.vfs2.provider.ftp.FTPClientWrapper.sendOptions(String, 
String).</action>
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add 
FtpFileSystemConfigBuilder.getControlEncodingCharset(FileSystemOptions) and 
deprecate getControlEncoding(FileSystemOptions).</action>

Reply via email to