mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inline empty method
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user