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

null != NullObject when using Categories

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.0-rc-2, 2.4.1, 2.4.4, 2.5.0-beta-1
    • Fix Version/s: 2.4.6
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: