Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-05-20 06:20:05 -0400
committerEike Stepper2015-05-20 06:20:05 -0400
commiteb363025b6fd822d9802d0e1b63ed098e7a17e21 (patch)
treed81806e5c849224e7248dd12b23adf63a6126136
parentf371a1d75ccf0801cab39e86c285e3a205a51a84 (diff)
downloadcdo-committers/estepper/address-space.tar.gz
cdo-committers/estepper/address-space.tar.xz
cdo-committers/estepper/address-space.zip
[467442] Add Interactive Transaction Conflict Resolution committers/estepper/address-space
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=467442
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.util/src/org/eclipse/emf/cdo/dawn/util/connection/CDOConnectionUtil.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/.settings/.api_filters8
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java43
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_265114_Test.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/AbstractCDOViewProvider.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOURIHandler.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java60
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java17
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOViewSet.java3
16 files changed, 124 insertions, 47 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.util/src/org/eclipse/emf/cdo/dawn/util/connection/CDOConnectionUtil.java b/plugins/org.eclipse.emf.cdo.dawn.util/src/org/eclipse/emf/cdo/dawn/util/connection/CDOConnectionUtil.java
index b64529f700..94489567a3 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.util/src/org/eclipse/emf/cdo/dawn/util/connection/CDOConnectionUtil.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.util/src/org/eclipse/emf/cdo/dawn/util/connection/CDOConnectionUtil.java
@@ -182,6 +182,7 @@ public class CDOConnectionUtil
session.close();
}
+ @SuppressWarnings("deprecation")
public CDOTransaction getOrOpenCurrentTransaction(String id, ResourceSet resourceSet, String repositoryName)
{
CDOTransaction transaction = getCurrentTransaction(id);
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.explorer.ui/.settings/.api_filters
index 3d7a543003..99d40c0b79 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/.settings/.api_filters
@@ -8,6 +8,14 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOCheckoutEditorOpenerRegistry.java" type="org.eclipse.emf.cdo.explorer.ui.checkouts.CDOCheckoutEditorOpenerRegistry">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="Registry"/>
+ <message_argument value="CDOCheckoutEditorOpenerRegistry"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/NewActionProvider.java" type="org.eclipse.emf.cdo.explorer.ui.checkouts.actions.NewActionProvider">
<filter id="574664731">
<message_arguments>
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java
index 44b71d0cf4..20c921f693 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/checkouts/CDOCheckoutViewProvider.java
@@ -98,12 +98,6 @@ public class CDOCheckoutViewProvider extends AbstractCDOViewProvider
return new Path(uri.path()).makeAbsolute().removeFirstSegments(1).toString();
}
- @Override
- public URI getViewURI(URI uri)
- {
- return URI.createHierarchicalURI(uri.scheme(), uri.authority(), null, uri.query(), null);
- }
-
public static void disposeResourceSet(ResourceSet resourceSet)
{
CheckoutViewProviderAdapter adapter = CheckoutViewProviderAdapter.get(resourceSet);
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
index 7f9f1fb0d4..b11ddc1fd0 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/net4j/CDONet4jViewProvider.java
@@ -89,8 +89,7 @@ public abstract class CDONet4jViewProvider extends AbstractCDOViewProvider
@Override
public URI getViewURI(URI uri)
{
- return URI.createHierarchicalURI(uri.scheme(), uri.authority(), null, uri.query(), null)
- .appendSegment(uri.segment(1));
+ return super.getViewURI(uri).appendSegment(uri.segment(1));
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java
index ea22758b25..9bb86ce511 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java
@@ -512,6 +512,7 @@ public class AuditTest extends AbstractCDOTest
session.close();
}
+ @SuppressWarnings("deprecation")
public void testChangeURI() throws Exception
{
long commitTime1;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
index 925f30053b..2fc1a9d152 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InitialTest.java
@@ -82,7 +82,7 @@ public class InitialTest extends AbstractCDOTest
public void testTransientResource() throws Exception
{
- final URI uri = URI.createURI("cdo:/test1");
+ final URI uri = URI.createURI("cdo://repo1/test1");
ResourceSet resourceSet = new ResourceSetImpl();
SessionUtil.prepareResourceSet(resourceSet);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
index b7449a622d..fa5503741e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
@@ -264,7 +264,7 @@ public class ResourceTest extends AbstractCDOTest
ResourceSet resourceSet = new ResourceSetImpl();
CDOTransaction transaction = session.openTransaction(resourceSet);
- resourceURI = URI.createURI("cdo:" + resourcePath);
+ resourceURI = URI.createURI("cdo://" + session.getRepositoryInfo().getUUID() + resourcePath);
Resource res1 = resourceSet.createResource(resourceURI);
transaction.commit();
@@ -310,7 +310,7 @@ public class ResourceTest extends AbstractCDOTest
assertActive(resource);
assertNew(resource, transaction);
assertEquals(transaction.getResourceSet(), resource.getResourceSet());
- assertEquals(CDOURIUtil.createResourceURI(session, "test1"), resource.getURI());
+ assertEquals(createResourceURI(session, "test1"), resource.getURI());
assertEquals("test1", resource.getName());
assertEquals(null, resource.getFolder());
@@ -345,7 +345,7 @@ public class ResourceTest extends AbstractCDOTest
assertActive(resource);
assertNew(resource, transaction);
assertEquals(transaction.getResourceSet(), resource.getResourceSet());
- assertEquals(CDOURIUtil.createResourceURI(session, "folder/test1"), resource.getURI());
+ assertEquals(createResourceURI(session, "folder/test1"), resource.getURI());
assertEquals("test1", resource.getName());
CDOResourceFolder folder = resource.getFolder();
@@ -369,7 +369,7 @@ public class ResourceTest extends AbstractCDOTest
CDOResource resourceCopy = transaction.getOrCreateResource(getResourcePath("/test1"));
assertEquals(resource, resourceCopy);
assertNew(resource, transaction);
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("test1")), resource.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("test1")), resource.getURI());
assertEquals(transaction.getResourceSet(), resource.getResourceSet());
}
@@ -386,7 +386,7 @@ public class ResourceTest extends AbstractCDOTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.getResource(getResourcePath("/org/eclipse/net4j/core"));
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("/org/eclipse/net4j/core")), resource.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("/org/eclipse/net4j/core")), resource.getURI());
assertEquals(transaction.getResourceSet(), resource.getResourceSet());
session.close();
}
@@ -397,7 +397,7 @@ public class ResourceTest extends AbstractCDOTest
ResourceSet resourceSet = new ResourceSetImpl();
CDOTransaction transaction = session.openTransaction(resourceSet);
- final URI uri = URI.createURI("cdo:/test1");
+ final URI uri = URI.createURI("cdo://" + session.getRepositoryInfo().getUUID() + "/test1");
CDOResource resource = (CDOResource)resourceSet.getResource(uri, false);
assertEquals(null, resource);
@@ -691,7 +691,7 @@ public class ResourceTest extends AbstractCDOTest
transaction.commit();
URI uri = URI.createURI("cdo://repo1/renamed");
- assertEquals(CDOURIUtil.createResourceURI(session, "/renamed"), uri);
+ assertEquals(createResourceURI(session, "/renamed"), uri);
resource.setURI(uri);
transaction.commit();
@@ -717,7 +717,7 @@ public class ResourceTest extends AbstractCDOTest
transaction.commit();
URI uri = URI.createURI("cdo://repo1/renamed");
- assertEquals(CDOURIUtil.createResourceURI(session, "/renamed"), uri);
+ assertEquals(createResourceURI(session, "/renamed"), uri);
resource.setURI(uri);
transaction.commit();
@@ -740,11 +740,11 @@ public class ResourceTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.createResource(getResourcePath("/res1"));
assertEquals(getResourcePath("/res1"), resource.getPath());
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("/res1")), resource.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("/res1")), resource.getURI());
transaction.commit();
assertEquals(getResourcePath("/res1"), resource.getPath());
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("/res1")), resource.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("/res1")), resource.getURI());
session.close();
}
@@ -753,15 +753,15 @@ public class ResourceTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.getResource(getResourcePath("/res1"));
assertEquals(getResourcePath("/res1"), resource.getPath());
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("/res1")), resource.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("/res1")), resource.getURI());
CDOResource resource2 = transaction.getOrCreateResource(getResourcePath("/res2"));
assertEquals(getResourcePath("/res2"), resource2.getPath());
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("/res2")), resource2.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("/res2")), resource2.getURI());
transaction.commit();
assertEquals(getResourcePath("/res2"), resource2.getPath());
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("/res2")), resource2.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("/res2")), resource2.getURI());
session.close();
}
@@ -770,7 +770,7 @@ public class ResourceTest extends AbstractCDOTest
CDOView view = session.openView();
CDOResource resource2 = view.getResource(getResourcePath("/res2"));
assertEquals(getResourcePath("/res2"), resource2.getPath());
- assertEquals(CDOURIUtil.createResourceURI(session, getResourcePath("/res2")), resource2.getURI());
+ assertEquals(createResourceURI(session, getResourcePath("/res2")), resource2.getURI());
session.close();
}
}
@@ -1628,7 +1628,7 @@ public class ResourceTest extends AbstractCDOTest
path += "/" + name;
}
- final URI uri = URI.createURI("cdo:" + path);
+ final URI uri = URI.createURI("cdo://" + session.getRepositoryInfo().getUUID() + path);
CDOResource resource = (CDOResource)resourceSet.createResource(uri);
assertEquals(names.get(names.size() - 1), resource.getName());
@@ -1757,8 +1757,7 @@ public class ResourceTest extends AbstractCDOTest
CDOID idAfterChangePathOrder = CDOUtil.getCDOObject(order).cdoID();
assertEquals(idBeforeChangePathOrder, idAfterChangePathOrder);
- Resource resourceRenamed = transaction.getResourceSet()
- .getResource(CDOURIUtil.createResourceURI(session, newPath), false);
+ Resource resourceRenamed = transaction.getResourceSet().getResource(createResourceURI(session, newPath), false);
assertEquals(resource, resourceRenamed);
assertClean(resource, transaction);
@@ -1772,7 +1771,7 @@ public class ResourceTest extends AbstractCDOTest
try
{
- URI uri = CDOURIUtil.createResourceURI(session, oldPath);
+ URI uri = createResourceURI(session, oldPath);
transaction.getResourceSet().getResource(uri, true);
fail("Doesn't exist");
}
@@ -1780,10 +1779,16 @@ public class ResourceTest extends AbstractCDOTest
{
}
- Resource resource = transaction.getResourceSet().getResource(CDOURIUtil.createResourceURI(session, newPath), true);
+ Resource resource = transaction.getResourceSet().getResource(createResourceURI(session, newPath), true);
assertNotNull(resource);
}
+ @SuppressWarnings("deprecation")
+ private URI createResourceURI(CDOSession session, String path)
+ {
+ return CDOURIUtil.createResourceURI(session, path);
+ }
+
private String createPath(String namePrefix, int depth, String name)
{
String path = "";
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java
index f74238e2e4..f50513b7dd 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewProviderTest.java
@@ -95,6 +95,7 @@ public class ViewProviderTest extends AbstractCDOTest
uri = URI.createURI(getURIPrefix() + "/" + REPO + getResourcePath(PATH) + "?transactional=true");
}
+ @SuppressWarnings("deprecation")
public void testNormal() throws Exception
{
init();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_265114_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_265114_Test.java
index 1ea7574f17..1cd5f302bd 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_265114_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_265114_Test.java
@@ -43,11 +43,12 @@ import java.util.Map;
* Attaching adapters to resources does not load them?
* <p>
* See bug 265114
- *
+ *
* @author Simon McDuff
*/
public class Bugzilla_265114_Test extends AbstractCDOTest
{
+ @SuppressWarnings("deprecation")
public void testResourceSet() throws Exception
{
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java
index 3ee117aa10..8b0dfefb45 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOPushTransaction.java
@@ -600,11 +600,17 @@ public class CDOPushTransaction extends Notifier implements CDOTransaction
return delegate.getSession();
}
+ /**
+ * @since 4.4
+ */
public CDOViewProvider getProvider()
{
return delegate.getProvider();
}
+ /**
+ * @since 4.4
+ */
public URI createResourceURI(String path)
{
return delegate.createResourceURI(path);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/AbstractCDOViewProvider.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/AbstractCDOViewProvider.java
index 1e2b04e7d4..eede842478 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/AbstractCDOViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/AbstractCDOViewProvider.java
@@ -108,22 +108,22 @@ public abstract class AbstractCDOViewProvider implements CDOViewProvider2
}
/**
- * Must be overwritten for non-canonical URI formats!
+ * Should be overwritten for non-canonical URI formats!
*
* @since 4.4
*/
public URI getViewURI(URI uri)
{
- return null;
+ return URI.createHierarchicalURI(uri.scheme(), uri.authority(), uri.device(), null, null);
}
/**
- * Must be overwritten for non-canonical URI formats!
+ * Should be overwritten for non-canonical URI formats!
*
* @since 4.4
*/
public String getPath(URI uri)
{
- return null;
+ return uri.path();
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java
index 6a10b461be..6edeec568e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java
@@ -109,6 +109,8 @@ public interface CDOView extends CDOCommonView, CDOUpdatable, CDOCommitHistory.P
/**
* Returns the {@link CDOViewProvider provider} that has opened this view.
+ *
+ * @since 4.4
*/
public CDOViewProvider getProvider();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOURIHandler.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOURIHandler.java
index 533e0550bc..2a71c70b04 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOURIHandler.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOURIHandler.java
@@ -57,13 +57,6 @@ public class CDOURIHandler implements URIHandler
public boolean canHandle(URI uri)
{
- int xxx;
- // if (CDO_URI_SCHEME.equals(uri.scheme()))
- // {
- // String uuid = view.getSession().getRepositoryInfo().getUUID();
- // return uuid.equals(CDOURIUtil.extractRepositoryUUID(uri));
- // }
-
CDOViewProvider[] viewProviders = CDOViewProviderRegistry.INSTANCE.getViewProviders(uri);
return viewProviders.length != 0;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java
index 9f84622be8..92e7d3759d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewProviderRegistryImpl.java
@@ -30,6 +30,7 @@ import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.spi.cdo.InternalCDOView;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -90,24 +91,69 @@ public class CDOViewProviderRegistryImpl extends Container<CDOViewProvider>imple
for (CDOViewProvider viewProvider : getViewProviders(uri))
{
- if (viewSet != null && viewProvider instanceof CDOViewProvider2)
+ InternalCDOView view = provideView(uri, resourceSet, viewSet, viewProvider);
+ if (view != null)
{
- URI viewURI = ((CDOViewProvider2)viewProvider).getViewURI(uri);
+ CDOViewProvider provider = view.getProvider();
+ if (provider != null)
+ {
+ if (provider != viewProvider)
+ {
+ throw new IllegalStateException("View providers don't match");
+ }
+ }
+ else
+ {
+ view.setProvider(viewProvider);
+ }
+
+ return view;
+ }
+ }
- CDOView view = viewSet.resolveView(viewURI);
+ return null;
+ }
+
+ private InternalCDOView provideView(URI uri, ResourceSet resourceSet, CDOViewSet viewSet,
+ CDOViewProvider viewProvider)
+ {
+ if (viewSet != null && viewProvider instanceof CDOViewProvider2)
+ {
+ URI viewURI;
+
+ try
+ {
+ viewURI = ((CDOViewProvider2)viewProvider).getViewURI(uri);
+ }
+ catch (IllegalArgumentException ex)
+ {
+ throw new IllegalArgumentException(ex.getMessage() + ": " + uri, ex);
+ }
+ catch (Error ex)
+ {
+ throw ex;
+ }
+
+ try
+ {
+ InternalCDOView view = (InternalCDOView)viewSet.resolveView(viewURI);
if (view != null)
{
return view;
}
}
-
- CDOView view = viewProvider.getView(uri, resourceSet);
- if (view != null)
+ catch (Exception ex)
{
- return view;
+ //$FALL-THROUGH$
}
}
+ InternalCDOView view = (InternalCDOView)viewProvider.getView(uri, resourceSet);
+ if (view != null)
+ {
+ return view;
+ }
+
return null;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java
index 4e2103e3d0..7cb8465da7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java
@@ -12,6 +12,7 @@
package org.eclipse.emf.internal.cdo.view;
import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.util.CDOURIUtil;
import org.eclipse.emf.cdo.util.InvalidURIException;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.view.CDOViewProvider;
@@ -25,6 +26,8 @@ import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.core.runtime.Path;
+
/**
* Provides <code>CDOView</code> from <code>CDOSession</code> registered in IPluginContainer
*
@@ -70,6 +73,20 @@ public class PluginContainerViewProvider extends ManagedContainerViewProvider
}
@Override
+ public URI getResourceURI(CDOView view, String path)
+ {
+ if (path == null)
+ {
+ path = "";
+ }
+
+ String authority = view.getSession().getRepositoryInfo().getUUID();
+ String[] segments = new Path(path).segments();
+
+ return URI.createHierarchicalURI(CDOURIUtil.PROTOCOL_NAME, authority, null, segments, null, null);
+ }
+
+ @Override
protected IManagedContainer getContainer()
{
return IPluginContainer.INSTANCE;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOViewSet.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOViewSet.java
index 43a7b7942a..d52069af77 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOViewSet.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOViewSet.java
@@ -31,6 +31,9 @@ public interface InternalCDOViewSet extends CDOViewSet, Adapter
public void remove(InternalCDOView view);
+ /**
+ * @since 4.4
+ */
public InternalCDOView resolveView(URI viewURI);
@Deprecated

Back to the top