From ac63b7f156810011c0e500071cd2983d57cdb6b8 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 8 Nov 2024 05:49:00 -0800 Subject: [PATCH] [JENKINS-74814] `java.lang.UnsupportedOperationException`: This stack walker does not have `RETAIN_CLASS_REFERENCE` access (#9945) --- core/src/main/java/jenkins/util/SetContextClassLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/jenkins/util/SetContextClassLoader.java b/core/src/main/java/jenkins/util/SetContextClassLoader.java index c486fa4607e1..9e0a4c7dec30 100644 --- a/core/src/main/java/jenkins/util/SetContextClassLoader.java +++ b/core/src/main/java/jenkins/util/SetContextClassLoader.java @@ -62,7 +62,7 @@ public final class SetContextClassLoader implements AutoCloseable { * @since 2.362 */ public SetContextClassLoader() { - this(StackWalker.getInstance().getCallerClass()); + this(StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).getCallerClass()); } /**