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 163497 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 v7 - ready to be committed
patch.txt (text/plain), 8.40 KB, created by
Eike Stepper
on 2010-03-31 04:14:34 EDT
(
hide
)
Description:
LegacyAdapter Patch v7 - ready to be committed
Filename:
MIME Type:
Creator:
Eike Stepper
Created:
2010-03-31 04:14:34 EDT
Size:
8.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.cdo >Index: src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java,v >retrieving revision 1.87 >diff -u -r1.87 CDOResourceImpl.java >--- src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java 28 Feb 2010 19:30:56 -0000 1.87 >+++ src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java 31 Mar 2010 08:12:22 -0000 >@@ -901,8 +901,9 @@ > > /** > * @ADDED >+ * @since 3.0 > */ >- void setExisting(boolean existing) >+ protected void setExisting(boolean existing) > { > this.existing = existing; > } >Index: src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java,v >retrieving revision 1.15 >diff -u -r1.15 CDOPushTransaction.java >--- src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java 16 Mar 2010 14:48:08 -0000 1.15 >+++ src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java 31 Mar 2010 08:12:22 -0000 >@@ -306,6 +306,11 @@ > return delegate.createResource(path); > } > >+ public boolean isLegacyModeEnabled() >+ { >+ return delegate.isLegacyModeEnabled(); >+ } >+ > public Set<CDOObject> getConflicts() > { > return delegate.getConflicts(); >Index: src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java,v >retrieving revision 1.16 >diff -u -r1.16 CDOMetaWrapper.java >--- src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java 3 Feb 2010 10:20:25 -0000 1.16 >+++ src/org/eclipse/emf/internal/cdo/CDOMetaWrapper.java 31 Mar 2010 08:12:22 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Eike Stepper - initial API and implementation >+ * Martin Fluegge - bug 247226: Transparently support legacy models > */ > package org.eclipse.emf.internal.cdo; > >@@ -111,6 +112,14 @@ > throw new UnsupportedOperationException(); > } > >+ /** >+ * @since 3.0 >+ */ >+ public void cdoInternalPostRollback() >+ { >+ // Do nothing >+ } >+ > public void cdoInternalPreCommit() > { > throw new UnsupportedOperationException(); >Index: src/org/eclipse/emf/internal/cdo/util/FSMUtil.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java,v >retrieving revision 1.70 >diff -u -r1.70 FSMUtil.java >--- src/org/eclipse/emf/internal/cdo/util/FSMUtil.java 20 Feb 2010 05:50:18 -0000 1.70 >+++ src/org/eclipse/emf/internal/cdo/util/FSMUtil.java 31 Mar 2010 08:12:22 -0000 >@@ -18,6 +18,7 @@ > import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry; > import org.eclipse.emf.cdo.util.CDOUtil; > import org.eclipse.emf.cdo.util.InvalidObjectException; >+import org.eclipse.emf.cdo.util.LegacyModeNotEnabledException; > import org.eclipse.emf.cdo.util.ObjectNotFoundException; > import org.eclipse.emf.cdo.view.CDOView; > >@@ -36,7 +37,6 @@ > import org.eclipse.emf.ecore.EPackage; > import org.eclipse.emf.ecore.EcorePackage; > import org.eclipse.emf.ecore.InternalEObject; >-import org.eclipse.emf.ecore.impl.DynamicEObjectImpl; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.spi.cdo.InternalCDOObject; > import org.eclipse.emf.spi.cdo.InternalCDOView; >@@ -139,6 +139,11 @@ > > if (object instanceof InternalEObject) > { >+ if (!view.isLegacyModeEnabled()) >+ { >+ throw new LegacyModeNotEnabledException(); >+ } >+ > return adaptLegacy((InternalEObject)object); > } > >@@ -175,17 +180,11 @@ > */ > public static InternalCDOObject adaptLegacy(InternalEObject object) > { >- if (object.getClass() == DynamicEObjectImpl.class) >- { >- throw new IllegalArgumentException(Messages.getString("FSMUtil.4") + object); //$NON-NLS-1$ >- } >- > EList<Adapter> adapters = object.eAdapters(); > CDOLegacyAdapter adapter = getLegacyAdapter(adapters); > if (adapter == null) > { >- adapter = new CDOLegacyAdapter(); >- adapters.add(adapter); >+ adapter = new CDOLegacyAdapter(object); > } > > return adapter; >Index: src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java,v >retrieving revision 1.78 >diff -u -r1.78 CDOViewImpl.java >--- src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java 16 Mar 2010 14:48:09 -0000 1.78 >+++ src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java 31 Mar 2010 08:12:23 -0000 >@@ -72,8 +72,8 @@ > import org.eclipse.emf.internal.cdo.util.FSMUtil; > > import org.eclipse.net4j.util.ImplementationError; >-import org.eclipse.net4j.util.StringUtil; > import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump; >+import org.eclipse.net4j.util.StringUtil; > import org.eclipse.net4j.util.collection.CloseableIterator; > import org.eclipse.net4j.util.collection.FastList; > import org.eclipse.net4j.util.collection.HashBag; >@@ -100,12 +100,12 @@ > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.spi.cdo.CDOSessionProtocol; >+import org.eclipse.emf.spi.cdo.CDOSessionProtocol.RefreshSessionResult; > import org.eclipse.emf.spi.cdo.InternalCDOObject; > import org.eclipse.emf.spi.cdo.InternalCDOSession; > import org.eclipse.emf.spi.cdo.InternalCDOTransaction; > import org.eclipse.emf.spi.cdo.InternalCDOView; > import org.eclipse.emf.spi.cdo.InternalCDOViewSet; >-import org.eclipse.emf.spi.cdo.CDOSessionProtocol.RefreshSessionResult; > > import java.text.MessageFormat; > import java.util.ArrayList; >@@ -115,8 +115,8 @@ > import java.util.HashSet; > import java.util.List; > import java.util.Map; >-import java.util.Set; > import java.util.Map.Entry; >+import java.util.Set; > import java.util.concurrent.ConcurrentMap; > import java.util.concurrent.locks.ReentrantLock; > >@@ -127,6 +127,8 @@ > { > private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_VIEW, CDOViewImpl.class); > >+ private final boolean legacyModeEnabled; >+ > private int viewID; > > private InternalCDOSession session; >@@ -176,6 +178,7 @@ > public CDOViewImpl(CDOBranch branch, long timeStamp) > { > branchPoint = branch.getPoint(timeStamp); >+ legacyModeEnabled = CDOUtil.isLegacyModeDefault(); > options = createOptions(); > } > >@@ -205,6 +208,11 @@ > return true; > } > >+ public boolean isLegacyModeEnabled() >+ { >+ return legacyModeEnabled; >+ } >+ > public ResourceSet getResourceSet() > { > return viewSet.getResourceSet(); >@@ -1270,7 +1278,14 @@ > > if (old != null) > { >- throw new IllegalStateException(MessageFormat.format(Messages.getString("CDOViewImpl.20"), object)); //$NON-NLS-1$ >+ if (CDOUtil.isLegacyObject(object)) >+ { >+ OM.LOG.warn("Legacy object has been registered multiple times: " + object); >+ } >+ else >+ { >+ throw new IllegalStateException(MessageFormat.format(Messages.getString("CDOViewImpl.20"), object)); //$NON-NLS-1$ >+ } > } > } > >#P org.eclipse.emf.cdo.tests >Index: src/org/eclipse/emf/cdo/tests/BranchingTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java,v >retrieving revision 1.12 >diff -u -r1.12 BranchingTest.java >--- src/org/eclipse/emf/cdo/tests/BranchingTest.java 29 Mar 2010 15:46:02 -0000 1.12 >+++ src/org/eclipse/emf/cdo/tests/BranchingTest.java 31 Mar 2010 08:12:27 -0000 >@@ -691,7 +691,7 @@ > > CDOID id = CDOUtil.getCDOObject(product).cdoID(); > CDOView view = session.openView(); >- product = (Product1)view.getObject(id); >+ product = (Product1)CDOUtil.getEObject(view.getObject(id)); > > view.setBranch(subBranch); >
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