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
}
			if (encoding == null)
				encoding= ResourcesPlugin.getEncoding();
			byte[] bytes;				
			try {
				bytes= contents.getBytes(encoding);
			} catch (UnsupportedEncodingException e) {
				bytes= contents.getBytes();	
			}
			bca.setContent(bytes);
		}
	}
	
	/**
	 * Returns the contents of the given node as a string.
	 * This string is used to test the content of a Java element
	 * for equality. Is is never shown in the UI, so any string representing
	 * the content will do.
	 * @param node must implement the IStreamContentAccessor interface
	 * @param ignoreWhiteSpace if true all Java white space (incl. comments) is removed from the contents.
	 */
	public String getContents(Object node, boolean ignoreWhiteSpace) {
		
		if (! (node instanceof IStreamContentAccessor))
			return null;
			
		IStreamContentAccessor sca= (IStreamContentAccessor) node;
		String content= null;
		try {
			content= JavaCompareUtilities.readString(sca);