Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 155181 Details for
Bug 247226
Transparently support legacy models (CDOLegacyAdapter)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
LegacyAdapter Patch v5
PATCH_Legacy.txt (text/plain), 4.96 KB, created by
Martin Fluegge
on 2010-01-03 04:59:21 EST
(
hide
)
Description:
LegacyAdapter Patch v5
Filename:
MIME Type:
Creator:
Martin Fluegge
Created:
2010-01-03 04:59:21 EST
Size:
4.96 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.cdo >Index: src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java,v >retrieving revision 1.33 >diff -u -r1.33 CDOLegacyWrapper.java >--- src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java 27 Dec 2009 15:41:16 -0000 1.33 >+++ src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java 3 Jan 2010 09:49:24 -0000 >@@ -191,6 +191,7 @@ > > public void cdoInternalCleanup() > { >+ // clean(); > } > > @Override >@@ -306,14 +307,8 @@ > instance.eSetDeliver(true); > } > >- int newThreadCount = counter.decrement(); >- >- if (newThreadCount == 0 && getPreRegisteredObjects() != null) >- { >- // localThread.remove(); // TODO Martin: check why new >- // objects will be created if this list is cleared >- } >- >+ counter.decrement(); >+ unregister(this); > underConstruction = false; > } > } >@@ -327,6 +322,11 @@ > getPreRegisteredObjects().put(wrapper.cdoID(), wrapper); > } > >+ private void unregister(CDOLegacyWrapper wrapper) >+ { >+ getPreRegisteredObjects().remove(wrapper.cdoID()); >+ } >+ > protected void revisionToInstanceContainment() > { > CDOID resourceID = revision.getResourceID(); >@@ -338,7 +338,10 @@ > setInstanceContainer(container, revision.getContainingFeatureID()); > } > >- private Map<CDOID, EObject> getPreRegisteredObjects() >+ /** >+ * @since 3.0 >+ */ >+ public static Map<CDOID, EObject> getPreRegisteredObjects() > { > return preRegisteredObjects.get(); > } >@@ -370,7 +373,7 @@ > > if (TRACER.isEnabled()) > { >- TRACER.format(("Adding " + object + " to feature " + feature + "in instance " + instance)); >+ TRACER.format("Adding " + object + " to feature " + feature + "in instance " + instance); > } > > list.basicAdd(object, null); >@@ -400,25 +403,24 @@ > > int featureID = instance.eClass().getFeatureID(feature); > Class<? extends Object> baseClass = object == null ? null : object.getClass(); >+ EStructuralFeature.Internal internalFeature = (EStructuralFeature.Internal)feature; >+ EReference oppositeReference = cdoID().isTemporary() ? null : internalFeature.getEOpposite(); > >- try >+ if (oppositeReference != null) > { > instance.eInverseAdd((InternalEObject)object, featureID, baseClass, null); >+ >+ if (object != null && !EMFUtil.isPersistent(oppositeReference)) >+ { >+ adjustOppositeReference(instance, (InternalEObject)object, oppositeReference); >+ } > } >- catch (NullPointerException e) >+ else > { >- // TODO: Martin:quick hack, because there is still a problem with the feature id. Should investigate this soon > instance.eSet(feature, object); > } > > // Adjust opposite for transient opposite features >- EStructuralFeature.Internal internalFeature = (EStructuralFeature.Internal)feature; >- EReference oppositeReference = cdoID().isTemporary() ? null : internalFeature.getEOpposite(); >- if (oppositeReference != null && object != null && !EMFUtil.isPersistent(oppositeReference)) >- { >- adjustOppositeReference(instance, (InternalEObject)object, oppositeReference); >- } >- > if (TRACER.isEnabled()) > { > TRACER.format(("Added object " + object + " to feature " + feature + " in instance " + instance)); >@@ -494,27 +496,35 @@ > return null; > } > >+ if (object instanceof CDOLegacyWrapper) >+ { >+ return ((CDOLegacyWrapper)object).cdoInternalInstance(); >+ } >+ > CDOType type = CDOModelUtil.getType(feature.getEType()); > object = type.convertToEMF(feature.getEType(), object); > > if (type == CDOType.OBJECT) > { >- CDOID id = (CDOID)object; >- if (id.isNull()) >+ if (object instanceof CDOID) > { >- return null; >- } >+ CDOID id = (CDOID)object; >+ if (id.isNull()) >+ { >+ return null; >+ } > >- object = getPreRegisteredObjects().get(id); >- if (object != null) >- { >- return ((CDOLegacyWrapper)object).cdoInternalInstance(); >- } >+ object = getPreRegisteredObjects().get(id); >+ if (object != null) >+ { >+ return ((CDOLegacyWrapper)object).cdoInternalInstance(); >+ } > >- object = view.getObject(id); >- if (object instanceof CDOObjectWrapper) >- { >- return ((CDOObjectWrapper)object).cdoInternalInstance(); >+ object = view.getObject(id); >+ if (object instanceof CDOObjectWrapper) >+ { >+ return ((CDOObjectWrapper)object).cdoInternalInstance(); >+ } > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247226
:
112514
|
112894
|
134866
|
151009
|
151634
|
151651
|
152232
|
153867
|
153868
|
155030
|
155031
|
155181
|
155182
|
155400
|
163497
|
163499