File tree 1 file changed +5
-4
lines changed
core/src/main/java/org/kohsuke/stapler
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,15 @@ protected T computeValue(Class<?> type) {
45
45
public interface X {}
46
46
47
47
public final T get (ClassLoader cl ) {
48
+ Class <?> x ;
48
49
try {
49
- cl .loadClass (X .class .getName ());
50
- // OK, X is visible to cl, can use trick
51
- } catch (ClassNotFoundException x ) {
50
+ x = cl .loadClass (X .class .getName ());
51
+ // OK, X is visible to cl, can use trick; note that x != X.class when using PowerMock
52
+ } catch (ClassNotFoundException e ) {
52
53
// fallback, no caching; could use WeakHashMap though typically values would strongly hold keys so both could leak
53
54
return computeValue (cl );
54
55
}
55
- Class <?> type = Proxy .getProxyClass (cl , X . class );
56
+ Class <?> type = Proxy .getProxyClass (cl , x );
56
57
assert type .getClassLoader () == cl ;
57
58
return storage .get (type );
58
59
}
You can’t perform that action at this time.
0 commit comments