mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 21:44:49 +07:00
change signature: move declarations out of try/catch block (IDEA-169213)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
int <caret>foo() throws IllegalArgumentException { return 1;}
|
||||
|
||||
void fooBar() throws IllegalArgumentException{
|
||||
int a = foo();
|
||||
System.out.println(a);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
int foo() throws Exception { return 1;}
|
||||
|
||||
void fooBar() throws IllegalArgumentException{
|
||||
int a = 0;
|
||||
try {
|
||||
a = foo();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println(a);
|
||||
}
|
||||
}
|
||||
@@ -328,6 +328,15 @@ public class ChangeSignatureTest extends ChangeSignatureBaseTest {
|
||||
);
|
||||
}
|
||||
|
||||
public void testLessSpecificException() {
|
||||
doTest(null, null, null, new SimpleParameterGen(new ParameterInfoImpl[0]),
|
||||
method -> new ThrownExceptionInfo[]{
|
||||
new JavaThrownExceptionInfo(0, myFactory.createTypeByFQClassName("java.lang.Exception", method.getResolveScope()))
|
||||
},
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
public void testReorderWithVarargs() { // IDEADEV-26977
|
||||
doTest(null, new ParameterInfoImpl[]{
|
||||
new ParameterInfoImpl(1),
|
||||
|
||||
Reference in New Issue
Block a user