fb-contrib
fb-contrib copied to clipboard
`FII_USE_FUNCTION_IDENTITY` false-positive
RxJava has its own concept of Function. And has functions that use it. We can't use java.util.Function.identity() there unfortunately. But fb-contrib gives a warning.
can you cook up a small example?
import java.util.concurrent.Callable;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Single;
public class Test {
public static <T> Observable<T> lazilyGetObservable(Callable<Observable<T>> callable) {
return Single
.fromCallable(callable)
.flatMapObservable(observable -> observable);
}
}
P.S. That needs the io.reactivex.rxjava3:rxjava:3.1.9 library.
dang it.