Skip to content

Commit 500e8cc

Browse files
authored
Update to ASM 9.3 to support Java 19 bytecode; use fork=true for all java tasks (security manager). This closes #204 (#205)
1 parent 89dd053 commit 500e8cc

File tree

7 files changed

+684
-8
lines changed

7 files changed

+684
-8
lines changed

build.xml

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<equals arg1="${-cleaned.specification.version}" arg2="16"/>
6767
<equals arg1="${-cleaned.specification.version}" arg2="17"/>
6868
<equals arg1="${-cleaned.specification.version}" arg2="18"/>
69+
<equals arg1="${-cleaned.specification.version}" arg2="19"/>
6970
</or>
7071
</condition>
7172

@@ -163,6 +164,7 @@
163164
<equals arg1="${build.java.runtime}" arg2="16"/>
164165
<equals arg1="${build.java.runtime}" arg2="17"/>
165166
<equals arg1="${build.java.runtime}" arg2="18"/>
167+
<equals arg1="${build.java.runtime}" arg2="19"/>
166168
</or>
167169
</condition>
168170

@@ -354,7 +356,7 @@
354356
<target name="-get-cli-help" depends="compile" unless="cli-help">
355357
<local name="-cli-help"/>
356358
<java classname="${cli-classname}" classpathref="path.main-run"
357-
failonerror="true" fork="false" outputproperty="-cli-help">
359+
failonerror="true" fork="true" outputproperty="-cli-help">
358360
<arg value="--help"/>
359361
</java>
360362
<!-- fix the line endings & command line (cannot be done in java task directly! -->
@@ -690,7 +692,7 @@
690692
<target name="generate-internal" depends="compile-tools" description="Generates internal API signature lists for current JDK">
691693
<mkdir dir="${signatures.dir}"/>
692694
<property name="internal.output.file" location="${signatures.dir}/jdk-internal-${build.java.runtime}.txt"/>
693-
<java classpathref="path.tools-run" classname="de.thetaphi.forbiddenapis.InternalApiGen" fork="false">
695+
<java classpathref="path.tools-run" classname="de.thetaphi.forbiddenapis.InternalApiGen" fork="true">
694696
<arg value="${build.java.runtime}"/>
695697
<arg file="${internal.output.file}"/>
696698
</java>

ivy.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<!DOCTYPE ivy-module [
1818
<!ENTITY maven.version "2.0">
1919
<!ENTITY gradle.version "3.4">
20-
<!ENTITY asm.version "9.2">
20+
<!ENTITY asm.version "9.3">
2121
<!ENTITY jarjar.asm.version "5.2">
2222
]>
2323
<ivy-module version="2.0">
@@ -52,7 +52,7 @@
5252
-->
5353
<dependency org="org.codehaus.plexus" name="plexus-utils" rev="1.1" conf="build,bundle"/>
5454
<dependency org="commons-cli" name="commons-cli" rev="1.3.1" conf="build,bundle"/>
55-
<dependency org="org.apache.ant" name="ant-antunit" rev="1.3" conf="test"/>
55+
<dependency org="org.apache.ant" name="ant-antunit" rev="1.4.1" conf="test"/>
5656
<dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="test"/>
5757
<dependency org="junit" name="junit" rev="4.12" conf="test"/>
5858
<dependency org="org.hamcrest" name="hamcrest-core" rev="1.3" conf="test"/>

src/main/docs/bundled-signatures.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ <h1>Bundled Signatures Documentation</h1>
2929
<li><strong><tt>jdk-unsafe-*</tt>:</strong> Signatures
3030
of &quot;unsafe&quot; methods that use default charset, default locale, or default timezone. For server applications it is very
3131
stupid to call those methods, as the results will definitely not what the user wants
32-
(for Java <tt>*</tt> = 1.7, 1.8, 9,..., 18; Ant / Maven / Gradle automatically add the compile Java version).</li>
32+
(for Java <tt>*</tt> = 1.7, 1.8, 9,..., 19; Ant / Maven / Gradle automatically add the compile Java version).</li>
3333

3434
<li><strong><tt>jdk-deprecated-*</tt>:</strong> This disallows all deprecated
35-
methods from the JDK (for Java <tt>*</tt> = 1.7, 1.8, 9,..., 18; Ant / Maven / Gradle automatically add the compile Java version).</li>
35+
methods from the JDK (for Java <tt>*</tt> = 1.7, 1.8, 9,..., 19; Ant / Maven / Gradle automatically add the compile Java version).</li>
3636

3737
<li><strong><tt>jdk-internal-*</tt>:</strong> Lists all internal packages of the JDK as of <code>Security.getProperty(&quot;package.access&quot;)</code>.
3838
Calling those methods will always trigger security manager and is completely forbidden from Java 9 on
39-
(for Java <tt>*</tt> = 1.7, 1.8, 9,..., 18; Ant / Maven / Gradle automatically add the compile Java version, <em>since forbiddenapis v2.1</em>).</li>
39+
(for Java <tt>*</tt> = 1.7, 1.8, 9,..., 19; Ant / Maven / Gradle automatically add the compile Java version, <em>since forbiddenapis v2.1</em>).</li>
4040

4141
<li><strong><tt>jdk-non-portable</tt>:</strong> Signatures of all non-portable (like <code>com.sun.management.HotSpotDiagnosticMXBean</code>)
4242
or internal runtime APIs (like <code>sun.misc.Unsafe</code>). This is a superset of <tt>jdk-internal</tt>.<br>

src/main/java/de/thetaphi/forbiddenapis/AsmUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private static byte[] readStream(final InputStream in) throws IOException {
179179
@SuppressWarnings("unused")
180180
public static ClassReader readAndPatchClass(InputStream in) throws IOException {
181181
final byte[] bytecode = readStream(in);
182-
if (false) patchClassMajorVersion(bytecode, Opcodes.V17 + 1, Opcodes.V17);
182+
if (false) patchClassMajorVersion(bytecode, Opcodes.V19 + 1, Opcodes.V19);
183183
return new ClassReader(bytecode);
184184
}
185185

0 commit comments

Comments
 (0)