file.accept(new PsiRecursiveElementVisitor() {
</BUG>
public void visitReferenceElement(PsiJavaCodeReferenceElement reference) {
super.visitReferenceElement(reference);
JavaResolveResult result = reference.advancedResolve(true);
<BUG>PsiElement resolved = result.getElement();
final ProblemDescriptor problemDescriptor = checkDeprecated(resolved, reference.getReferenceNameElement(), manager);
if (problemDescriptor != null){
problems.add(problemDescriptor);
}</BUG>
}

import java.util.List;
public class DeprecationInspection extends LocalInspectionTool {
@NonNls public static final String SHORT_NAME = "Deprecation";
public static final String DISPLAY_NAME = InspectionsBundle.message("inspection.deprecated.display.name");
@Nullable
public PsiElementVisitor buildVisitor(final ProblemsHolder holder, boolean isOnTheFly) {
return new PsiRecursiveElementVisitor(){
public void visitReferenceElement(PsiJavaCodeReferenceElement reference) {
super.visitReferenceElement(reference);
JavaResolveResult result = reference.advancedResolve(true);
PsiElement resolved = result.getElement();
checkDeprecated(resolved, reference.getReferenceNameElement(), holder);
}
