mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Compare commits
1 Commits
v0.21.0
...
sschroever
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf80180103 |
@@ -23,6 +23,7 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import tech.picnic.errorprone.refaster.annotation.OnlineDocumentation;
|
||||
@@ -35,6 +36,18 @@ import tech.picnic.errorprone.refaster.annotation.OnlineDocumentation;
|
||||
final class AssortedRules {
|
||||
private AssortedRules() {}
|
||||
|
||||
final class IllegalStateExceptionSupplier {
|
||||
@BeforeTemplate
|
||||
Supplier<IllegalStateException> before(String message) {
|
||||
return () -> new IllegalStateException(message);
|
||||
}
|
||||
|
||||
@AfterTemplate
|
||||
Supplier<IllegalStateException> after(String message) {
|
||||
return () -> new IllegalStateException("XXX");
|
||||
}
|
||||
}
|
||||
|
||||
/** Prefer {@link Objects#checkIndex(int, int)} over the Guava alternative. */
|
||||
static final class CheckIndex {
|
||||
@BeforeTemplate
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.google.common.collect.Streams;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.stream.Stream;
|
||||
import reactor.core.publisher.Mono;
|
||||
import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase;
|
||||
|
||||
final class AssortedRulesTest implements RefasterRuleCollectionTestCase {
|
||||
@@ -28,6 +29,10 @@ final class AssortedRulesTest implements RefasterRuleCollectionTestCase {
|
||||
toImmutableSet());
|
||||
}
|
||||
|
||||
Mono<Void> testIllegalStateExceptionSupplier() {
|
||||
return Mono.error(() -> new IllegalStateException("ISE"));
|
||||
}
|
||||
|
||||
int testCheckIndex() {
|
||||
return Preconditions.checkElementIndex(0, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user