Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langer2014-11-11 20:40:28 +0000
committerPhilip Langer2014-11-11 20:40:28 +0000
commit02ca3d53eceec5d3c0abf3d2c6af64ea115e5d61 (patch)
tree2e0f75092cd480e4c3fa3a3d6bb72ca7aa349803
parent5b2764e407c007540e99653b3389e5cd618df3c5 (diff)
downloadorg.eclipse.emf.compare-02ca3d53eceec5d3c0abf3d2c6af64ea115e5d61.tar.gz
org.eclipse.emf.compare-02ca3d53eceec5d3c0abf3d2c6af64ea115e5d61.tar.xz
org.eclipse.emf.compare-02ca3d53eceec5d3c0abf3d2c6af64ea115e5d61.zip
[451048] Avoids IllegalArgumentException for custom diff types
Makes sure that DiffUtil.getTargetFeature and DiffUtil.getTargetContainer is only called for supported diff types but not for potentially added custom diff types. Bug: 451048 Change-Id: I02bc4048ade54120864e2154aa5dbb146e02bc4f Signed-off-by: Philip Langer <planger@eclipsesource.com>
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/utils/DiffUtil.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/utils/DiffUtil.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/utils/DiffUtil.java
index afe962fe3..25da2e792 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/utils/DiffUtil.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/utils/DiffUtil.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Obeo - initial API and implementation
- * Philip Langer - Fixes for bug 440679, 441258, 442439, 443504, 446739, and refactorings
+ * Philip Langer - Bugs 440679, 441258, 442439, 443504, 446739, 451048 and refactorings
* Alexandra Buzila - Fixes for bug 448464
*******************************************************************************/
package org.eclipse.emf.compare.internal.utils;
@@ -1243,7 +1243,9 @@ public final class DiffUtil {
* otherwise.
*/
private boolean matchesTarget(Diff input) {
- return matchesTargetFeature(input) && matchesTargetContainer(input);
+ final boolean isSupportedDiff = input instanceof AttributeChange
+ || input instanceof ReferenceChange || input instanceof FeatureMapChange;
+ return isSupportedDiff && matchesTargetFeature(input) && matchesTargetContainer(input);
}
/**

Back to the top