diff --git a/error-prone-contrib/pom.xml b/error-prone-contrib/pom.xml index 6cd4ee80116..b35abc27261 100644 --- a/error-prone-contrib/pom.xml +++ b/error-prone-contrib/pom.xml @@ -138,6 +138,11 @@ value-annotations test + + org.jspecify + jspecify + provided + org.junit.jupiter junit-jupiter-api diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplates.java index ef99623aa09..5384b9fbf70 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/RxJava2AdapterTemplates.java @@ -9,6 +9,7 @@ import io.reactivex.Maybe; import io.reactivex.Observable; import io.reactivex.Single; +import org.jspecify.nullness.Nullable; import reactor.adapter.rxjava.RxJava2Adapter; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -20,14 +21,14 @@ private RxJava2AdapterTemplates() {} /** Use the fluent API style when using {@link RxJava2Adapter#completableToMono}. */ static final class CompletableToMono { @BeforeTemplate - Mono before(Completable completable) { + Mono<@Nullable Void> before(Completable completable) { return Refaster.anyOf( RxJava2Adapter.completableToMono(completable), completable.to(RxJava2Adapter::completableToMono)); } @AfterTemplate - Mono after(Completable completable) { + Mono<@Nullable Void> after(Completable completable) { return completable.as(RxJava2Adapter::completableToMono); } } diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StringTemplates.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StringTemplates.java index 2b5c7894ff2..7b7707bfed6 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StringTemplates.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refastertemplates/StringTemplates.java @@ -130,7 +130,7 @@ String after(Object object) { */ // XXX: This template is analogous to `StringValueOf` above. Arguably this is its generalization. // If/when Refaster is extended to understand this, delete the template above. - static final class StringValueOfMethodReference { + static final class StringValueOfMethodReference { @BeforeTemplate Function before() { return Objects::toString; diff --git a/pom.xml b/pom.xml index a28469b6f80..7501b465b8f 100644 --- a/pom.xml +++ b/pom.xml @@ -378,6 +378,11 @@ value-annotations 2.9.2 + + org.jspecify + jspecify + 0.2.0 + org.junit junit-bom