This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit a01d7fbdf42029003cdbcdd0804c4d1b49123c3f
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Mar 26 12:53:04 2020 +1000

    GROOVY-9440: Missing line number information in stack trace (provide 
fallback)
---
 src/main/java/org/codehaus/groovy/classgen/ReturnAdder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/ReturnAdder.java 
b/src/main/java/org/codehaus/groovy/classgen/ReturnAdder.java
index f8f3bf4..b206c16 100644
--- a/src/main/java/org/codehaus/groovy/classgen/ReturnAdder.java
+++ b/src/main/java/org/codehaus/groovy/classgen/ReturnAdder.java
@@ -114,7 +114,7 @@ public class ReturnAdder {
             Expression expression = ((ExpressionStatement) 
statement).getExpression();
             ReturnStatement returnStatement = new ReturnStatement(expression);
             returnStatement.copyStatementLabels(statement);
-            returnStatement.setSourcePosition(statement);
+            returnStatement.setSourcePosition(statement.getLineNumber() < 0 ? 
expression : statement);
             listener.returnStatementAdded(returnStatement);
             return returnStatement;
         }

Reply via email to