inline method/constant: warn when method is used in javadoc (IDEA-72562); add search in comments and strings/for text occurrences options

This commit is contained in:
Anna Kozlova
2012-06-05 18:09:49 +04:00
parent 4639086c04
commit 0b59d19a7c
9 changed files with 263 additions and 56 deletions
@@ -0,0 +1,7 @@
/**
* {@link InlineMethodTest#foo}
*/
class InlineMethodTest {
public void f<caret>oo(){}
}
@@ -6,6 +6,7 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiReference;
import com.intellij.psi.PsiReferenceExpression;
import com.intellij.refactoring.BaseRefactoringProcessor;
import com.intellij.refactoring.LightRefactoringTestCase;
import com.intellij.refactoring.MockInlineMethodOptions;
import com.intellij.refactoring.util.InlineUtil;
@@ -174,7 +175,17 @@ public class InlineMethodTest extends LightRefactoringTestCase {
public void testInlineAnonymousClassWithPrivateMethodInside() throws Exception {
doTest();
}
public void testMethodUsedInJavadoc() throws Exception {
try {
doTest();
fail("Conflict was not detected");
}
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
assertEquals("Inlined method is used in javadoc", e.getMessage());
}
}
public void testInlineRunnableRun() throws Exception {
@NonNls String fileName = "/refactoring/inlineMethod/" + getTestName(false) + ".java";
configureByFile(fileName);