Skip to content

Commit d56e29b

Browse files
committed
GH-2733: Polishing
- fix `equals()` implementation issues.
1 parent f6c8a65 commit d56e29b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-integration-core/src/main/java/org/springframework/integration/support/management/micrometer/MicrometerMetricsCaptor.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public int hashCode() {
202202

203203
@Override
204204
public boolean equals(Object obj) {
205-
if (!MicroTimer.class.equals(obj.getClass())) {
205+
if (obj == null || !getClass().equals(obj.getClass())) {
206206
return false;
207207
}
208208
return this.timer.equals(((MicroTimer) obj).timer);
@@ -266,7 +266,7 @@ public int hashCode() {
266266

267267
@Override
268268
public boolean equals(Object obj) {
269-
if (!MicroCounter.class.equals(obj.getClass())) {
269+
if (obj == null || !getClass().equals(obj.getClass())) {
270270
return false;
271271
}
272272
return this.counter.equals(((MicroCounter) obj).counter);
@@ -325,7 +325,7 @@ public int hashCode() {
325325

326326
@Override
327327
public boolean equals(Object obj) {
328-
if (!MicroGauge.class.equals(obj.getClass())) {
328+
if (obj == null || !getClass().equals(obj.getClass())) {
329329
return false;
330330
}
331331
return this.gauge.equals(((MicroGauge) obj).gauge);

0 commit comments

Comments
 (0)