]> source.dussan.org Git - poi.git/commitdiff
Fix detecting Java <= 8 vs. >= 9 to not detect Java 8 for version-string "11.x"
authorDominik Stadler <centic@apache.org>
Sat, 2 Mar 2019 09:18:15 +0000 (09:18 +0000)
committerDominik Stadler <centic@apache.org>
Sat, 2 Mar 2019 09:18:15 +0000 (09:18 +0000)
Add system property to junit to disable optimization in jaxb which causes illegal access in Java 9+
Add argument to junit to display all illegal accesses in Java 9+

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1854629 13f79535-47bb-0310-9956-ffa450edef68

build.xml

index cfbfce31547d93b7effab4ec5ca5981ef716394d..be64de87bcfc7ca47567eb1ccf737ee3150e608e 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -66,12 +66,12 @@ under the License.
 
     <!-- add addOpens parameter for Java 9 and higher -->
     <condition property="addOpens">
-        <not><matches pattern="1\..*" string="${java.version}"/></not>
+        <not><matches pattern="^1\..*" string="${java.version}"/></not>
     </condition>
 
     <!-- add addOpens parameter for Java 10 -->
     <condition property="addOpens10">
-        <matches pattern="10\..*" string="${java.version}"/>
+        <matches pattern="^10\..*" string="${java.version}"/>
     </condition>
 
 
@@ -1242,11 +1242,14 @@ under the License.
                     <jvmarg value="-Xmx@{heap}M"/>
                     <jvmarg value="-ea"/>
 
-                    <!-- some "add-opens" and other properties are needed when running with Java 9 or newer -->
+                    <!-- some "add-opens" are needed for Java 10, but not for 11+ -->
                     <jvmarg value="--add-modules=java.xml.bind" if:true="${addOpens10}" />
                     <jvmarg value="--add-opens=java.base/java.lang=java.xml.bind" if:true="${addOpens10}" />
 
-                    <jvmarg value="-Dsun.reflect.debugModuleAccessChecks=true" if:true="${addOpens}" />
+                    <!-- some "add-opens" and other properties are needed when running with Java 9 or newer -->
+                    <sysproperty key="sun.reflect.debugModuleAccessChecks" value="true" if:true="${addOpens}" />
+                    <sysproperty key="com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize" value="true" if:true="${addOpens}" />
+                    <jvmarg value="--illegal-access=warn" if:true="${addOpens}" />
                     <jvmarg value="--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED" if:true="${addOpens}" />
                     <jvmarg value="--add-opens=java.base/java.io=ALL-UNNAMED" if:true="${addOpens}" />
                     <jvmarg value="--add-opens=java.base/java.nio=ALL-UNNAMED" if:true="${addOpens}" />