Skip to content

Commit

Permalink
wrap new FrameworkMethod with doPrivileged.
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss committed Mar 4, 2024
1 parent 8964347 commit 79b9931
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,12 @@ public void evaluate() throws Throwable {
*/
@SuppressWarnings("deprecation")
private Statement wrapMethodRules(Statement s, TestCandidate c, Object instance) {
FrameworkMethod fm = new FrameworkMethod(c.method);
FrameworkMethod fm = AccessController.doPrivileged(new PrivilegedAction<FrameworkMethod>() {
@Override
public FrameworkMethod run() {
return new FrameworkMethod(c.method);
}
});

// Old-style MethodRules first.
List<org.junit.rules.MethodRule> methodRules =
Expand Down

0 comments on commit 79b9931

Please sign in to comment.