From b952d5617fe7c04fc9535318ccd89a1c306b6811 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Tue, 4 Oct 2016 12:02:52 +0200 Subject: [PATCH] inlay parameter names: detect builder pattern by return method type --- .../codeInsight/daemon/impl/ParameterNameHintsManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/ParameterNameHintsManager.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/ParameterNameHintsManager.java index accf64efdab0..ed494a786136 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/ParameterNameHintsManager.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/ParameterNameHintsManager.java @@ -94,11 +94,11 @@ public class ParameterNameHintsManager { if (expression instanceof PsiNewExpression) { return false; } - final PsiType callExpressionType = expression.getType(); + final PsiType returnType = method.getReturnType(); final PsiClass aClass = method.getContainingClass(); final String calledMethodFqn = aClass != null ? aClass.getQualifiedName() : null; - if (calledMethodFqn != null && callExpressionType != null) { - return callExpressionType.equalsToText(calledMethodFqn); + if (calledMethodFqn != null && returnType != null) { + return returnType.equalsToText(calledMethodFqn); } return false; }