[java-inspections] LambdaUtil#isSafeLambdaReplacement: check whether functional interface type matches exactly

GitOrigin-RevId: 04b67615268182a09ce3a211547dc8213997eb58
This commit is contained in:
Tagir Valeev
2021-10-20 12:28:28 +07:00
committed by intellij-monorepo-bot
parent 5eb047fe70
commit 308d1fd0e6
11 changed files with 14 additions and 61 deletions

View File

@@ -5,7 +5,7 @@ import java.util.stream.Collectors;
class Test {
public static <T> List<TokenFilter<T>> fromString(final T src, Function<T, List<String>> extractor) {
final List<TokenFilter<T>> result = extractor.apply(src).stream().map((Function<String, TokenFilter<T>>) TokenFilter::new).collect(Collectors.toList());
final List<TokenFilter<T>> result = extractor.apply(src).stream().map(st -> new TokenFilter<T>(st)).collect(Collectors.toList());
return result;
}