Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 221115
Collapse All | Expand All

(-)src/org/eclipse/compare/examples/xml/AbstractMatching.java (-4 / +8 lines)
Lines 137-143 Link Here
137
				
137
				
138
				//unordered compare of subtrees
138
				//unordered compare of subtrees
139
				// TODO The dist method is order dependent but should not be
139
				// TODO The dist method is order dependent but should not be
140
				int distance= dist(thisNode, otherNode);
140
				int distance= dist(thisNode, thisIndex, otherNode, otherIndex);
141
				return sameId || distance == 0;
141
				return sameId || distance == 0;
142
			}
142
			}
143
			return false;
143
			return false;
Lines 253-265 Link Here
253
	}
253
	}
254
254
255
	abstract public void match(XMLNode LeftTree, XMLNode RightTree, boolean rightTreeIsAncestor, IProgressMonitor monitor);
255
	abstract public void match(XMLNode LeftTree, XMLNode RightTree, boolean rightTreeIsAncestor, IProgressMonitor monitor);
256
256
	
257
	protected int dist(XMLNode x, XMLNode y) {
257
	protected int dist(XMLNode x, XMLNode y) {
258
		int ix= indexOfLN(x);
259
		int iy= indexOfRN(y);
260
		return dist(x, ix, y, iy);
261
	}
262
	
263
	protected int dist(XMLNode x, int index_x, XMLNode y, int index_y) {
258
		//System.out.println("dist( "+x.getSignature()+" , "+y.getSignature()+")");
264
		//System.out.println("dist( "+x.getSignature()+" , "+y.getSignature()+")");
259
		int ret= NO_ENTRY;
265
		int ret= NO_ENTRY;
260
266
261
		int index_x= indexOfLN(x);
262
		int index_y= indexOfRN(y);
263
		if (fDT[index_x][index_y] != NO_ENTRY) return fDT[index_x][index_y];
267
		if (fDT[index_x][index_y] != NO_ENTRY) return fDT[index_x][index_y];
264
		
268
		
265
		if (isLeaf(x) && isLeaf(y)) {
269
		if (isLeaf(x) && isLeaf(y)) {

Return to bug 221115