Skip to content

Commit 2bc010a

Browse files
committed
svm: ignore Thread.getId deprecation for JDK 19
1 parent 2f133e4 commit 2bc010a

File tree

7 files changed

+9
-1
lines changed

7 files changed

+9
-1
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/VMInspection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ protected void operate() {
132132
log.flush();
133133
}
134134

135+
@SuppressWarnings("deprecation")
135136
private static void dumpStack(Log log, IsolateThread vmThread) {
136137
Thread javaThread = PlatformThreads.fromVMThread(vmThread);
137138
if (javaThread != null) {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/JfrThreadRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void registerThread(Thread thread) {
9696
}
9797

9898
@Uninterruptible(reason = "Epoch must not change while in this method.")
99+
@SuppressWarnings("deprecation")
99100
private void registerThread0(Thread thread) {
100101
assert SubstrateJVM.isRecording();
101102
JfrThreadEpochData epochData = getEpochData(false);

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/SubstrateJVM.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public long getStackTraceId(int skipCount) {
255255
}
256256

257257
/** See {@link JVM#getThreadId}. */
258+
@SuppressWarnings("deprecation")
258259
public static long getThreadId(Thread thread) {
259260
if (HasJfrSupport.get()) {
260261
return thread.getId();

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public void afterAnalysis(AfterAnalysisAccess access) {
130130
JavaThreads.threadInitNumber.set(maxAutonumber);
131131
}
132132

133+
@SuppressWarnings("deprecation")
133134
static long threadId(Thread thread) {
134135
return thread == PlatformThreads.singleton().mainThread ? 1 : thread.getId();
135136
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ protected PlatformThreads() {
170170
mainGroupThreadsArray[0] = mainThread;
171171
}
172172

173+
@SuppressWarnings("deprecation")
173174
@Uninterruptible(reason = "Thread locks/holds the THREAD_MUTEX.")
174175
public static long getThreadAllocatedBytes(long javaThreadId) {
175176
// Accessing the value for the current thread is fast.
@@ -195,6 +196,7 @@ public static long getThreadAllocatedBytes(long javaThreadId) {
195196
}
196197
}
197198

199+
@SuppressWarnings("deprecation")
198200
@Uninterruptible(reason = "Thread locks/holds the THREAD_MUTEX.")
199201
public static void getThreadAllocatedBytes(long[] javaThreadIds, long[] result) {
200202
VMThreads.lockThreadMutexInNativeCode();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ public Thread.State getState() {
566566
}
567567
}
568568

569+
@SuppressWarnings("deprecation")
569570
@Override
570571
public String toString() {
571572
StringBuilder sb = new StringBuilder("VirtualThread[#");
@@ -601,6 +602,7 @@ public String toString() {
601602
}
602603

603604
@Override
605+
@SuppressWarnings("deprecation")
604606
public int hashCode() {
605607
return (int) getId();
606608
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private Target_java_lang_Thread(String name, int characteristics) {
330330
this.contextClassLoader = Thread.currentThread().getContextClassLoader();
331331
}
332332

333-
@SuppressWarnings("hiding")
333+
@SuppressWarnings({"hiding", "deprecation"})
334334
@Substitute
335335
private void start0() {
336336
if (!SubstrateOptions.MultiThreaded.getValue()) {

0 commit comments

Comments
 (0)