mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-181667 Always true assert is reported when expression is parenthesised
This commit is contained in:
+1
-1
@@ -706,7 +706,7 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
|
||||
}
|
||||
|
||||
private static boolean isAssertionEffectively(PsiElement psiAnchor, boolean evaluatesToTrue) {
|
||||
PsiElement parent = psiAnchor.getParent();
|
||||
PsiElement parent = PsiUtil.skipParenthesizedExprUp(psiAnchor.getParent());
|
||||
if (parent instanceof PsiAssertStatement) {
|
||||
return evaluatesToTrue;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,10 @@ class Test {
|
||||
assert foo != null;
|
||||
}
|
||||
|
||||
private static void testParens(@NotNull Object foo) {
|
||||
assert (foo != null);
|
||||
}
|
||||
|
||||
private static void test2(@NotNull Object foo) {
|
||||
if (foo == null) {
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
Reference in New Issue
Block a user