Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-809

Encapsulate trival equal test into a method to avoid repeating over and over.....

    XMLWordPrintableJSON

Details

    Description

      In class EqualsBuilder, the documentation gives sample code on how to use EqualsBuilder. The proper usage of class EqualsBuilder is a bit long. My suggestion is to encapsulate the following trivial test into a method inside the class EqualsBuilder. You call it the new method trivalTest(Object obj1, Object obj2).

      // This is the code that should be put in a method to avoid repeating....
      if (obj == null)

      { return false; }

      if (obj == this)

      { return true; }

      if (obj.getClass() != getClass())

      { return false; }

      Attachments

        Activity

          People

            Unassigned Unassigned
            cp10000 Colbert Philippe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: