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

Compile in groovyConsole instantiates class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.2
    • 2.4.6
    • Groovy Console
    • None

    Description

      Probably not serious, but put this in groovyConsole and compile…

      class OtherThing {
          OtherThing() {
              def v = null
              v.hashCode()
          }
      }
      

      You'll get an NPE for the v.hashCode() line. If you add another statement before the class def (e.g. def c = null) it doesn't happen.

      Weird.

      Attachments

        Activity

          People

            pascalschumacher Pascal Schumacher
            ldaley Luke Daley
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: