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

Source location incorrect for statement after a label

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.4
    • 1.8.6, 2.0-beta-3
    • parser-antlr2
    • None

    Description

      Take this code and put it into the groovy console:

      def meth() {
        label:
          assert i == 9
      }
      

      Now inspect the AST and navigate to the assert statement. You will see that the assert statement has a lineNumber and lastLineNumber are 2, but it should be 3. This is incorrect. It doesn't seem like this affects Groovy itself too much, but this is causing an exception in Groovy-Eclipse. See GRECLIPSE-1270.

      The fix is simple enough.

      Attachments

        1. groovy5197.patch
          127 kB
          Paul King

        Activity

          People

            paulk Paul King
            werdna Andrew Eisenberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: