Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-15 16:57:18 -0400
committerEike Stepper2008-10-15 16:57:18 -0400
commitf54be543d0403c6016b53054615c3cf9ef7a208a (patch)
tree2aaf3f9290588a6aeccbd1bcf132d04c5685ab44
parentfbd096d0010958633c1cbce6c1a077572b84c1d7 (diff)
downloadcdo-f54be543d0403c6016b53054615c3cf9ef7a208a.tar.gz
cdo-f54be543d0403c6016b53054615c3cf9ef7a208a.tar.xz
cdo-f54be543d0403c6016b53054615c3cf9ef7a208a.zip
[249847] Store resources in a hierarchical structure
https://bugs.eclipse.org/bugs/show_bug.cgi?id=249847
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java25
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java4
2 files changed, 22 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index c4ae2dc845..11efbe0d10 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -665,15 +665,30 @@ public class CDOResourceImpl extends CDOResourceNodeImpl implements CDOResource,
*/
public void delete(Map<?, ?> defaultDeleteOptions) throws IOException
{
- ResourceSet resourceSet = getResourceSet();
- if (resourceSet != null)
+ if (isRoot())
{
- resourceSet.getResources().remove(this);
+ throw new UnsupportedOperationException();
}
- if (!FSMUtil.isTransient(this))
+ if (getFolder() == null)
{
- cdoView().toTransaction().detach(this);
+ CDOViewImpl view = cdoView();
+ view.getRootResource().getContents().remove(this);
+ }
+ else
+ {
+ setFolder(null);
+ }
+ }
+
+ @Override
+ public void cdoInternalPostDetach()
+ {
+ super.cdoInternalPostDetach();
+ ResourceSet resourceSet = getResourceSet();
+ if (resourceSet != null)
+ {
+ resourceSet.getResources().remove(this);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index c31a8c5b78..b33b51bd4e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -202,9 +202,9 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
return (CDOResource)getObject(id);
}
}
- catch (Exception expected)
+ catch (Exception ignore)
{
- TRACER.trace(expected);
+ // Just create the missing resource
}
return createResource(path);

Back to the top