Added minor enhancement to equals implementation.

This commit is contained in:
Jens Rommel committed 2014-09-01 15:13:52 +02:00
1 parent f89ac62795
commit 0bfbe68afd
2 files changed
+6 -2

No files matched your search

@@ -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;
@@ -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;