Skip to content

Commit 82ae99b

Browse files
committed
tweak for jdk24+
1 parent be6a0d7 commit 82ae99b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/test/groovy/org/codehaus/groovy/reflection/SecurityTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
public class SecurityTest extends GroovyTestCase {
3737

38+
private final boolean skip = Runtime.version().feature() >= 24;
39+
3840
@SuppressWarnings("unused")
3941
public class TestClass{
4042
public String publicField;
@@ -84,6 +86,7 @@ public boolean isMethodCalled() {
8486

8587
@SuppressWarnings("removal") // TODO in a future Groovy version remove reference to SecurityManager & AccessControlException
8688
public void setUp() {
89+
if (skip) return;
8790
// Forbidding suppressAccessChecks in the test will make the internal implementation of some JDK fail,
8891
// so load vm plugin before security manager is installed:
8992
/*
@@ -114,6 +117,7 @@ public void checkPermission(Permission perm) {
114117

115118
@SuppressWarnings("removal") // TODO in a future Groovy version remove reference to SecurityManager, for now not run for JDK18+
116119
public void tearDown(){
120+
if (skip) return;
117121
System.setSecurityManager(null);
118122
}
119123

0 commit comments

Comments
 (0)