Skip to content

Commit

Permalink
Fix build for JDK 18 >= EA b21 (#1249)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Godin committed Nov 17, 2021
1 parent 70d5b98 commit 024de66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -152,7 +152,7 @@
<au:assertFileExists file="${exec.file}"/>
<au:assertLogContains text="Target executed"/>

<java classname="org.jacoco.ant.DumpExecClassNames" classpath="${java.class.path}" failonerror="true">
<java classname="org.jacoco.ant.DumpExecClassNames" fork="true" classpath="${java.class.path}" failonerror="true">
<arg value="${exec.file}" />
</java>
<au:assertLogContains text="java/sql/Timestamp"/>
Expand Down
4 changes: 2 additions & 2 deletions org.jacoco.ant.test/src/org/jacoco/ant/ReportTaskTest.xml
Expand Up @@ -71,7 +71,7 @@
</target>

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

<target name="testReportWithSourceDirButNoDebug">
<java classname="org.jacoco.ant.RemoveDebugInfos" classpath="${java.class.path}" failonerror="true">
<java classname="org.jacoco.ant.RemoveDebugInfos" fork="true" classpath="${java.class.path}" failonerror="true">
<arg value="${org.jacoco.ant.reportTaskTest.classes.dir}/org/jacoco/ant/TestTarget.class" />
<arg value="${temp.dir}/TestTarget.class" />
</java>
Expand Down

0 comments on commit 024de66

Please sign in to comment.