From 808df72cd1f7b7d8c39dcfbd5f2c805814227bc1 Mon Sep 17 00:00:00 2001 From: Eike Stepper Date: Tue, 24 Jul 2007 06:38:12 +0000 Subject: *** empty log message *** --- .../eclipse/emf/internal/cdo/CDOSessionImpl.java | 2 +- .../org/eclipse/emf/internal/cdo/util/FSMUtil.java | 6 ++- .../org/eclipse/emf/internal/cdo/util/GenUtil.java | 48 +++++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java index 676c113d47..f401b6f8de 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java @@ -607,7 +607,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession if (object instanceof CDOAdapterImpl) { CDOAdapterImpl adapter = (CDOAdapterImpl)object; - System.out.println("RESOLVING"); + System.out.println("RESOLVING"); // XXX adapter.cdoInternalResolveRevision(); return adapter.getTarget(); } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java index a1c5be83aa..2751d62a2e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java @@ -54,7 +54,11 @@ public final class FSMUtil if (object instanceof EModelElement || object instanceof EGenericType) { InternalEObject eObject = (InternalEObject)object; - eObject = (InternalEObject)EcoreUtil.resolve(eObject, view.getResourceSet()); + if (eObject.eIsProxy()) + { + eObject = (InternalEObject)EcoreUtil.resolve(eObject, view.getResourceSet()); + } + CDOID id = view.getSession().lookupMetaInstanceID(eObject); if (id != null) { diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/GenUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/GenUtil.java index bed252dc99..fd1ee3a694 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/GenUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/GenUtil.java @@ -10,6 +10,8 @@ **************************************************************************/ package org.eclipse.emf.internal.cdo.util; +import org.eclipse.net4j.util.StringUtil; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -23,11 +25,52 @@ public final class GenUtil { } - public static String getUpperFeatureName(String featureName) + /** + * @see GenFeatureImpl#getUpperName + */ + public static String getFeatureUpperName(String featureName) { return format(featureName, '_', null, false, true).toUpperCase(); } + /** + * @see GenFeatureImpl#getGetAccessor + */ + public static String getFeatureGetterName(String featureName, boolean isBooleanType) + { + String capName = StringUtil.cap(featureName); + // if (isMapEntryFeature()) + // return "getTyped" + capName; + String result = isBooleanType ? "is" + capName : "get" + ("Class".equals(capName) ? "Class_" : capName); + + // if (isListType() && !isFeatureMapType() && !isMapType() && + // getGenModel().isArrayAccessors()) + // { + // result += "List"; + // } + + // GenClass rootImplementsInterface = + // getGenModel().getRootImplementsInterfaceGenClass(); + // GenClass context = getContext(); + // if (rootImplementsInterface != null && + // !rootImplementsInterface.isEObject()) + // { + // for (GenOperation genOperation : + // rootImplementsInterface.getAllGenOperations()) + // { + // if (genOperation.getName().equals(result) && + // genOperation.getGenParameters().isEmpty() && + // !genOperation.getType(context).equals(getType(context))) + // { + // result = result + "_"; + // break; + // } + // } + // } + + return result; + } + /** * Formats a name by parsing it into words separated by underscores and/or * mixed-casing and then recombining them using the specified separator. A @@ -57,7 +100,8 @@ public final class GenUtil } } - if (name.length() != 0) parsedName.addAll(parseName(name, '_')); + if (name.length() != 0) + parsedName.addAll(parseName(name, '_')); StringBuilder result = new StringBuilder(); -- cgit v1.2.3