postfix template: EA-59129 - IOE: PsiJavaParserFacadeImpl.createExpressionFromText

This commit is contained in:
Andrey Starovoyt
2014-08-05 16:55:44 +04:00
parent 2551535a57
commit 2b128bf30d
4 changed files with 16 additions and 1 deletions
@@ -136,7 +136,7 @@ public abstract class JavaPostfixTemplatesUtils {
@Contract("null -> false")
public static boolean isNotPrimitiveTypeExpression(@Nullable PsiExpression expression) {
return expression != null && !(expression.getType() instanceof PsiPrimitiveType);
return expression != null && expression.getType() != null && !(expression.getType() instanceof PsiPrimitiveType);
}
@Contract("null -> false")
@@ -0,0 +1,5 @@
public class Foo {
void m(Object o) {
!.null<caret>
}
}
@@ -0,0 +1,5 @@
public class Foo {
void m(Object o) {
!.null <caret>
}
}
@@ -38,4 +38,9 @@ public class NullPostfixTemplateTest extends PostfixTemplateTestCase {
public void testSecondStatement() {
doTest();
}
public void testSingleExclamationIgnored() {
doTest();
}
}