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 2020/11/11 02:02:05 UTC
[jira] [Closed] (GROOVY-4620) Primitive type references have
invalid source locations
[ https://issues.apache.org/jira/browse/GROOVY-4620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-4620.
-----------------------------
> Primitive type references have invalid source locations
> -------------------------------------------------------
>
> Key: GROOVY-4620
> URL: https://issues.apache.org/jira/browse/GROOVY-4620
> Project: Groovy
> Issue Type: Bug
> Components: ast builder
> Affects Versions: 1.7.5
> Reporter: Andrew Eisenberg
> Priority: Major
>
> In GRECLIPSE-951, I noticed that all references to primitive types are using the same cached singleton. So in this code:
> {code}
> int x() {
> int z
> }
> {code}
> both references to {{int}} are represented in the AST by the same ClassNode object. This means that source locations for the {{int}} singleton ClassNode are always the last time it is used in the file.
> This is a problem for Groovy-Eclipse since we rely on source locations for searching and marking occurrences.
> It seems to me that the solution is to add a redirect to the primitive ClassNode and set its source location.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)