ExpressionUtils#getTopLevelExpression; used in SurroundWithTryCatchFix

Fixes EA-131551 - NPE: EnsureCodeBlockImpl.splitIf
We need to avoid custom logic for processing && chains, etc. in RefactoringUtil#ensureCodeBlock.
This commit is contained in:
Tagir Valeev
2018-11-07 10:45:38 +07:00
parent 6caca4382a
commit 2c7124b0b0
4 changed files with 45 additions and 2 deletions
@@ -0,0 +1,13 @@
// "Surround with try/catch" "true"
class C {
native boolean foo() throws Exception;
void test() {
try {
if(foo() && foo())
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,9 @@
// "Surround with try/catch" "true"
class C {
native boolean foo() throws Exception;
void test() {
if(foo() && f<caret>oo())
}
}