Skip to content

Commit c8cc5d5

Browse files
authored
Add support for Java 20 (#224)
1 parent 0267abf commit c8cc5d5

File tree

7 files changed

+692
-5
lines changed

7 files changed

+692
-5
lines changed

build.xml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<equals arg1="${-cleaned.specification.version}" arg2="17"/>
6868
<equals arg1="${-cleaned.specification.version}" arg2="18"/>
6969
<equals arg1="${-cleaned.specification.version}" arg2="19"/>
70+
<equals arg1="${-cleaned.specification.version}" arg2="20"/>
7071
</or>
7172
</condition>
7273

@@ -165,6 +166,7 @@
165166
<equals arg1="${build.java.runtime}" arg2="17"/>
166167
<equals arg1="${build.java.runtime}" arg2="18"/>
167168
<equals arg1="${build.java.runtime}" arg2="19"/>
169+
<!-- Java 20 for testing is no longer supported as Java 7 support was removed as compile target -->
168170
</or>
169171
</condition>
170172

ivy.xml

+1-1
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.4">
20+
<!ENTITY asm.version "9.5">
2121
<!ENTITY jarjar.asm.version "5.2">
2222
]>
2323
<ivy-module version="2.0">

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,..., 19; Ant / Maven / Gradle automatically add the compile Java version).</li>
32+
(for Java <tt>*</tt> = 1.7, 1.8, 9,..., 20; 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,..., 19; Ant / Maven / Gradle automatically add the compile Java version).</li>
35+
methods from the JDK (for Java <tt>*</tt> = 1.7, 1.8, 9,..., 20; 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,..., 19; 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,..., 20; 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
@@ -180,7 +180,7 @@ private static byte[] readStream(final InputStream in) throws IOException {
180180
@SuppressWarnings("unused")
181181
public static ClassReader readAndPatchClass(InputStream in) throws IOException {
182182
final byte[] bytecode = readStream(in);
183-
if (false) patchClassMajorVersion(bytecode, Opcodes.V19 + 1, Opcodes.V19);
183+
if (false) patchClassMajorVersion(bytecode, Opcodes.V21 + 1, Opcodes.V21);
184184
return new ClassReader(bytecode);
185185
}
186186

0 commit comments

Comments
 (0)