Bug 3926 issue copying file with duplicate name (1GF60YK)
I tried to copy a package.html file from one package to another using the "copy" menu entry in the packages view. The destination package already had a file called package.html so I was presented with a "Duplicate names" dialog. The dialog has two radio buttons, one for "replace element" and one for "rename to". Issues: - The replace button is grayed out - "Rename to" is ambiguous. Am I renaming the thing being copied or the file already at the destination. Since I actually wanted to overwrite the file and the rename renames the file being copied, I could not accomplish the task. Note that the copy action from the navigator works as desired. NOTES: KH (6/12/2001 7:11:31 AM) Moving to JUI for comment.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
if (r1 == null && r2 == null)
			return null;
		if (r1 == null)
			return r2.getParent();
		if (r2 == null)
			return r1.getParent();
		
		if (r1.equals(r2))
			return r1.getParent();
			
		if (r1.getFullPath().isPrefixOf(r2.getFullPath()))
			return r1;
		if (r2.getFullPath().isPrefixOf(r1.getFullPath()))
			return r2;
						
		IPath p1= r1.getParent().getFullPath();
		IPath p2= r2.getParent().getFullPath();
		IPath commonPath= new Path(""); 
		int segCount= Math.min(p1.segmentCount(), p2.segmentCount());
		for (int i= 0; i < segCount; i++){
			if (p1.segment(i).equals(p2.segment(i)))
				commonPath= commonPath.append(p1.segment(i));
			else
				break;	
		}
		return ResourcesPlugin.getWorkspace().getRoot().findMember(commonPath);
	}
	
	private static IResource getResource(Object o) {
		try{