Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5016

Do Not Check 'other' For Null in Equals

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.13.0
    • 0.14.0
    • Java - Compiler
    • None

    Description

        @Override
        public boolean equals(java.lang.Object that) {
          if (that == null)
            return false;
          if (that instanceof CrossPlatformResource)
            return this.equals((CrossPlatformResource)that);
          return false;
        }
      

      There is a null check before instanceof. This check is superfluous:

      https://stackoverflow.com/questions/2950319/is-null-check-needed-before-calling-instanceof

      Attachments

        Issue Links

          Activity

            People

              belugabehr David Mollitor
              belugabehr David Mollitor
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m