diff --git a/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java index c7eed1812664..6bdb753c1bb9 100644 --- a/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java +++ b/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java @@ -321,9 +321,17 @@ public class PsiTypesUtil { } /** - * @param context in which type should be checked - * @return false if type is null or has no explicit canonical type representation (e. g. intersection type) + * Not compliant to specification, use {@link PsiTypesUtil#isDenotableType(PsiType, PsiElement)} instead */ + @Deprecated + public static boolean isDenotableType(@Nullable PsiType type) { + return !(type instanceof PsiWildcardType || type instanceof PsiCapturedWildcardType); + } + + /** + * @param context in which type should be checked + * @return false if type is null or has no explicit canonical type representation (e. g. intersection type) + */ public static boolean isDenotableType(@Nullable PsiType type, @NotNull PsiElement context) { if (type == null) return false; PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(context.getProject()); diff --git a/plugins/stream-debugger/src/com/intellij/debugger/streams/psi/impl/LambdaToAnonymousTransformer.kt b/plugins/stream-debugger/src/com/intellij/debugger/streams/psi/impl/LambdaToAnonymousTransformer.kt index 1a6ab6f450fc..c9d2b626b99a 100644 --- a/plugins/stream-debugger/src/com/intellij/debugger/streams/psi/impl/LambdaToAnonymousTransformer.kt +++ b/plugins/stream-debugger/src/com/intellij/debugger/streams/psi/impl/LambdaToAnonymousTransformer.kt @@ -161,9 +161,9 @@ object LambdaToAnonymousTransformer : PsiElementTransformer.Base() { val interfaceMethod = LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType) if (interfaceMethod != null) { val substitutor = LambdaUtil.getSubstitutor(interfaceMethod, PsiUtil.resolveGenericsClassInType(functionalInterfaceType)) - if (interfaceMethod.getSignature(substitutor).parameterTypes.any { !PsiTypesUtil.isDenotableType(it, lambdaExpression) }) return false + if (interfaceMethod.getSignature(substitutor).parameterTypes.any { !PsiTypesUtil.isDenotableType(it) }) return false val returnType = LambdaUtil.getFunctionalInterfaceReturnType(functionalInterfaceType) - return PsiTypesUtil.isDenotableType(returnType, lambdaExpression) + return PsiTypesUtil.isDenotableType(returnType) } }