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 2022/02/03 22:36:00 UTC

[jira] [Closed] (GROOVY-4266) CLONE -Wrong generation of import statements in stubs

     [ https://issues.apache.org/jira/browse/GROOVY-4266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-4266.
-----------------------------

> CLONE -Wrong generation of import statements in stubs
> -----------------------------------------------------
>
>                 Key: GROOVY-4266
>                 URL: https://issues.apache.org/jira/browse/GROOVY-4266
>             Project: Groovy
>          Issue Type: Bug
>          Components: Stub generator / Joint compiler
>    Affects Versions: 1.7.3
>         Environment: Windows XP, Sun JDK 1.6.0_19
>            Reporter: Dmytro Rud
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> NOTE: Below is fixed, this issue is for tracking additional impots added at end of other imports, e.g. {{import java.io.*;}}
> ----
> Single-type import declarations in Groovy files are collected/converted into type-on-demand import declarations by the stub compiler -- in other words,
> {code}
> import my.package.Type1
> import my.package.Type2
> {code}
> becomes
> {code}
> import my.package.*;
> {code}
> This breaks the type shadowing mechanisms described in Section 7.5.1 of the Java Language Specification (3rd edition) and leads to Java compiler errors like "cannot decide which of the classes to use".
> Moreover, current implementations is based on an unordered set, thus destroying the order of import declarations.
> Attached patch solves these issues by preserving both the form and the order of original import declarations.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)