Details
-
Type:
Task
-
Status: Closed
-
Priority:
Should
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Core 2.3.0
-
Component/s: None
-
Labels:None
Description
In few places in the code there is duplicated, not needed logic that does an object equality check treating objects as equal if both reference a null.
For example, Condition class' equals method does it few times:
if (onsetDate != null ? !onsetDate.equals(condition.onsetDate) : condition.onsetDate != null) { return false; }
Code like this can be replaced with the Objects#equals(Object a, Object b)
It's a small thing, but removing custom code and using something already available is a good practice. These checks are also error prone since detailed comparison is being made together with lots of negations.