Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbrun2012-10-01 19:43:50 +0000
committercbrun2012-10-01 19:43:50 +0000
commit0888c42f0c7db2150a69a633175b36d1e5ecabb8 (patch)
tree3b68b97aa060d36707514ea6c0383cf8a03c5adb
parentd352db94cc0fb2613fb47df2944fb776287be394 (diff)
downloadorg.eclipse.emf.compare-0888c42f0c7db2150a69a633175b36d1e5ecabb8.tar.gz
org.eclipse.emf.compare-0888c42f0c7db2150a69a633175b36d1e5ecabb8.tar.xz
org.eclipse.emf.compare-0888c42f0c7db2150a69a633175b36d1e5ecabb8.zip
Bug 390195 move/renaming detected instead of addition/deletion
https://bugs.eclipse.org/bugs/show_bug.cgi?id=390195 Fix the detection of move/renaming by making sure we compute the max distance only using attributes which have been set !
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
index 973405b30..7cc024b66 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
@@ -367,7 +367,7 @@ public class EditionDistance implements DistanceFunction {
checkForDifferences(fakeMatch);
changes += getCounter().getComputedDistance();
}
- // System.err.println(changes + ":max=>" + maxDistance + ":" + a + ":" + b);
+ System.err.println(changes + ":max=>" + maxDistance + ":" + a + ":" + b);
return changes;
}
@@ -434,10 +434,12 @@ public class EditionDistance implements DistanceFunction {
}
}
for (EAttribute feat : Iterables.filter(eObj.eClass().getEAllAttributes(), featureFilter)) {
- max += getWeight(feat) * attributeChangeCoef;
+ if (eObj.eIsSet(feat)) {
+ max += getWeight(feat) * attributeChangeCoef;
+ }
}
- max = max + locationChangeCoef * 5 - 1;
- // System.out.println(eObj.eClass().getName() + ":" + eObj + ":" + max);
+ max = max + locationChangeCoef * 5 - 2;
+ System.out.println(eObj.eClass().getName() + ":" + eObj + ":" + max);
return max;
}
}

Back to the top