Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Jan 7, 2025
1 parent 15e8e32 commit 84c042b
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/main/java/ch/ethz/seb/sebserver/gbl/util/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package ch.ethz.seb.sebserver.gbl.util;

import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
Expand Down Expand Up @@ -142,7 +143,7 @@ public T getOrThrow() {
if (this.error instanceof RuntimeException) {
throw (RuntimeException) this.error;
} else {
String cause = this.error.getMessage() != null ? this.error.getMessage() : this.error.toString();
final String cause = this.error.getMessage() != null ? this.error.getMessage() : this.error.toString();
throw new RuntimeException("RuntimeExceptionWrapper cause: " + cause, this.error);
}
}
Expand Down Expand Up @@ -381,20 +382,11 @@ public int hashCode() {
}

@Override
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Result<?> other = (Result<?>) obj;
if (this.value == null) {
if (other.value != null)
return false;
} else if (!this.value.equals(other.value))
return false;
return true;
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final Result<?> result = (Result<?>) o;
return Objects.equals(value, result.value) && Objects.equals(error, result.error);
}

@Override
Expand Down

0 comments on commit 84c042b

Please sign in to comment.