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

null.class inconsistent with null.getClass() [NullObject]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8-beta-3
    • 5.0.0-alpha-3
    • groovy-runtime
    • None

    Description

      Following the mailing list thread at http://groovy.markmail.org/message/hn6xu7btb6rjtfdb?q=%22Groovy+and+nulls%22, it is to suggest that we have the same semantics for following 2 versions for consistency sake:

      null.class
      

      and

      null.getClass()
      

      Currently the property access throws NPE and method acces gives the NullObject class.

      Attachments

        Activity

          People

            emilles Eric Milles
            roshandawrani Roshan Dawrani
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: