diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-18 20:40:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-18 20:40:22 +0000 |
commit | 07d35c37ce79a64bdd905b394d40fc9bbb18fa60 (patch) | |
tree | e8787c45e494dfcc558faf0f75956f8785c39b94 /plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java | |
parent | e222a9e1e66670a56e926a6b0f3e10231eeeb1fb (diff) | |
parent | b5fb31ef6a38f19404859755dbd2e345215b97bf (diff) | |
download | idea-07d35c37ce79a64bdd905b394d40fc9bbb18fa60.tar.gz |
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java')
-rw-r--r-- | plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java index fc6d2580b3e9..242bec97a398 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2013 Bas Leijdekkers + * Copyright 2005-2014 Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -198,11 +198,8 @@ public class ExpressionUtils { } public static boolean isNullLiteral(@Nullable PsiExpression expression) { - if (!(expression instanceof PsiLiteralExpression)) { - return false; - } - final String text = expression.getText(); - return PsiKeyword.NULL.equals(text); + expression = ParenthesesUtils.stripParentheses(expression); + return expression != null && PsiType.NULL.equals(expression.getType()); } public static boolean isZero(@Nullable PsiExpression expression) { |