if (field instanceof SimpleReference) {
SimpleReference var = (SimpleReference) field;
int modifiers = Modifiers.AccPublic;
int offset = var.sourceStart();
int length = var.sourceEnd() - offset;
modifyDeclaration(assignment, new DeclarationInfo(
IModelElement.FIELD, modifiers, offset, length,
offset, length, '$' + var.getName(), null, null,
fCurrentQualifier, fCurrentParent));
}
}
} else if (left instanceof VariableReference) {
int modifiers = Modifiers.AccPublic | Modifiers.AccGlobal;
if (!declarations.empty()
&& declarations.peek() instanceof MethodDeclaration
&& !methodGlobalVars.peek().contains(
((VariableReference) left).getName())) {
return visitGeneral(assignment);
}
int offset = left.sourceStart();
int length = left.sourceEnd() - offset;
modifyDeclaration(assignment, new DeclarationInfo(
IModelElement.FIELD, modifiers, offset, length, offset,
length, ((VariableReference) left).getName(), null, null,
null, null));
}
return visitGeneral(assignment);