Community
Participate
Working Groups
Due to the fix for bug 335675, an IllArgEx will get thrown when trying to fetch a value from a revision for a non-persistent feat. But removeCrossRefs doesn't check whether the ref under inspection is in fact persistent (CDOTransactionImpl.java:2095) before fetching the value from the 'cleanRevision'.
While debugging this I realized that the catch {ArrayIndexOutOfBoundsEx} clause in CDOClassInfoImpl.getFeatureIndex(EStructuralFeature) is now unnecessary: the featureIDmappings array contains an entry for every feature. Will patch this here as well.
### Eclipse Workspace Patch 1.0 #P org.eclipse.emf.cdo Index: src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java =================================================================== --- src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java (revision 6984) +++ src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java (working copy) @@ -2085,8 +2085,10 @@ // In the case of DIRTY, we must investigate further: Is the referencer dirty // because a reference to the referencedObject was added? Only in this case // should we remove it. If this is not the case (i.e. it is dirty in a different - // way, we must ignore it.) - if (referencer.cdoState() == CDOState.DIRTY) + // way), we skip it. (If the reference is not persistent, then this exception + // doesn't apply: it must be removed for sure.) + // + if (referencer.cdoState() == CDOState.DIRTY && EMFUtil.isPersistent(reference)) { InternalCDORevision cleanRevision = getSession().getRevisionManager().getRevisionByVersion( referencer.cdoID(), referencer.cdoRevision(), CDORevision.UNCHUNKED, true); #P org.eclipse.emf.cdo.common Index: src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java =================================================================== --- src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java (revision 6984) +++ src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java (working copy) @@ -79,15 +79,8 @@ public int getFeatureIndex(EStructuralFeature feature) { - try - { - int featureID = getEClass().getFeatureID(feature); - return getFeatureIndex(featureID); - } - catch (ArrayIndexOutOfBoundsException ex) - { - throw new IllegalStateException("Feature not mapped: " + feature, ex); //$NON-NLS-1$ - } + int featureID = getEClass().getFeatureID(feature); + return getFeatureIndex(featureID); } public int getFeatureIndex(int featureID)
More trouble.. removeCrossReferences shouldn't touch derived features, but it does. Updated patch forthcoming.
Created attachment 188118 [details] Patch v2
Committed to trunk, rev. 7011
Available in R20110608-1407