From 8af70034d898742ed2b0764abf559e3a93f15cfa Mon Sep 17 00:00:00 2001 From: Eike Stepper Date: Fri, 13 Jan 2012 18:47:45 +0100 Subject: [368571] CDOModificationTrackingAdapter should ignore CDOInvalidations https://bugs.eclipse.org/bugs/show_bug.cgi?id=368571 --- .../cdo/util/CDOModificationTrackingAdapter.java | 31 +++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOModificationTrackingAdapter.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOModificationTrackingAdapter.java index 874cf7cf44..eee00160ff 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOModificationTrackingAdapter.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOModificationTrackingAdapter.java @@ -10,6 +10,7 @@ */ package org.eclipse.emf.cdo.util; +import org.eclipse.emf.cdo.CDONotification; import org.eclipse.emf.cdo.eresource.CDOResource; import org.eclipse.emf.cdo.eresource.EresourcePackage; import org.eclipse.emf.cdo.transaction.CDOCommitContext; @@ -54,23 +55,29 @@ public class CDOModificationTrackingAdapter extends CDOLazyContentAdapter @Override public void notifyChanged(Notification notification) { - if (!notification.isTouch()) + if (notification.isTouch()) { - Object notifier = notification.getNotifier(); + return; + } - // Listen to changes on Resources, only if its the Resource when this adapter is installed on - if (notifier == container) - { - // The only attribute that triggers modified = true is "contents". The rest are ignored. - if (notification.getFeature() == EresourcePackage.Literals.CDO_RESOURCE__CONTENTS) - { - container.setModified(true); - } - } - else if (!(notifier instanceof Resource)) + if (notification instanceof CDONotification) + { + return; + } + + // Listen to changes on Resources, only if its the Resource when this adapter is installed on + Object notifier = notification.getNotifier(); + if (notifier == container) + { + // The only attribute that triggers modified = true is "contents". The rest are ignored. + if (notification.getFeature() == EresourcePackage.Literals.CDO_RESOURCE__CONTENTS) { container.setModified(true); } } + else if (!(notifier instanceof Resource)) + { + container.setModified(true); + } } } -- cgit v1.2.3