diff --git a/hutool-core/src/main/java/cn/hutool/core/lang/func/LambdaFactory.java b/hutool-core/src/main/java/cn/hutool/core/lang/func/LambdaFactory.java index b5369995b..38401bc96 100644 --- a/hutool-core/src/main/java/cn/hutool/core/lang/func/LambdaFactory.java +++ b/hutool-core/src/main/java/cn/hutool/core/lang/func/LambdaFactory.java @@ -65,11 +65,11 @@ public class LambdaFactory { * @return 接受Lambda的函数式接口对象 * @param Function类型 */ + @SuppressWarnings("unchecked") public static F build(final Class functionInterfaceType, final Method method) { Assert.notNull(functionInterfaceType); Assert.notNull(method); final MutableEntry, Method> cacheKey = new MutableEntry<>(functionInterfaceType, method); - //noinspection unchecked return (F) CACHE.computeIfAbsent(cacheKey, key -> { final List abstractMethods = Arrays.stream(functionInterfaceType.getMethods()) .filter(m -> Modifier.isAbstract(m.getModifiers()))