summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-04 04:00:25 (EDT)
committerEike Stepper2007-07-04 04:00:25 (EDT)
commit22412974fd3b221b4d779c6a0de446c23641591b (patch)
tree1dc39f3ca657d18210988c98096d453afcbd5750
parent88c7698ad55eb66d7f99e733c276e6d08a37ee4d (diff)
downloadcdo-22412974fd3b221b4d779c6a0de446c23641591b.zip
cdo-22412974fd3b221b4d779c6a0de446c23641591b.tar.gz
cdo-22412974fd3b221b4d779c6a0de446c23641591b.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java27
1 files changed, 15 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java
index 29db35d..e95ad32 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceFactoryImpl.java
@@ -12,7 +12,6 @@ package org.eclipse.emf.cdo.eresource.impl;
import org.eclipse.emf.cdo.eresource.CDOResourceFactory;
import org.eclipse.emf.cdo.eresource.EresourceFactory;
-import org.eclipse.emf.cdo.protocol.util.ImplementationError;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
@@ -42,25 +41,29 @@ public class CDOResourceFactoryImpl implements Resource.Factory, CDOResourceFact
private boolean isExistingResource()
{
+ boolean inResourceSet = false;
StackTraceElement[] elements = Thread.currentThread().getStackTrace();
- if (elements.length >= 6)
+ for (int i = 3; i < elements.length; i++)
{
- if (isResourceSetMethod(elements[6], "getResource"))
+ StackTraceElement element = elements[i];
+ if (RESOURCE_SET_CLASS_NAME.equals(element.getClassName()))
{
- return true;
+ inResourceSet = true;
+ }
+ else
+ {
+ if (inResourceSet)
+ {
+ break;
+ }
}
- if (isResourceSetMethod(elements[4], "createResource"))
+ if (inResourceSet && "getResource".equals(element.getMethodName()))
{
- return false;
+ return true;
}
}
- throw new ImplementationError("Call stack is in unexpected state");
- }
-
- private boolean isResourceSetMethod(StackTraceElement element, String methodName)
- {
- return methodName.equals(element.getMethodName()) && RESOURCE_SET_CLASS_NAME.equals(element.getClassName());
+ return false;
}
}