Project: JDT
Bug 99539 [5.0] Totally weird java structure comparing of enums
Reported: 2005-06-12 12:42:11 | Status: verified fixed

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.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaStructureCreator.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaStructureDiffViewer.java