mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[java-refactoring] IJPL-157516 T: InlineUtil.inlineVariable
GitOrigin-RevId: 89f3781736ca0f67437538878c26174286657973
This commit is contained in:
committed by
intellij-monorepo-bot
parent
be04e5725f
commit
e35d04820c
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user