XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.11, 4.0.3
    • None
    • parser-antlr4
    • None

    Description

      For the following erroneous script (note opening triple quotes and closing single quote):

      new GroovyShell().parse('''class Foo {}')
      

      Parsing fails with this error:

      1 compilation error:
      Exception thrown
      java.lang.StringIndexOutOfBoundsException: index 0,length 0
      	at java.base/java.lang.String.checkIndex(String.java:3278)
      	at java.base/java.lang.String.codePointAt(String.java:723)
      	at org.apache.groovy.parser.antlr4.AstBuilder.validateExpressionListElement(AstBuilder.java:3225)
      	at org.apache.groovy.parser.antlr4.AstBuilder.visitExpressionListElement(AstBuilder.java:3204)
      	at org.apache.groovy.parser.antlr4.AstBuilder.visitEnhancedArgumentListElement(AstBuilder.java:2424)
      ...
      	at org.apache.groovy.parser.antlr4.AstBuilder.visitEnhancedArgumentListInPar(AstBuilder.java:2369)
      	at org.apache.groovy.parser.antlr4.AstBuilder.visitCommandExpression(AstBuilder.java:1878)     
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: