From 4541eca8fe1b45a3499ce7ce490fb7e265b6b3f3 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sat, 23 Dec 2023 10:37:28 +0100 Subject: [PATCH] Fix SpotBugs warnings. --- .../plugins/util/RemoteResultWrapper.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java b/src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java index 112cf6dc..e7f61f06 100644 --- a/src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java +++ b/src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java @@ -1,6 +1,7 @@ package io.jenkins.plugins.util; import java.io.Serializable; +import java.util.Objects; import edu.hm.hafner.util.FilteredLog; @@ -34,4 +35,28 @@ public RemoteResultWrapper(final T result, final String title) { public T getResult() { return result; } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + + RemoteResultWrapper that = (RemoteResultWrapper) o; + + return Objects.equals(result, that.result); + } + + @Override + public int hashCode() { + int result1 = super.hashCode(); + result1 = 31 * result1 + (result != null ? result.hashCode() : 0); + return result1; + } }