Skip to content

Commit f441547

Browse files
authored
Merge pull request #14341 from keithc-ca/loadlibrary30
(0.30.0) Change signatures in JDK17
2 parents 985570d + 5ac9e6c commit f441547

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

runtime/j9vm/exports.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# Copyright (c) 2019, 2021 IBM Corp. and others
2+
# Copyright (c) 2019, 2022 IBM Corp. and others
33
#
44
# This program and the accompanying materials are made available under
55
# the terms of the Eclipse Public License 2.0 which accompanies this
@@ -290,7 +290,7 @@ jvm_add_exports(jvm
290290
JVM_BeforeHalt
291291
)
292292

293-
if(JAVA_SPEC_VERSION LESS 18)
293+
if(JAVA_SPEC_VERSION LESS 17)
294294
jvm_add_exports(jvm _JVM_LoadLibrary@4)
295295
else()
296296
jvm_add_exports(jvm _JVM_LoadLibrary@8)

runtime/j9vm/j9vmnatives.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Copyright (c) 2007, 2021 IBM Corp. and others
2+
Copyright (c) 2007, 2022 IBM Corp. and others
33
44
This program and the accompanying materials are made available under
55
the terms of the Eclipse Public License 2.0 which accompanies this
@@ -99,10 +99,10 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
9999
<export name="_JVM_LatestUserDefinedLoader@4" />
100100
<export name="_JVM_Listen@8" />
101101
<export name="_JVM_LoadLibrary@4">
102-
<exclude-if condition="spec.java18"/>
102+
<exclude-if condition="spec.java17"/>
103103
</export>
104104
<export name="_JVM_LoadLibrary@8">
105-
<include-if condition="spec.java18"/>
105+
<include-if condition="spec.java17"/>
106106
</export>
107107
<export name="_JVM_LoadSystemLibrary@4" />
108108
<export name="_JVM_Lseek@16" />

runtime/j9vm/jvm.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2002, 2021 IBM Corp. and others
2+
* Copyright (c) 2002, 2022 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -3627,10 +3627,10 @@ JVM_LoadSystemLibrary(const char *libName)
36273627
}
36283628

36293629
/**
3630-
* Prior to jdk18:
3630+
* Prior to jdk17:
36313631
* void * JNICALL JVM_LoadLibrary(char *libName)
36323632
*
3633-
* Beginning in jdk18:
3633+
* Beginning in jdk17:
36343634
* void * JNICALL JVM_LoadLibrary(char *libName, jboolean throwOnFailure)
36353635
*
36363636
* Attempts to load the shared library specified by libName.
@@ -3649,11 +3649,11 @@ JVM_LoadSystemLibrary(const char *libName)
36493649
* It is only invoked by jdk.internal.loader.BootLoader.loadLibrary().
36503650
*/
36513651
void * JNICALL
3652-
#if JAVA_SPEC_VERSION < 18
3652+
#if JAVA_SPEC_VERSION < 17
36533653
JVM_LoadLibrary(const char *libName)
3654-
#else /* JAVA_SPEC_VERSION < 18 */
3654+
#else /* JAVA_SPEC_VERSION < 17 */
36553655
JVM_LoadLibrary(const char *libName, jboolean throwOnFailure)
3656-
#endif /* JAVA_SPEC_VERSION < 18 */
3656+
#endif /* JAVA_SPEC_VERSION < 17 */
36573657
{
36583658
void *result = NULL;
36593659
J9JavaVM *javaVM = (J9JavaVM *)BFUjavaVM;
@@ -3698,7 +3698,7 @@ JVM_LoadLibrary(const char *libName, jboolean throwOnFailure)
36983698
}
36993699
#endif /* defined(WIN32) */
37003700

3701-
#if JAVA_SPEC_VERSION >= 18
3701+
#if JAVA_SPEC_VERSION >= 17
37023702
if ((NULL == result) && throwOnFailure) {
37033703
JNIEnv *env = NULL;
37043704
JavaVM *vm = (JavaVM *)javaVM;
@@ -3710,7 +3710,7 @@ JVM_LoadLibrary(const char *libName, jboolean throwOnFailure)
37103710
throwNewUnsatisfiedLinkError(env, errMsg);
37113711
}
37123712
}
3713-
#endif /* JAVA_SPEC_VERSION >= 18 */
3713+
#endif /* JAVA_SPEC_VERSION >= 17 */
37143714

37153715
Trc_SC_LoadLibrary_Exit(result);
37163716

runtime/redirector/forwarders.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dnl Copyright (c) 2001, 2021 IBM Corp. and others
1+
dnl Copyright (c) 2001, 2022 IBM Corp. and others
22
dnl
33
dnl This program and the accompanying materials are made available under
44
dnl the terms of the Eclipse Public License 2.0 which accompanies this
@@ -85,7 +85,7 @@ _X(JVM_InvokeMethod,JNICALL,true,jobject,JNIEnv *env, jobject method, jobject ob
8585
_X(JVM_IsNaN,JNICALL,true,jboolean,jdouble dbl)
8686
_X(JVM_LatestUserDefinedLoader,JNICALL,true,jobject,JNIEnv *env)
8787
_X(JVM_Listen,JNICALL,true,jint,jint descriptor, jint count)
88-
_IF([JAVA_SPEC_VERSION < 18],
88+
_IF([JAVA_SPEC_VERSION < 17],
8989
_X(JVM_LoadLibrary,JNICALL,true,void *,const char *libName),
9090
_X(JVM_LoadLibrary,JNICALL,true,void *,const char *libName, jboolean throwOnFailure))
9191
_X(JVM_Lseek,JNICALL,true,jlong,jint descriptor, jlong bytesToSeek, jint origin)

runtime/vm/jnimisc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2012, 2021 IBM Corp. and others
2+
* Copyright (c) 2012, 2022 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -177,7 +177,7 @@ getCurrentClassLoader(J9VMThread *currentThread)
177177
* is the current native method, use the class loader of "impl.fromClass".
178178
* This nativeMethod can't be cached cause HCR might make it invalid.
179179
*
180-
* Note that in jdk18, the signature of that method changed to
180+
* Note that in jdk17, the signature of that method changed to
181181
* NativeLibraries.load(NativeLibraryImpl impl, String name, boolean isBuiltin, boolean isJNI, boolean throwOnFailure)
182182
*/
183183
if (J9VMJDKINTERNALLOADERNATIVELIBRARIES_LOAD_METHOD(currentThread->javaVM) == nativeMethod) {

0 commit comments

Comments
 (0)