Skip to content

Commit 024de66

Browse files
authored
Fix build for JDK 18 >= EA b21 (#1249)
Ant task `java` with parameter `fork="false"` calls `java.lang.System.setSecurityManager`, however tests should not call it, because as part of work on JEP 411 in JDK 17 it was marked as deprecated (see https://bugs.openjdk.java.net/browse/JDK-8264713) and in JDK 18 throws UnsupportedOperationException unless system property `java.security.manager` set to `allow` (see https://bugs.openjdk.java.net/browse/JDK-8270380).
1 parent 70d5b98 commit 024de66

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

org.jacoco.ant.test/src/org/jacoco/ant/CoverageTaskTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<au:assertFileExists file="${exec.file}"/>
153153
<au:assertLogContains text="Target executed"/>
154154

155-
<java classname="org.jacoco.ant.DumpExecClassNames" classpath="${java.class.path}" failonerror="true">
155+
<java classname="org.jacoco.ant.DumpExecClassNames" fork="true" classpath="${java.class.path}" failonerror="true">
156156
<arg value="${exec.file}" />
157157
</java>
158158
<au:assertLogContains text="java/sql/Timestamp"/>

org.jacoco.ant.test/src/org/jacoco/ant/ReportTaskTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</target>
7272

7373
<target name="testReportWithSourceButNoDebug">
74-
<java classname="org.jacoco.ant.RemoveDebugInfos" classpath="${java.class.path}" failonerror="true">
74+
<java classname="org.jacoco.ant.RemoveDebugInfos" fork="true" classpath="${java.class.path}" failonerror="true">
7575
<arg value="${org.jacoco.ant.reportTaskTest.classes.dir}/org/jacoco/ant/TestTarget.class" />
7676
<arg value="${temp.dir}/TestTarget.class" />
7777
</java>
@@ -89,7 +89,7 @@
8989
</target>
9090

9191
<target name="testReportWithSourceDirButNoDebug">
92-
<java classname="org.jacoco.ant.RemoveDebugInfos" classpath="${java.class.path}" failonerror="true">
92+
<java classname="org.jacoco.ant.RemoveDebugInfos" fork="true" classpath="${java.class.path}" failonerror="true">
9393
<arg value="${org.jacoco.ant.reportTaskTest.classes.dir}/org/jacoco/ant/TestTarget.class" />
9494
<arg value="${temp.dir}/TestTarget.class" />
9595
</java>

0 commit comments

Comments
 (0)