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/JavaStructureDiffViewer.java
/**
	 * Tracks property changes of the configuration object.
	 * Clients may override to track their own property changes.
	 * In this case they must call the inherited method.
	 */
	protected void propertyChange(PropertyChangeEvent event) {
		if (event.getProperty().equals(SMART))
			diff();
		else
			super.propertyChange(event);
	}
	
	private void setSmartButtonVisible(boolean visible) {
		if (fSmartActionItem == null)
			return;
		Control c= getControl();
		if (c == null || c.isDisposed())
			return;
			
		fSmartActionItem.setVisible(visible);
		ToolBarManager tbm= CompareViewerPane.getToolBarManager(c.getParent());
		if (tbm != null) {
			tbm.update(true);
			ToolBar tb= tbm.getControl();
			if (!tb.isDisposed())
				tb.getParent().layout(true);
		}
	}
}