void (PsiElementFactory elementFactory, String localName, Collection<? extends PsiReferenceExpression> refs) { final PsiReferenceExpression refExpr = (PsiReferenceExpression)elementFactory.createExpressionFromText(localName, null); for (PsiReferenceExpression ref : refs) { ref.replace(refExpr); } }