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

(2/1).equals(2) is false; but (2/1) == (2) is true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • syntax
    • None
    • Linux, Ubuntu 18.04

    Description

      Is it an expected behavior??

      Difference between '==' and 'equals()' observed....

       

      {{adithyan@adithyan:~$ groovy -e 'println( (2/1).equals(2) )' }}
      false
      adithyan@adithyan:~$ groovy -e 'println( (2/1) == (2) )'         
      true

      {{adithyan@adithyan:~$ groovy -v }}
      Groovy Version: 2.4.15 JVM: 1.8.0_144 Vendor: Oracle Corporation OS: Linux

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            adithyank Adithyan K
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: