summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-20 05:46:53 (EDT)
committerEike Stepper2007-10-20 05:46:53 (EDT)
commit1780bc72335642b9f30fed4bf0dcfe662a3b5614 (patch)
treec07d25f5c21174b04d57a8e53056a17c337daada
parent38b3a15ac6437978cb498edc4dc79249f9355d53 (diff)
downloadcdo-1780bc72335642b9f30fed4bf0dcfe662a3b5614.zip
cdo-1780bc72335642b9f30fed4bf0dcfe662a3b5614.tar.gz
cdo-1780bc72335642b9f30fed4bf0dcfe662a3b5614.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java36
1 files changed, 27 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
index dd167c7..5c140c9 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
@@ -24,8 +24,7 @@ import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.model.CDOPackageManager;
import org.eclipse.emf.cdo.util.EMFUtil;
-import org.eclipse.net4j.util.ImplementationError;
-
+import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EPackage;
@@ -36,12 +35,18 @@ import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.emf.internal.cdo.CDOFactoryImpl;
import org.eclipse.emf.internal.cdo.CDOPackageRegistryImpl;
import org.eclipse.emf.internal.cdo.CDOSessionPackageManager;
+import org.eclipse.emf.internal.cdo.bundle.OM;
+
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.ImplementationError;
/**
* @author Eike Stepper
*/
public final class ModelUtil
{
+ private static final ContextTracer MODEL = new ContextTracer(OM.DEBUG_MODEL, ModelUtil.class);
+
private ModelUtil()
{
}
@@ -172,13 +177,13 @@ public final class ModelUtil
private static CDOFeatureImpl createCDOFeature(EStructuralFeature eFeature, CDOClassImpl containingClass)
{
- CDOFeatureImpl cdoFeature = EMFUtil.isReference(eFeature) ? createCDOReference(eFeature, containingClass)
- : createCDOAttribute(eFeature, containingClass);
+ CDOFeatureImpl cdoFeature = EMFUtil.isReference(eFeature) ? createCDOReference((EReference)eFeature,
+ containingClass) : createCDOAttribute((EAttribute)eFeature, containingClass);
cdoFeature.setClientInfo(eFeature);
return cdoFeature;
}
- private static CDOFeatureImpl createCDOReference(EStructuralFeature eFeature, CDOClassImpl containingClass)
+ private static CDOFeatureImpl createCDOReference(EReference eFeature, CDOClassImpl containingClass)
{
CDOPackageManager packageManager = containingClass.getPackageManager();
int featureID = eFeature.getFeatureID();
@@ -186,17 +191,30 @@ public final class ModelUtil
CDOClassRefImpl classRef = createClassRef(eFeature.getEType());
boolean many = eFeature.isMany();
boolean containment = EMFUtil.isContainment(eFeature);
- return new CDOFeatureImpl(containingClass, featureID, name, new CDOClassProxy(classRef, packageManager), many,
- containment);
+ CDOFeatureImpl cdoFeature = new CDOFeatureImpl(containingClass, featureID, name, new CDOClassProxy(classRef,
+ packageManager), many, containment);
+ if (MODEL.isEnabled())
+ {
+ MODEL.format("Reference info: type={0}, opposite={1}, keys={2}", eFeature.getEType(), eFeature.getEOpposite(),
+ eFeature.getEKeys());
+ }
+
+ return cdoFeature;
}
- private static CDOFeatureImpl createCDOAttribute(EStructuralFeature eFeature, CDOClassImpl containingClass)
+ private static CDOFeatureImpl createCDOAttribute(EAttribute eFeature, CDOClassImpl containingClass)
{
int featureID = eFeature.getFeatureID();
String name = eFeature.getName();
CDOTypeImpl type = getCDOType(eFeature);
boolean many = EMFUtil.isMany(eFeature);
- return new CDOFeatureImpl(containingClass, featureID, name, type, many);
+ CDOFeatureImpl cdoFeature = new CDOFeatureImpl(containingClass, featureID, name, type, many);
+ if (MODEL.isEnabled())
+ {
+ MODEL.format("Attribute info: type={0}", eFeature.getEType());
+ }
+
+ return cdoFeature;
}
public static EPackage getEPackage(CDOPackageImpl cdoPackage, CDOPackageRegistryImpl packageRegistry)