inline empty method

This commit is contained in:
Anna.Kozlova
2017-12-11 20:06:06 +01:00
parent 7aafb0eacb
commit 58f55c31c0
4 changed files with 16 additions and 1 deletions
@@ -652,7 +652,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
PsiElement firstBodyElement = blockData.block.getFirstBodyElement();
if (firstBodyElement instanceof PsiWhiteSpace) firstBodyElement = PsiTreeUtil.skipWhitespacesForward(firstBodyElement);
PsiElement firstAdded = null;
if (firstBodyElement != null) {
if (firstBodyElement != null && firstBodyElement != blockData.block.getRBrace()) {
int last = statements.length - 1;
/*PsiElement first = statements[0];
PsiElement last = statements[statements.length - 1];*/
@@ -0,0 +1,6 @@
class Test {
{
<caret>a();
}
void a() {}
}
@@ -0,0 +1,5 @@
class Test {
{
}
void a() {}
}
@@ -259,6 +259,10 @@ public class InlineMethodTest extends LightRefactoringTestCase {
doTestInlineThisOnly();
}
public void testSkipEmptyMethod() {
doTestInlineThisOnly();
}
public void testOneLineLambdaVoidCompatibleToBlock() {
doTestInlineThisOnly();
}