Skip to content

Commit

Permalink
Bumps Spotbugs to version 4.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Jan 20, 2025
1 parent 6763182 commit 5be3f52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.lang.reflect.InaccessibleObjectException;
import java.util.function.Function;

import nl.jqno.equalsverifier.internal.SuppressFBWarnings;
import nl.jqno.equalsverifier.internal.exceptions.EqualsVerifierInternalBugException;
import nl.jqno.equalsverifier.internal.exceptions.ModuleException;
import nl.jqno.equalsverifier.internal.exceptions.ReflectionException;
Expand Down Expand Up @@ -30,6 +31,9 @@ public final class Rethrow {
/** Do not instantiate. */
private Rethrow() {}

@SuppressFBWarnings(
value = "THROWS_METHOD_THROWS_RUNTIMEEXCEPTION",
justification = "Some exceptions can't be handled and must be re-thrown")
public static <T> T rethrow(ThrowingSupplier<T> supplier, Function<Throwable, String> errorMessage) {
try {
return supplier.get();
Expand Down Expand Up @@ -66,11 +70,17 @@ public static void rethrow(ThrowingRunnable block) {
}

@FunctionalInterface
@SuppressFBWarnings(
value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION",
justification = "In order to be able to handle checked exceptions, we must declare them in this interface.")
public interface ThrowingSupplier<T> {
T get() throws Exception;
}

@FunctionalInterface
@SuppressFBWarnings(
value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION",
justification = "In order to be able to handle checked exceptions, we must declare them in this interface.")
public interface ThrowingRunnable {
void run() throws Exception;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<version.pitest.junit5>1.2.1</version.pitest.junit5>
<version.pitest.maven>1.17.4</version.pitest.maven>
<version.spotbugs.maven>4.8.6.6</version.spotbugs.maven>
<version.spotbugs>4.8.6</version.spotbugs>
<version.spotbugs>4.9.0</version.spotbugs>
<version.spotless>2.44.2</version.spotless>
</properties>

Expand Down

0 comments on commit 5be3f52

Please sign in to comment.