private int nodeSourceEnd(Binding field, ASTNode node, int index) {
	if (node instanceof ArrayTypeReference) {
		return ((ArrayTypeReference) node).originalSourceEnd;
	} else if (node instanceof QualifiedNameReference) {
		QualifiedNameReference ref = (QualifiedNameReference) node;
		if (ref.binding == field) {
			return (int) (ref.sourcePositions[ref.indexOfFirstFieldBinding-1]);
		}
		FieldBinding[] otherFields = ref.otherBindings;
		if (otherFields != null) {
			int offset = ref.indexOfFirstFieldBinding;
			for (int i = 0, length = otherFields.length; i < length; i++) {
				if (otherFields[i] == field)
					return (int) (ref.sourcePositions[i + offset]);
			}
		}
	} else if (node instanceof ArrayQualifiedTypeReference) {
		ArrayQualifiedTypeReference arrayQualifiedTypeReference = (ArrayQualifiedTypeReference) node;
		int length = arrayQualifiedTypeReference.sourcePositions.length;
		return (int) arrayQualifiedTypeReference.sourcePositions[length - 1];
	}
	return node.sourceEnd;
}