This commit is contained in:
Anna Kozlova
2014-12-29 21:15:11 +01:00
parent 5df9bad050
commit 430a85ace8
3 changed files with 16 additions and 0 deletions
@@ -159,6 +159,9 @@ public class TitleCapitalizationInspection extends BaseJavaLocalInspectionTool {
if (arg instanceof PsiMethodCallExpression) {
PsiMethod psiMethod = ((PsiMethodCallExpression)arg).resolveMethod();
PsiExpression returnValue = PropertyUtil.getGetterReturnExpression(psiMethod);
if (arg == returnValue) {
return null;
}
if (returnValue != null) {
return getTitleValue(returnValue);
}
@@ -0,0 +1,8 @@
import org.jetbrains.annotations.Nls;
class RecursiveMethod {
@Nls(capitalization = Nls.Capitalization.Title)
public String getName() {
return getName();
}
}
@@ -37,6 +37,11 @@ public class CapitalizationInspectionTest extends LightCodeInsightFixtureTestCas
doTest();
}
public void testRecursiveMethod() throws Exception {
myFixture.testHighlighting(getTestName(false) + ".java");
assertEmpty(myFixture.filterAvailableIntentions("Properly capitalize"));
}
public void doTest() {
myFixture.testHighlighting(getTestName(false) + ".java");
final IntentionAction action = myFixture.filterAvailableIntentions("Properly capitalize").get(0);