From dabfc82df2d501557536baeee80e646eba6e945f Mon Sep 17 00:00:00 2001 From: Andrey Starovoyt Date: Tue, 5 Aug 2014 20:18:40 +0400 Subject: [PATCH] postfix template: extract .getType() -> variable --- .../template/postfix/util/JavaPostfixTemplatesUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/template/postfix/util/JavaPostfixTemplatesUtils.java b/java/java-impl/src/com/intellij/codeInsight/template/postfix/util/JavaPostfixTemplatesUtils.java index bb05a0fbe5ca..2142c8fd33da 100644 --- a/java/java-impl/src/com/intellij/codeInsight/template/postfix/util/JavaPostfixTemplatesUtils.java +++ b/java/java-impl/src/com/intellij/codeInsight/template/postfix/util/JavaPostfixTemplatesUtils.java @@ -136,7 +136,11 @@ public abstract class JavaPostfixTemplatesUtils { @Contract("null -> false") public static boolean isNotPrimitiveTypeExpression(@Nullable PsiExpression expression) { - return expression != null && expression.getType() != null && !(expression.getType() instanceof PsiPrimitiveType); + if (expression == null) { + return false; + } + PsiType type = expression.getType(); + return type != null && !(type instanceof PsiPrimitiveType); } @Contract("null -> false")