summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-28 06:30:37 (EDT)
committerEike Stepper2008-05-28 06:30:37 (EDT)
commit2b0dd743ff907d77655e456753f930aef033f84f (patch)
tree1b869207864639893ef1a88017d820001216f5e3
parent3ecf46161cb73c3bdd5aa4adf0306ceb618cfd98 (diff)
downloadcdo-2b0dd743ff907d77655e456753f930aef033f84f.zip
cdo-2b0dd743ff907d77655e456753f930aef033f84f.tar.gz
cdo-2b0dd743ff907d77655e456753f930aef033f84f.tar.bz2
ignored unchecked cast
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java31
1 files changed, 26 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java
index e1d50da..5174dc3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOAutoAttacher.java
@@ -91,15 +91,21 @@ public class CDOAutoAttacher implements CDOTransactionHandler
public CDOAutoAttacher(CDOTransaction transaction)
{
- this.cdoTransaction = transaction;
+ cdoTransaction = transaction;
transaction.addHandler(this);
}
protected void persist(Resource res, Object object)
{
- if (object instanceof CDOResource) return;
+ if (object instanceof CDOResource)
+ {
+ return;
+ }
- if (!(object instanceof InternalCDOObject)) return;
+ if (!(object instanceof InternalCDOObject))
+ {
+ return;
+ }
res.getContents().add((InternalCDOObject)object);
}
@@ -107,6 +113,7 @@ public class CDOAutoAttacher implements CDOTransactionHandler
/**
* @param eObject
*/
+ @SuppressWarnings("unchecked")
private void handle(Resource resource, EObject eObject)
{
for (EReference reference : eObject.eClass().getEAllReferences())
@@ -119,9 +126,13 @@ public class CDOAutoAttacher implements CDOTransactionHandler
if (element.eResource() == null)
{
if (reference.isContainment())
+ {
handle(resource, element);
+ }
else
+ {
persist(resource, element);
+ }
}
}
}
@@ -133,9 +144,13 @@ public class CDOAutoAttacher implements CDOTransactionHandler
{
// objectsAdded.add(element);
if (reference.isContainment())
+ {
handle(resource, element);
+ }
else
+ {
persist(resource, element);
+ }
}
}
}
@@ -144,7 +159,10 @@ public class CDOAutoAttacher implements CDOTransactionHandler
public void addingObject(CDOTransaction transaction, CDOObject object)
{
- if (object instanceof CDOResource) return;
+ if (object instanceof CDOResource)
+ {
+ return;
+ }
// Persist the graph as well.
handle(object.eResource(), object);
@@ -157,7 +175,10 @@ public class CDOAutoAttacher implements CDOTransactionHandler
public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureChange)
{
- if (object instanceof CDOResource) return;
+ if (object instanceof CDOResource)
+ {
+ return;
+ }
if (featureChange != null)
{