diff options
author | Gary Gregory <garydgregory@gmail.com> | 2022-03-21 10:36:56 -0400 |
---|---|---|
committer | Gary Gregory <garydgregory@gmail.com> | 2022-03-21 10:36:56 -0400 |
commit | a9f9ba4fba7f009f0714331e3f7ddc47fc99254d (patch) | |
tree | 1ef943ea70f38c92d59ed3a2a8d6ec1c575f9465 /src/main/java/org/apache/commons/lang3/time | |
parent | 318cc6ec4d38f90d5a6d6a28d45217e41fe37cfb (diff) | |
download | apache-commons-lang-a9f9ba4fba7f009f0714331e3f7ddc47fc99254d.tar.gz |
Bump SpotBugs to the current versions of Maven Plugin and underlying
tool.
- TODO Can any of these be done without breaking binary compatibility?
EI_EXPOSE_REP, EI_EXPOSE_REP2, MS_EXPOSE_REP,
REFLF_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_FIELD.
- Equals and hashcode do not match up.
Diffstat (limited to 'src/main/java/org/apache/commons/lang3/time')
-rw-r--r-- | src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java b/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java index 12045adc2..63b7b19dd 100644 --- a/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java +++ b/src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java @@ -17,6 +17,7 @@ package org.apache.commons.lang3.time; import java.util.Date; +import java.util.Objects; import java.util.TimeZone; /** @@ -59,11 +60,15 @@ class GmtTimeZone extends TimeZone { } @Override - public boolean equals(final Object other) { - if (!(other instanceof GmtTimeZone)) { + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof GmtTimeZone)) { return false; } - return zoneId == ((GmtTimeZone) other).zoneId; + GmtTimeZone other = (GmtTimeZone) obj; + return offset == other.offset && Objects.equals(zoneId, other.zoneId); } @Override @@ -83,7 +88,7 @@ class GmtTimeZone extends TimeZone { @Override public int hashCode() { - return offset; + return Objects.hash(offset, zoneId); } @Override |