From ddb4f2b7e618c01711623d60913fae25d6bd999d Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Tue, 7 Mar 2017 13:57:43 +0700 Subject: [PATCH] StreamToLoopInspection: resolveReferencedClass used (IDEA-CR-18746) --- .../codeInspection/streamToLoop/StreamToLoopInspection.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInspection/streamToLoop/StreamToLoopInspection.java b/java/java-impl/src/com/intellij/codeInspection/streamToLoop/StreamToLoopInspection.java index f6645b4b39a6..b0caf994c3b8 100644 --- a/java/java-impl/src/com/intellij/codeInspection/streamToLoop/StreamToLoopInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/streamToLoop/StreamToLoopInspection.java @@ -182,9 +182,8 @@ public class StreamToLoopInspection extends BaseJavaBatchLocalInspectionTool { return false; } if(elementType instanceof PsiImmediateClassType) { - PsiType typeFromText = - JavaPsiFacade.getElementFactory(context.getProject()).createTypeFromText(elementType.getCanonicalText(), context); - if(!(typeFromText instanceof PsiClassType) || ((PsiClassType)typeFromText).resolve() == null) { + PsiResolveHelper helper = PsiResolveHelper.SERVICE.getInstance(context.getProject()); + if (helper.resolveReferencedClass(elementType.getCanonicalText(), context) == null) { return false; } }