mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 14:12:11 +00:00
Added minor enhancement to equals implementation.
This commit is contained in:
1 parent
f89ac62795
commit
0bfbe68afd
2 files changed
+6
-2
No files matched your search
+3
-1
@@ -89,7 +89,9 @@ public abstract class AbstractTimePoint implements TimePoint {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof TimePoint) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
} else if (obj instanceof TimePoint) {
|
||||
return compareTo((TimePoint) obj) == 0;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
+3
-1
@@ -88,7 +88,9 @@ public class MillisecondsDurationImpl implements Duration {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Duration) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
} else if (obj instanceof Duration) {
|
||||
return compareTo((Duration) obj) == 0;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user