Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4266

CLONE -Wrong generation of import statements in stubs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.3
    • 4.0.0
    • None
    • Windows XP, Sun JDK 1.6.0_19
    • Patch

    Description

      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,

      import my.package.Type1
      import my.package.Type2
      

      becomes

      import my.package.*;
      

      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.

      Attachments

        Activity

          People

            emilles Eric Milles
            rnd Dmytro Rud
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m