Skip to content

Commit f89bb66

Browse files
committed
make non-indy test more lenient (both non and indy cases)
1 parent 4b4a464 commit f89bb66

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/org/codehaus/groovy/transform/ImmutableTransformTest.groovy

+3-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ final class ImmutableTransformTest {
109109

110110
@Test
111111
void testCloneableFieldNotCloneableObject() {
112-
// attempting to access the protected clone() method is illegal from JDK16
113-
def expectedException = isAtLeastJdk('16.0') ? IllegalAccessException : CloneNotSupportedException
112+
// non-indy bytecode attempts to access the protected clone() method which is illegal from JDK16
113+
def indy = System.getProperty('groovy.target.indy')
114+
def expectedException = isAtLeastJdk('16.0') && !indy ? IllegalAccessException : CloneNotSupportedException
114115
shouldFail expectedException, '''
115116
import groovy.transform.*
116117
class Dolly {

0 commit comments

Comments
 (0)