Skip to content

Commit b2a5271

Browse files
author
Alan Bateman
committed
8309196: Remove Thread.countStackFrames
Reviewed-by: rriggs, mchung, dholmes, jpai, iris
1 parent bb96682 commit b2a5271

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

src/java.base/share/classes/java/lang/Thread.java

-16
Original file line numberDiff line numberDiff line change
@@ -2011,22 +2011,6 @@ public static int enumerate(Thread[] tarray) {
20112011
return currentThread().getThreadGroup().enumerate(tarray);
20122012
}
20132013

2014-
/**
2015-
* Throws {@code UnsupportedOperationException}.
2016-
*
2017-
* @return nothing
2018-
*
2019-
* @deprecated This method was originally designed to count the number of
2020-
* stack frames but the results were never well-defined and it
2021-
* depended on thread-suspension.
2022-
* This method is subject to removal in a future version of Java SE.
2023-
* @see StackWalker
2024-
*/
2025-
@Deprecated(since="1.2", forRemoval=true)
2026-
public int countStackFrames() {
2027-
throw new UnsupportedOperationException();
2028-
}
2029-
20302014
/**
20312015
* Waits at most {@code millis} milliseconds for this thread to terminate.
20322016
* A timeout of {@code 0} means to wait forever.

test/jdk/java/lang/Thread/DegradedMethodsThrowUOE.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323

2424
/* @test
2525
* @bug 8289610 8249627 8205132
26-
* @summary Test that Thread stop/suspend/resume/countStackFrames throw UOE
26+
* @summary Test that Thread stop/suspend/resume throw UOE
2727
* @run junit DegradedMethodsThrowUOE
2828
*/
2929

@@ -45,8 +45,7 @@ static Stream<Consumer<Thread>> ops() {
4545
return Stream.<Consumer<Thread>>of(
4646
Thread::stop,
4747
Thread::suspend,
48-
Thread::resume,
49-
Thread::countStackFrames
48+
Thread::resume
5049
);
5150
}
5251

0 commit comments

Comments
 (0)