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

null != NullObject when using Categories

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.4, 2.4.0-rc-2, 2.4.1, 2.4.4, 2.5.0-beta-1
    • 2.4.6
    • None
    • None

    Description

      def val = null
      
      class Helper {
        
        static boolean isNull(value) {
          value == null 
        }
        
      }
      
      use(Helper){
        assert val == null
        assert val.isNull()
      }
      

      The last assertion fails because value isnt null but a NullObject and inside the isNull method, those are apparently not equal.

      Attachments

        Issue Links

          Activity

            People

              shils Shil Sinha
              jkemnade Jochen Kemnade
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: