Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6142

IllegalAccessError. Closures inside of methods with dots

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.1.3, 2.3.11, 2.4.21, 2.5.16, 3.0.10, 4.0.2
    • None
    • class generator

    Description

      I have a Groovy JUnit test:

        @Test
        void 'challenge6. break xor key'(){
          List<Integer> possibleCipherLengths = []
          possibleCipherLengths.each {}
        }

      Notice a dot (.) in the name of test.
      Actual Result: It throws:

      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)

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ctapobep stanislav bashkirtsev
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: