Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-10-30 22:37:55 +0000
committerGerrit Code Review @ Eclipse.org2015-10-30 23:21:40 +0000
commite0cf99f584a68ef90f744b224f116adaaeab661e (patch)
tree81285e40156e5b15c6813c6621906682da7a3ddc /plugins/infra/core
parent42be40ff6bcbe50ff50158f7884d6460938d4662 (diff)
downloadorg.eclipse.papyrus-e0cf99f584a68ef90f744b224f116adaaeab661e.tar.gz
org.eclipse.papyrus-e0cf99f584a68ef90f744b224f116adaaeab661e.tar.xz
org.eclipse.papyrus-e0cf99f584a68ef90f744b224f116adaaeab661e.zip
Bug 481151: ResourceAdapter does not detect changes to contents of pre-existing resources
https://bugs.eclipse.org/bugs/show_bug.cgi?id=481151 Ensure that the ResourceAdapter is attached to all resources already in the resource set during the initial discovery phase.
Diffstat (limited to 'plugins/infra/core')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java
index de8f48b5dbd..454dc5ea26f 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/ResourceAdapter.java
@@ -53,6 +53,7 @@ public abstract class ResourceAdapter extends AdapterImpl {
// Discover existing resources. Iterate the current set; any new additions
// will be discovered automatically
for (Resource next : ImmutableList.copyOf(((ResourceSet) newTarget).getResources())) {
+ addAdapter(next);
handleResourceAdded(next);
if (next.isLoaded()) {
handleResourceLoaded(next);
@@ -183,8 +184,8 @@ public abstract class ResourceAdapter extends AdapterImpl {
Object newValue = msg.getNewValue();
if (newValue instanceof Iterable<?>) {
for (Object next : (Iterable<?>) newValue) {
- handleRootAdded(resource, (EObject) next);
- }
+ handleRootAdded(resource, (EObject) next);
+ }
}
break;
}
@@ -199,8 +200,8 @@ public abstract class ResourceAdapter extends AdapterImpl {
Object oldValue = msg.getOldValue();
if (oldValue instanceof Iterable<?>) {
for (Object next : (Iterable<?>) oldValue) {
- handleRootRemoved(resource, (EObject) next);
- }
+ handleRootRemoved(resource, (EObject) next);
+ }
}
break;
}
@@ -213,9 +214,9 @@ public abstract class ResourceAdapter extends AdapterImpl {
}
break;
}
+ }
}
}
- }
protected void handleResourceAdded(Resource resource) {
// Pass

Back to the top