convert anonym to inner: ignore used type params as they would be propagated anyway (IDEA-87171)

This commit is contained in:
Anna Kozlova
2012-06-09 21:31:06 +04:00
parent d5ff749c94
commit 685e33675c
5 changed files with 52 additions and 1 deletions
@@ -37,6 +37,22 @@ public class AnonymousToInnerTest extends LightCodeInsightTestCase {
public void testInsideInterface() throws Exception { // IDEADEV-29446
doTest("MyRunnable", true);
}
public void testCanBeStatic() throws Exception {
configureByFile(TEST_ROOT + getTestName(true) + ".java");
AnonymousToInnerHandler handler = new AnonymousToInnerHandler(){
@Override
protected boolean showRefactoringDialog() {
myNewClassName = "MyPredicate";
myMakeStatic = !needsThis();
return true;
}
};
handler.invoke(getProject(), myEditor, myFile, null);
assertFalse(handler.needsThis());
checkResultByFile(TEST_ROOT + getTestName(true) + "_after.java");
}
private void doTest(final String newClassName, final boolean makeStatic) throws Exception {
configureByFile(TEST_ROOT + getTestName(true) + ".java");