inline parameter: make it public; allow to inline refs to the same non final fields; allow to inline different constants with the same value (IDEA-40700)

This commit is contained in:
anna
2010-02-02 16:16:35 +03:00
parent 0cc203b176
commit 41b97a4f75
8 changed files with 132 additions and 10 deletions
@@ -95,6 +95,32 @@ public class InlineParameterTest extends LightCodeInsightTestCase {
doTest(false);
}
public void testRefSameNonFinalField() throws Exception {
doTest(false);
}
public void testRefSameNonFinalFieldOtherObject() throws Exception {
try {
doTest(false);
}
catch (CommonRefactoringUtil.RefactoringErrorHintException e) {
assertEquals("Cannot find constant initializer for parameter", e.getMessage());
}
}
public void testRef2ConstantsWithTheSameValue() throws Exception {
doTest(false);
}
public void testRefConstantAndField() throws Exception {
try {
doTest(false);
}
catch (CommonRefactoringUtil.RefactoringErrorHintException e) {
assertEquals("Cannot find constant initializer for parameter", e.getMessage());
}
}
private void doTest(final boolean createLocal) throws Exception {
getProject().putUserData(InlineParameterExpressionProcessor.CREATE_LOCAL_FOR_TESTS,createLocal);