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

ImportCustomizer skips importing in certain scenarios

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      when upgrading Spring-Boot to Groovy 3.x (see https://github.com/spring-projects/spring-boot/issues/20119) I was noticing build failures around the importing behaviour.

      I've managed to extract a minimum example where this breaks:

      https://github.com/dreis2211/groovy3-import-bug

      It seems that ImportCustomizer is skipping imports when multiple classes (or more specifically ClassNodes) are in the same file and the imports are configured per class/ClassNode. Please see the above example for more information.

      This behaviour seems to have been introduced with GROOVY-8399 for performance reasons.

      When switching the example to 2.5.9, it works again.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              christoph.dreis Christoph Dreis
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: