You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/05/02 02:12:05 UTC
[jira] [Resolved] (GROOVY-4761) Incorrect source location for
method call expression
[ https://issues.apache.org/jira/browse/GROOVY-4761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-4761.
-------------------------------
Resolution: Fixed
Fix Version/s: (was: 3.0)
2.6.0-alpha-1
> Incorrect source location for method call expression
> ----------------------------------------------------
>
> Key: GROOVY-4761
> URL: https://issues.apache.org/jira/browse/GROOVY-4761
> Project: Groovy
> Issue Type: Bug
> Components: parser, parser-antlr
> Affects Versions: 1.8-rc-2
> Reporter: Andrew Eisenberg
> Assignee: Daniel Sun
> Fix For: 2.6.0-alpha-1
>
>
> In this class, the source location for the StaticMethodCallExpression is incorrect. The start column coincides with the column for '3' and the end includes the whitespace until the comment starts.
> {code}
> class StaticTrying {
>
> public static Class staticMethod(arg) {
>
> }
>
> def foo() {
> def a = staticMethod 3 // extra whitespace
> }
> }
> {code}
> I'm not too concerned about the invalid end column, but the start column problem is affecting Groovy-Eclipse.
> I delved a little bit into this. Here is when the situation happens:
> # when the method declaration takes 1 or more parameters
> # the method declaration can be either static or non-static
> # the method call takes exactly 1 argument
> # does not use parens
> # is part of a declaration expression.
> Because of parts 4 and 5, this problem can only occur on Groovy 1.8 because on 1.7 it would be a parsing error.
> I tracked this down to an invalid source location for the Antlr AST node being passed into {{AntlrParserPlugin.methodCallExpression()}}.
> I originally reported this bug in GRECLIPSE-1031.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)