paulk-asert commented on a change in pull request #1173: GROOVY-9211: BUG! 
UNCAUGHT EXCEPTION on OpenJDK14-ea+8
URL: https://github.com/apache/groovy/pull/1173#discussion_r384170016
 
 

 ##########
 File path: src/test/groovy/lang/ScriptSourcePositionInAstTest.groovy
 ##########
 @@ -45,18 +46,24 @@ class ScriptSourcePositionInAstTest extends GroovyTestCase 
{
     }
 
     void testDoubleStatementScript() {
-        assert positionsForScript("""\
+        def raw = """\
             println 'hello'
             println 'bye'
-        """.stripIndent()) == [[1, 1], [2, 14]]
+        """
+        // avoid stripIndent issues on JDK13+ by calling Groovy's DGM 
stripIndent explicitly
+        def script = StringGroovyMethods.stripIndent((CharSequence)raw)
 
 Review comment:
   In Groovy 3, we added a `stripIndent(boolean)` method (GROOVY-9423). It 
doesn't make the problem go away but at least provides a workaround. It isn't 
part of GROOVY_2_5_X hence the need for the slightly hacky change here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to