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

groovysh: Import command is vulnerable and ugly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.0-beta-1
    • Groovysh
    • None

    Description

      to reproduce:

      groovy:000> import java.awt.TextField
      ===> [import java.awt.TextField]
      groovy:000> import java.awt.TextField;
      ===> [import java.awt.TextField, import java.awt.TextField;]

      should be just one time textfield

      groovy:000> import java.awt.TextField; println('foo')
      ===> [import java.awt.TextField; println('foo')]
      groovy:000> 2+2
      foo
      ===> 4

      should be prevented

      Also the output of the list of imports is unnecessarily verbose, the "import " prefix does not add information, it just takes away screen space. Ideally this would even reduce package names to one letter, but this is bothersome to parse, given the variants of the import command

      Attachments

        Activity

          People

            melix Cédric Champeau
            tkruse Thibault Kruse
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: