Skip to content

Commit

Permalink
Result: remove type reification in instanceof
Browse files Browse the repository at this point in the history
This was added in JDK 16, we want to support earlier JDKs.
  • Loading branch information
msgilligan committed Sep 2, 2024
1 parent b868fc3 commit 28112bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions secp-api/src/main/java/org/bitcoinj/secp/api/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ default T get() {
return get("Error");
}
default T get(String message) {
if (this instanceof Ok<T>) {
if (this instanceof Ok) {
return ((Ok<T>) this).result();
} else if (this instanceof Err<T>) {
} else if (this instanceof Err) {
throw new IllegalStateException(message + ": " + ((Err<T>)this).code());
} else {
throw new IllegalStateException("Can't get here");
Expand Down

0 comments on commit 28112bf

Please sign in to comment.