PsiVariable enumerationVariable,
int startOffset,
String newVariableName)
throws IncorrectOperationException {
final PsiManager manager = enumerationVariable.getManager();
<BUG>final PsiElementFactory factory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory();
final Query<PsiReference> query = ReferencesSearch.search(</BUG>
enumerationVariable);
final List<PsiElement> referenceElements = new ArrayList();
for (PsiReference reference : query) {

PsiVariable enumerationVariable,
int startOffset,
String newVariableName)
throws IncorrectOperationException {
final PsiManager manager = enumerationVariable.getManager();
final Project project = manager.getProject();
final JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
final PsiElementFactory factory = facade.getElementFactory();
final Query<PsiReference> query = ReferencesSearch.search(
enumerationVariable);
final List<PsiElement> referenceElements = new ArrayList();
for (PsiReference reference : query) {
