inline parameter: evaluate this expression (IDEA-40666)

This commit is contained in:
anna
2010-02-02 16:16:35 +03:00
parent a2242b8c42
commit 0cc203b176
8 changed files with 106 additions and 4 deletions
@@ -5,6 +5,7 @@ import com.intellij.codeInsight.TargetElementUtilBase;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
import com.intellij.psi.PsiElement;
import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.intellij.testFramework.LightCodeInsightTestCase;
import org.jetbrains.annotations.NonNls;
@@ -77,6 +78,22 @@ public class InlineParameterTest extends LightCodeInsightTestCase {
doTest(false);
}
public void testRefOuterThis() throws Exception {
try {
doTest(false);
}
catch (CommonRefactoringUtil.RefactoringErrorHintException e) {
assertEquals("Parameter initializer depends on values which are not available inside the method and cannot be inlined", e.getMessage());
}
}
public void testRefThis() throws Exception {
doTest(false);
}
public void testRefQualifiedThis() throws Exception {
doTest(false);
}
private void doTest(final boolean createLocal) throws Exception {
getProject().putUserData(InlineParameterExpressionProcessor.CREATE_LOCAL_FOR_TESTS,createLocal);