Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FII_USE_FUNCTION_IDENTITY false-positive #469

Open
boris-petrov opened this issue Mar 1, 2024 · 2 comments
Open

FII_USE_FUNCTION_IDENTITY false-positive #469

boris-petrov opened this issue Mar 1, 2024 · 2 comments

Comments

@boris-petrov
Copy link

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.

@mebigfatguy
Copy link
Owner

can you cook up a small example?

@boris-petrov
Copy link
Author

boris-petrov commented Sep 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants