Skip to content

Commit 3313d41

Browse files
committed
Delete native methods from java.lang.Thread
'getStackTrace0' is only used in asyncGetStackTrace() which is deleted as well. Thread.getStackTrace() is replaced by PlatformThreads.getStackTrace(). So it's not reachable. 'getNextThreadIdOffset()' is only used in ThreadIdentifiers private class which is substituted in JDKs better than JDK 19 (which includes 21). So won't be reachable either. Fixes: #28 This is a partial backport of: "Introudce a mode to unconditionally include classes" oracle@369f0ff8 to address oracle#9672 Only take the java.lang.Thread native method deletions as that's sufficient to fix the issue reported in #28.
1 parent dcd9e5d commit 3313d41

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_Thread.java

+7
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,10 @@ private StackTraceElement[] getStackTrace() {
623623
return JavaThreads.getStackTrace(false, JavaThreads.fromTarget(this));
624624
}
625625

626+
@Delete
627+
@SuppressWarnings({"static-method"})
628+
private native Object getStackTrace0();
629+
626630
/** @see com.oracle.svm.core.jdk.StackTraceUtils#asyncGetStackTrace */
627631
@Delete
628632
@TargetElement(onlyWith = JDK19OrLater.class)
@@ -798,6 +802,9 @@ boolean isTerminated() {
798802
@Alias
799803
@TargetElement(onlyWith = JDK19OrLater.class)
800804
native long threadId();
805+
806+
@Delete
807+
static native long getNextThreadIdOffset();
801808
}
802809

803810
@TargetClass(value = Thread.class, innerClass = "Builder", onlyWith = JDK19OrLater.class)

0 commit comments

Comments
 (0)