[java-refactoring] IJPL-157516 T: InlineUtil.inlineVariable

GitOrigin-RevId: 89f3781736ca0f67437538878c26174286657973
This commit is contained in:
Tagir Valeev
2024-06-28 15:53:19 +02:00
committed by intellij-monorepo-bot
parent be04e5725f
commit e35d04820c
4 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
class X {
void use() {
AutoCloseable r = () -> {};
<caret>test(r);
}
void test(AutoCloseable ref) {
try(ref) {
System.out.println(ref);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@@ -0,0 +1,13 @@
class X {
void use() {
AutoCloseable r = () -> {};
AutoCloseable ref = r;
try(ref) {
System.out.println(ref);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@@ -49,6 +49,8 @@ public class InlineMethodTest extends LightRefactoringTestCase {
}
public void testSideEffect() { doTest(); }
public void testParamAsAutocloseableRef() { doTest(); }
public void testInlineWithTry() { doTest(); }
public void testEmptyMethod() { doTest(); }