void (@NotNull PsiNameValuePair pair) { final PsiNameValuePair other = (PsiNameValuePair)myMatchingVisitor.getElement(); final MatchContext context = myMatchingVisitor.getMatchContext(); final PsiIdentifier nameIdentifier = pair.getNameIdentifier(); final boolean isTypedVar = context.getPattern().isTypedVar(nameIdentifier); if (nameIdentifier != null) context.pushResult(); final PsiIdentifier otherIdentifier = other.getNameIdentifier(); try { final PsiAnnotationMemberValue value1 = pair.getValue(); final PsiAnnotationMemberValue value2 = other.getValue(); if (myMatchingVisitor.setResult(myMatchingVisitor.matchSequentially(getElementToMatch(value1), getElementToMatch(value2)) || value1 instanceof PsiReferenceExpression && myMatchingVisitor.match(value1, value2))) { if (nameIdentifier != null) { myMatchingVisitor.setResult(isTypedVar || myMatchingVisitor.matchText(nameIdentifier.getText(), otherIdentifier == null ? PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME : otherIdentifier.getText())); } else { myMatchingVisitor.setResult(otherIdentifier == null || PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME.equals(otherIdentifier.getText())); } } } finally { final PsiIdentifier matchNode; if (otherIdentifier != null) { matchNode = otherIdentifier; } else { final PsiElementFactory factory = JavaPsiFacade.getElementFactory(other.getProject()); final PsiAnnotation annotation = (PsiAnnotation)factory.createStatementFromText("@Anno(value=\"\")", other).getFirstChild().getFirstChild(); matchNode = annotation.getParameterList().getAttributes()[0].getNameIdentifier(); } if (nameIdentifier != null) myMatchingVisitor.scopeMatch(nameIdentifier, isTypedVar, matchNode); } }