Skip to content

Commit dd462af

Browse files
eamonnmcmanusGoogle Java Core Libraries
authored andcommitted
Remove @Beta from two methods in Throwables.
The methods, `getCausalChain` and `getCauseAs`, have existed for years. They work reliably and we are unlikely to change their APIs. The remaining two `@Beta` methods, `lazyStackTrace` and `lazyStackTraceIsLazy`, should probably be deprecated in a later step. The optimization they encapsulate no longer works on JDK versions ≥ 9 and has never worked on Android. Meanwhile, JDK 9 introduced the `StackWalker` API which does work and covers the most usual use case of `lazyStackTrace`. RELNOTES=The `Throwables` methods `getCausalChain` and `getCauseAs` were `@Beta` but are now fully supported. PiperOrigin-RevId: 422652352
1 parent 468c68a commit dd462af

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

android/guava/src/com/google/common/base/Throwables.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ public static Throwable getRootCause(Throwable throwable) {
290290
* @return an unmodifiable list containing the cause chain starting with {@code throwable}
291291
* @throws IllegalArgumentException if there is a loop in the causal chain
292292
*/
293-
@Beta // TODO(kevinb): decide best return type
294293
public static List<Throwable> getCausalChain(Throwable throwable) {
295294
checkNotNull(throwable);
296295
List<Throwable> causes = new ArrayList<>(4);
@@ -330,7 +329,6 @@ public static List<Throwable> getCausalChain(Throwable throwable) {
330329
* ClassCastException}'s cause is {@code throwable}.
331330
* @since 22.0
332331
*/
333-
@Beta
334332
@GwtIncompatible // Class.cast(Object)
335333
@CheckForNull
336334
public static <X extends Throwable> X getCauseAs(

guava/src/com/google/common/base/Throwables.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ public static Throwable getRootCause(Throwable throwable) {
290290
* @return an unmodifiable list containing the cause chain starting with {@code throwable}
291291
* @throws IllegalArgumentException if there is a loop in the causal chain
292292
*/
293-
@Beta // TODO(kevinb): decide best return type
294293
public static List<Throwable> getCausalChain(Throwable throwable) {
295294
checkNotNull(throwable);
296295
List<Throwable> causes = new ArrayList<>(4);
@@ -330,7 +329,6 @@ public static List<Throwable> getCausalChain(Throwable throwable) {
330329
* ClassCastException}'s cause is {@code throwable}.
331330
* @since 22.0
332331
*/
333-
@Beta
334332
@GwtIncompatible // Class.cast(Object)
335333
@CheckForNull
336334
public static <X extends Throwable> X getCauseAs(

0 commit comments

Comments
 (0)