Skip to content

Commit

Permalink
8309196: Remove Thread.countStackFrames
Browse files Browse the repository at this point in the history
Reviewed-by: rriggs, mchung, dholmes, jpai, iris
  • Loading branch information
Alan Bateman committed Jun 8, 2023
1 parent bb96682 commit b2a5271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
16 changes: 0 additions & 16 deletions src/java.base/share/classes/java/lang/Thread.java
Expand Up @@ -2011,22 +2011,6 @@ public static int enumerate(Thread[] tarray) {
return currentThread().getThreadGroup().enumerate(tarray);
}

/**
* Throws {@code UnsupportedOperationException}.
*
* @return nothing
*
* @deprecated This method was originally designed to count the number of
* stack frames but the results were never well-defined and it
* depended on thread-suspension.
* This method is subject to removal in a future version of Java SE.
* @see StackWalker
*/
@Deprecated(since="1.2", forRemoval=true)
public int countStackFrames() {
throw new UnsupportedOperationException();
}

/**
* Waits at most {@code millis} milliseconds for this thread to terminate.
* A timeout of {@code 0} means to wait forever.
Expand Down
7 changes: 3 additions & 4 deletions test/jdk/java/lang/Thread/DegradedMethodsThrowUOE.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,7 +23,7 @@

/* @test
* @bug 8289610 8249627 8205132
* @summary Test that Thread stop/suspend/resume/countStackFrames throw UOE
* @summary Test that Thread stop/suspend/resume throw UOE
* @run junit DegradedMethodsThrowUOE
*/

Expand All @@ -45,8 +45,7 @@ static Stream<Consumer<Thread>> ops() {
return Stream.<Consumer<Thread>>of(
Thread::stop,
Thread::suspend,
Thread::resume,
Thread::countStackFrames
Thread::resume
);
}

Expand Down

1 comment on commit b2a5271

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.