Bug 99539 [5.0] Totally weird java structure comparing of enums
Eclipse: 3.1.0, Build id: I20050610-1757 It seems that Java structure compare is totally broken with inner enums. Consider *inner* interface and two inner enum classes which implement that: class A { protected interface PropsSetter { void applyTo(Properties props); } protected enum Algorithms implements PropsSetter { BRUTE_FORCE { public void applyTo(Properties props){ // do something with props } }, [more enums ...] } protected enum Functions implements PropsSetter { MINIMUM_FOURIER { public void applyTo(Properties props){ props.setProperty(Const.KEY_FEASIBILITY_CLASS_NAME, "de.loskutov.ai.impl.feasibility.MinFourierFunction"); } }, [more enums ...] } [class body ...] } If I then change something in the class A (e.g. rename the parameter "props" to "props2"), and compare it to the previous version from version control system, the Java structure compare is completely messed up. This seems to be independent where in the class A was the initial change. In the followeed example, both inner enum classes are always marked with "+" as "new", and all enum declarations are showed as changed even if *nothing* in enums was changed.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaStructureCreator.java
parser.setCompilerOptions(compilerOptions);
			parser.setSource(buffer);
			parser.setFocalPosition(0);
			CompilationUnit cu= (CompilationUnit) parser.createAST(null);
			cu.accept(new JavaParseTreeBuilder(root, buffer, true));
			
			return root;
		}
		return null;
	}
		
	/**
	 * Returns true because this IStructureCreator knows how to save.
	 */
	public boolean canSave() {
		return true;
	}
	
	public void save(IStructureComparator node, Object input) {
		if (node instanceof JavaNode && input instanceof IEditableContent) {
			IDocument document= ((JavaNode)node).getDocument();
			IEditableContent bca= (IEditableContent) input;
			String contents= document.get();
			String encoding= null;
			if (input instanceof IEncodedStreamContentAccessor) {
				try {
					encoding= ((IEncodedStreamContentAccessor)input).getCharset();
				} catch (CoreException e1) {
					
				}