Skip to content

Commit

Permalink
JDK25 bring up
Browse files Browse the repository at this point in the history
Removed usages of
sun.reflect.misc.ReflectUtil.needsPackageAccessCheck/checkProxyPackageAccess.

Signed-off-by: Jason Feng <[email protected]>
  • Loading branch information
JasonFengJ9 committed Dec 10, 2024
1 parent db18829 commit 4f66f22
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
32 changes: 30 additions & 2 deletions jcl/jpp_configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
label="JAVA23"
outputpath="JAVA23/src"
dependencies="JAVA21"
jdkcompliance="22">
jdkcompliance="23">
<classpathentry kind="src" path="src/java.base/share/classes"/>
<classpathentry kind="src" path="src/java.management/share/classes"/>
<classpathentry kind="src" path="src/jdk.attach/share/classes"/>
Expand Down Expand Up @@ -217,7 +217,7 @@
label="JAVA24"
outputpath="JAVA24/src"
dependencies="JAVA23"
jdkcompliance="22">
jdkcompliance="23">
<classpathentry kind="src" path="src/java.base/share/classes"/>
<classpathentry kind="src" path="src/java.management/share/classes"/>
<classpathentry kind="src" path="src/jdk.attach/share/classes"/>
Expand All @@ -241,6 +241,34 @@
<parameter name="jxerules:outputdir" value="java/lang"/>
</configuration>

<configuration
label="JAVA25"
outputpath="JAVA25/src"
dependencies="JAVA24"
jdkcompliance="23">
<classpathentry kind="src" path="src/java.base/share/classes"/>
<classpathentry kind="src" path="src/java.management/share/classes"/>
<classpathentry kind="src" path="src/jdk.attach/share/classes"/>
<classpathentry kind="src" path="src/jdk.jcmd/share/classes"/>
<classpathentry kind="src" path="src/jdk.management/share/classes"/>
<classpathentry kind="src" path="src/openj9.criu/share/classes"/>
<classpathentry kind="src" path="src/openj9.cuda/share/classes"/>
<classpathentry kind="src" path="src/openj9.dataaccess/share/classes"/>
<classpathentry kind="src" path="src/openj9.dtfj/share/classes"/>
<classpathentry kind="src" path="src/openj9.dtfjview/share/classes"/>
<classpathentry kind="src" path="src/openj9.gpu/share/classes"/>
<classpathentry kind="src" path="src/openj9.jvm/share/classes"/>
<classpathentry kind="src" path="src/openj9.sharedclasses/share/classes"/>
<classpathentry kind="src" path="src/openj9.traceformat/share/classes"/>
<classpathentry kind="src" path="src/openj9.zosconditionhandling/share/classes"/>
<classpathentry kind="lib" path="/binaries/common/ibm/ibmjzos.jar"/>
<classpathentry kind="lib" path="/binaries/vm/third/rt-compressed.sunJava24.jar"/>
<source path="src"/>
<parameter name="macro:define" value="JAVA_SPEC_VERSION=25"/>
<parameter name="msg:outputdir" value="java.base/share/classes/com/ibm/oti/util"/>
<parameter name="jxerules:outputdir" value="java/lang"/>
</configuration>

<configuration
label="OPENJ9-RAWBUILD"
outputpath="OPENJ9-RAWBUILD/src"
Expand Down
2 changes: 2 additions & 0 deletions jcl/src/java.base/share/classes/java/lang/Class.java
Original file line number Diff line number Diff line change
Expand Up @@ -5913,6 +5913,7 @@ public Class<?>[] getPermittedSubclasses()
getUnsafe().putObjectRelease(this, localPermittedSubclassesCacheOffset, localPermittedSubclasses);
}

/*[IF JAVA_SPEC_VERSION < 24]*/
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (null != sm) {
Expand All @@ -5931,6 +5932,7 @@ public Class<?>[] getPermittedSubclasses()
sm.checkPackageAccess(pkgName);
}
}
/*[ENDIF] JAVA_SPEC_VERSION < 24 */

return localPermittedSubclasses;
}
Expand Down
4 changes: 3 additions & 1 deletion jcl/src/java.base/share/classes/java/lang/J9VMInternals.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ private static void threadCleanup(Thread thread) {
}

/*[PR CVMC 124584] checkPackageAccess(), not defineClassImpl(), should use ProtectionDomain */
private static void checkPackageAccess(final Class clazz, ProtectionDomain pd) {
private static void checkPackageAccess(final Class<?> clazz, ProtectionDomain pd) {
/*[IF JAVA_SPEC_VERSION < 24]*/
@SuppressWarnings("removal")
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
Expand All @@ -407,6 +408,7 @@ public Object run() {
}
}, new AccessControlContext(pdArray));
}
/*[ENDIF] JAVA_SPEC_VERSION < 24 */
}

/*[PR CMVC 104341] Exceptions in Object.finalize() not ignored */
Expand Down
2 changes: 1 addition & 1 deletion test/TestConfig/resources/excludes/latest_exclude_24.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################################################
# Copyright IBM Corp. and others 2024
# Copyright IBM Corp. and others 2023
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!--
Copyright IBM Corp. and others 2024
Copyright IBM Corp. and others 2023
This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down

0 comments on commit 4f66f22

Please sign in to comment.