Skip to content

Commit

Permalink
Fix SpotBugs warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Dec 23, 2023
1 parent 9b8323c commit 4541eca
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.jenkins.plugins.util;

import java.io.Serializable;
import java.util.Objects;

import edu.hm.hafner.util.FilteredLog;

Expand Down Expand Up @@ -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;

Check warning on line 42 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java#L42

Added line #L42 was not covered by tests
}
if (o == null || getClass() != o.getClass()) {
return false;

Check warning on line 45 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java#L45

Added line #L45 was not covered by tests
}
if (!super.equals(o)) {
return false;

Check warning on line 48 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java#L48

Added line #L48 was not covered by tests
}

RemoteResultWrapper<?> that = (RemoteResultWrapper<?>) o;

Check warning on line 51 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java#L51

Added line #L51 was not covered by tests

return Objects.equals(result, that.result);

Check warning on line 53 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java#L53

Added line #L53 was not covered by tests
}

@Override
public int hashCode() {
int result1 = super.hashCode();

Check warning on line 58 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java#L58

Added line #L58 was not covered by tests
result1 = 31 * result1 + (result != null ? result.hashCode() : 0);
return result1;

Check warning on line 60 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 41-60 are not covered by tests

Check warning on line 60 in src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/io/jenkins/plugins/util/RemoteResultWrapper.java#L60

Added line #L60 was not covered by tests
}
}

0 comments on commit 4541eca

Please sign in to comment.