Bug 46805 prepare Compare for encoding support
I20031111 The Compare plugin only supports the global workspace encoding. It does not support encodings per file.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
case JavaNode.FIELD:
				return ASTRewrite.FIELD_DECLARATION;
				
			case JavaNode.INIT:
				return ASTRewrite.INITIALIZER;
				
			default:
				break;				
			}
		}
			
		
		Assert.isTrue(false);
		return ASTRewrite.UNKNOWN;
	}
	/**
	 * Returns the index of the given node within its container.
	 * If node is null -1 is returned.
	 * @param node
	 * @return the index of the given node or -1 if the node couldn't be found
	 */
	private int getIndex(CompilationUnit root, IMember node, List container) throws JavaModelException {
		
		if (node != null) {
			ISourceRange sourceRange= node.getNameRange();
			ASTNode n= NodeFinder.perform(root, sourceRange);
			if (n != null) {
				MethodDeclaration parentNode= (MethodDeclaration)ASTNodes.getParent(n, MethodDeclaration.class);
				if (parentNode != null)
					return container.indexOf(parentNode);