* Returns the anchor used for positioning in the destination for
* the element being renamed. For renaming, if no anchor has
* explicitly been provided, the element is anchored in the same position.
*/
private IJavaElement resolveRenameAnchor(IJavaElement element) throws JavaModelException {
IParent parent = (IParent) element.getParent();
IJavaElement[] children = parent.getChildren();
for (int i = 0; i < children.length; i++) {
IJavaElement child = children[i];
if (child.equals(element)) {
return child;
}