Problem with org.eclipse.compare.structuremergeviewer.differencer [message #289812] |
Thu, 11 August 2005 04:16 |
Steve Jerman Messages: 26 Registered: July 2009 |
Junior Member |
|
|
Hi,
I am trying to write a structure compare utility for that can compare
two UMl2 files and show differences (show some but ignore others...). I
seem to have run into an issue.
I generate two structures which get passed into the differencer.. in the
Traverse method, the differencer uses hashmaps to store it's workings
.... like:
if (rightChildren != null) {
rightSet= new HashMap(10);
for (int i= 0; i < rightChildren.length; i++) {
Object rightChild= rightChildren[i];
rightSet.put(rightChild, rightChild);
allSet.add(rightChild);
}
}
if (leftChildren != null) {
leftSet= new HashMap(10);
for (int i= 0; i < leftChildren.length; i++) {
Object leftChild= leftChildren[i];
leftSet.put(leftChild, leftChild);
allSet.add(leftChild);
}
}
Now the the problem is that it never 'sees' the right side and left
sides as the same... 'cos the HashMap keys are different (of course they
are ... they are different instances.
Am I missing something. I assume that I might be generating the
IStructureComparators wrongly, but I'm scratching my head as to how to
get past this Hashmap operation.
Anyone any ideas? How can I make different instances of
IStructureComparator have the same hashvalue?
Steve
|
|
|
Powered by
FUDForum. Page generated in 0.02472 seconds