void (@NotNull PsiThisExpression thisExpression) { super.visitThisExpression(thisExpression); final PsiJavaCodeReferenceElement qualifier = thisExpression.getQualifier(); PsiElement containingClass; if (qualifier != null) { containingClass = qualifier.resolve(); } else { containingClass = PsiTreeUtil.getParentOfType(myMethodCall, PsiClass.class); } final PsiClass methodContainingClass = myMethod.getContainingClass(); LOG.assertTrue(methodContainingClass != null); if (!PsiTreeUtil.isAncestor(containingClass, methodContainingClass, false)) { myConflicts.putValue(thisExpression, JavaRefactoringBundle.message("inline.parameter.depends.on.unavailable.element.inside.method", "this")); } else if (myMethod.hasModifierProperty(PsiModifier.STATIC)) { myConflicts.putValue(thisExpression, JavaRefactoringBundle.message("inline.parameter.depends.on.this.inside.static.method")); } }