Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2013-09-10 01:07:24 -0400
committerMartin Taal2013-09-10 01:07:24 -0400
commit425a4c500f41bc1578f58a60c31e3effbcdeb44c (patch)
tree01412011b47e2d5172281e7eca48fc9e4505c320
parent41ff69f9649f9f6431643f0f9680124fd1659c22 (diff)
downloadcdo-425a4c500f41bc1578f58a60c31e3effbcdeb44c.tar.gz
cdo-425a4c500f41bc1578f58a60c31e3effbcdeb44c.tar.xz
cdo-425a4c500f41bc1578f58a60c31e3effbcdeb44c.zip
[416530] - [Hibernate] Performance issues
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java2
2 files changed, 17 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java
index e0a6853826..2e61f710d6 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java
@@ -56,9 +56,9 @@ import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap.Entry;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
-import java.awt.List;
import java.io.IOException;
import java.text.MessageFormat;
+import java.util.List;
import java.util.Map;
/**
@@ -569,7 +569,7 @@ public abstract class BaseCDORevision extends AbstractCDORevision
public void clear(EStructuralFeature feature)
{
- if (feature.isMany() && (flags & LIST_PRESERVING_FLAG) != 0)
+ if (feature.isMany() && isListPreserving())
{
getList(feature).clear();
}
@@ -604,7 +604,7 @@ public abstract class BaseCDORevision extends AbstractCDORevision
public void unset(EStructuralFeature feature)
{
- if (feature.isMany() && (flags & LIST_PRESERVING_FLAG) != 0)
+ if (feature.isMany() && isListPreserving())
{
getList(feature).clear();
}
@@ -771,18 +771,27 @@ public abstract class BaseCDORevision extends AbstractCDORevision
}
/**
- * The default behavior of a {@link BaseCDORevision} on a {@link #clear(EStructuralFeature)} and {@link #unset(EStructuralFeature)} methods is to set the efeature's value to null (discarding the value itself, a List). By calling this {@link #setListPreservingFlag()} method the default behavior is changed, instead of setting the efeature's value to null, the {@link List#clear()} method is called on the efeature's list instance.
- *
+ * The default behavior of a {@link BaseCDORevision} on a {@link #clear(EStructuralFeature)} and
+ * {@link #unset(EStructuralFeature)} methods is to set the efeature's value to null (discarding the
+ * value itself, a List). By calling this {@link #setListPreservingFlag()} method the default behavior
+ * is changed, instead of setting the efeature's value to null, the {@link List#clear()} method is
+ * called on the efeature's list instance.
+ *
* On purpose private to prevent api changes.
- *
+ *
* @since 4.2
*/
@SuppressWarnings("unused")
- private void setListPreservingFlag()
+ private void setListPreserving()
{
flags |= LIST_PRESERVING_FLAG;
}
+ private boolean isListPreserving()
+ {
+ return (flags & LIST_PRESERVING_FLAG) != 0;
+ }
+
/**
* @since 4.1
*/
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java
index 3d3fa683e3..cd0b66afd3 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateUtil.java
@@ -124,7 +124,7 @@ public class HibernateUtil
{
try
{
- setListPreservingFlag_Method = BaseCDORevision.class.getDeclaredMethod("setListPreservingFlag");
+ setListPreservingFlag_Method = BaseCDORevision.class.getDeclaredMethod("setListPreserving");
setListPreservingFlag_Method.setAccessible(true);
dataTypeFactory = DatatypeFactory.newInstance();
}

Back to the top