[
https://issues.apache.org/jira/browse/GROOVY-6142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles closed GROOVY-6142.
-------------------------------
Resolution: Duplicate
> IllegalAccessError. Closures inside of methods with dots
> --------------------------------------------------------
>
> Key: GROOVY-6142
> URL: https://issues.apache.org/jira/browse/GROOVY-6142
> Project: Groovy
> Issue Type: Improvement
> Components: class generator
> Affects Versions: 2.1.3, 2.3.11, 2.4.21, 2.5.16, 3.0.10, 4.0.2
> Reporter: stanislav bashkirtsev
> Priority: Major
> Labels: ClassFormatError
>
> I have a Groovy JUnit test:
> {code:Java} @Test
> void 'challenge6. break xor key'(){
> List<Integer> possibleCipherLengths = []
> possibleCipherLengths.each {}
> }{code}Notice a dot (.) in the name of test.
> *Actual Result*: It throws:
> {code}java.lang.IllegalAccessError: tried to access class
> bases.ChallengeTest$_challenge6._break_xor_key_closure5 from class
> bases.ChallengeTest
> at bases.ChallengeTest.challenge6. break xor
> key(ChallengeTest.groovy:88){code}If I remove the dot, then it's fine.
> *Expected Result*: if this is not allowed, the error should state what was
> wrong. If this syntax should be allowed (I don't see reasons why not), then
> no error should appear ;)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)