Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4216

Equals method should not assume anything about the type of its argument

    XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      Bad practice - Equals method should not assume anything about the type of its argument

      Equals method for org.openmrs.util.DoubleRange assumes the argument is of type DoubleRange

      DoubleRange.java
      public boolean equals(Object o) {
      	DoubleRange other = (DoubleRange) o;
      	return low.equals(other.low) && high.equals(other.high);
      }
      

      https://ci-stg.openmrs.org/sonar/drilldown/issues/780?&rule=findbugs%3ABC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS&rule_sev=CRITICAL&severity=CRITICAL

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              dszafranek Damian Szafranek
              Reporter:
              preise Pawel Reise
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h