Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 251544 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/emf/cdo/tests/AllTestsAllConfigs.java (+2 lines)
Lines 22-27 Link Here
22
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_250757_Test;
22
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_250757_Test;
23
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_251087_Test;
23
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_251087_Test;
24
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_251263_Test;
24
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_251263_Test;
25
import org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_251544_Test;
25
import org.eclipse.emf.cdo.tests.config.ConfigTest;
26
import org.eclipse.emf.cdo.tests.config.ConfigTest;
26
import org.eclipse.emf.cdo.tests.config.ConfigTestSuite;
27
import org.eclipse.emf.cdo.tests.config.ConfigTestSuite;
27
28
Lines 89-94 Link Here
89
    testClasses.add(Bugzilla_250757_Test.class);
90
    testClasses.add(Bugzilla_250757_Test.class);
90
    testClasses.add(Bugzilla_251087_Test.class);
91
    testClasses.add(Bugzilla_251087_Test.class);
91
    testClasses.add(Bugzilla_251263_Test.class);
92
    testClasses.add(Bugzilla_251263_Test.class);
93
    testClasses.add(Bugzilla_251544_Test.class);
92
94
93
    // TODO testClasses.add(NonCDOResourceTest.class);
95
    // TODO testClasses.add(NonCDOResourceTest.class);
94
    // TODO testClasses.add(GeneratedEcoreTest.class);
96
    // TODO testClasses.add(GeneratedEcoreTest.class);
(-)src/org/eclipse/emf/cdo/tests/TransactionTest.java (-2 lines)
Lines 63-69 Link Here
63
    }
63
    }
64
  }
64
  }
65
65
66
  @SuppressWarnings("deprecation")
67
  public void testCreateManyTransactions() throws Exception
66
  public void testCreateManyTransactions() throws Exception
68
  {
67
  {
69
    msg("Opening session");
68
    msg("Opening session");
Lines 79-85 Link Here
79
      msg("Transaction " + i + "    (" + lastDuration + ")");
78
      msg("Transaction " + i + "    (" + lastDuration + ")");
80
      lastDuration = System.currentTimeMillis();
79
      lastDuration = System.currentTimeMillis();
81
      transaction = session.openTransaction();
80
      transaction = session.openTransaction();
82
      transaction.setUniqueResourceContents(false);
83
      resource = transaction.getResource("/test2");
81
      resource = transaction.getResource("/test2");
84
      Category category = getModel1Factory().createCategory();
82
      Category category = getModel1Factory().createCategory();
85
      resource.getContents().add(category);
83
      resource.getContents().add(category);
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246456_Test.java (-2 lines)
Lines 24-30 Link Here
24
 */
24
 */
25
public class Bugzilla_246456_Test extends AbstractCDOTest
25
public class Bugzilla_246456_Test extends AbstractCDOTest
26
{
26
{
27
  @SuppressWarnings("deprecation")
28
  public void testBugzilla_246456() throws Exception
27
  public void testBugzilla_246456() throws Exception
29
  {
28
  {
30
    msg("Opening session");
29
    msg("Opening session");
Lines 36-42 Link Here
36
        .setCapacityRevised(10);
35
        .setCapacityRevised(10);
37
    ((LRURevisionCache)((TwoLevelRevisionCache)transaction.getSession().getRevisionManager().getCache()).getLevel1())
36
    ((LRURevisionCache)((TwoLevelRevisionCache)transaction.getSession().getRevisionManager().getCache()).getLevel1())
38
        .setCapacityCurrent(10);
37
        .setCapacityCurrent(10);
39
    transaction.setUniqueResourceContents(false);
40
38
41
    msg("Creating resource");
39
    msg("Creating resource");
42
    CDOResource resource = transaction.createResource("/test1");
40
    CDOResource resource = transaction.createResource("/test1");
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_251544_Test.java (+64 lines)
Added Link Here
1
package org.eclipse.emf.cdo.tests.bugzilla;
2
3
import org.eclipse.emf.cdo.CDOSession;
4
import org.eclipse.emf.cdo.CDOTransaction;
5
import org.eclipse.emf.cdo.eresource.CDOResource;
6
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
7
import org.eclipse.emf.cdo.tests.model1.Order;
8
import org.eclipse.emf.cdo.tests.model1.OrderDetail;
9
10
import org.eclipse.emf.common.util.EList;
11
import org.eclipse.emf.ecore.EObject;
12
13
/**
14
 * Resources fetched using CDOViewImpl.getResource(CDOID) not added to ResourceSet
15
 * <p>
16
 * See https://bugs.eclipse.org/251544
17
 * 
18
 * @author Simon McDuff
19
 */
20
public class Bugzilla_251544_Test extends AbstractCDOTest
21
{
22
  public void testFromPersistedToTransient() throws Exception
23
  {
24
    CDOSession session = openModel1Session();
25
    CDOTransaction transaction = session.openTransaction();
26
    CDOResource resource = transaction.createResource("/my/resource");
27
28
    Order order1 = getModel1Factory().createOrder();
29
    OrderDetail orderDetail = getModel1Factory().createOrderDetail();
30
    EList<EObject> contentList = resource.getContents();
31
    resource.getContents().add(order1);
32
    order1.getOrderDetails().add(orderDetail);
33
    EList<OrderDetail> list = order1.getOrderDetails();
34
    resource.getContents().remove(0); // remove object by index
35
    list.remove(orderDetail);
36
37
    transaction.commit();
38
39
    resource.delete(null);
40
41
    assertSame(contentList, resource.getContents());
42
  }
43
44
  public void testFromTransientToPersisted() throws Exception
45
  {
46
    CDOSession session = openModel1Session();
47
    CDOTransaction transaction = session.openTransaction();
48
    CDOResource resource = transaction.createResource("/my/resource");
49
50
    Order order1 = getModel1Factory().createOrder();
51
    OrderDetail orderDetail = getModel1Factory().createOrderDetail();
52
    EList<OrderDetail> orderDetails = order1.getOrderDetails();
53
    order1.getOrderDetails().add(orderDetail);
54
55
    msg("Persist the graph");
56
    resource.getContents().add(order1);
57
    assertSame(orderDetails, order1.getOrderDetails());
58
    resource.getContents().remove(0); // remove object by index
59
    assertSame(orderDetails, order1.getOrderDetails());
60
    assertEquals(true, orderDetails.remove(orderDetail));
61
    transaction.commit();
62
  }
63
64
}
(-)src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java (-166 / +63 lines)
Lines 48-59 Link Here
48
import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
48
import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
49
import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
49
import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
50
import org.eclipse.emf.ecore.util.InternalEList;
50
import org.eclipse.emf.ecore.util.InternalEList;
51
import org.eclipse.emf.ecore.util.NotifyingInternalEListImpl;
52
51
53
import java.io.IOException;
52
import java.io.IOException;
54
import java.io.InputStream;
53
import java.io.InputStream;
55
import java.io.OutputStream;
54
import java.io.OutputStream;
56
import java.util.Collection;
57
import java.util.Iterator;
55
import java.util.Iterator;
58
import java.util.Map;
56
import java.util.Map;
59
57
Lines 257-274 Link Here
257
  @SuppressWarnings("unchecked")
255
  @SuppressWarnings("unchecked")
258
  public EList<EObject> getContents()
256
  public EList<EObject> getContents()
259
  {
257
  {
260
    if (FSMUtil.isTransient(this))
258
    /*
261
    {
259
     * if (FSMUtil.isTransient(this)) { EList<EObject> transientContents =
262
      EList<EObject> transientContents = (EList<EObject>)eSettings[EresourcePackage.CDO_RESOURCE__CONTENTS];
260
     * (EList<EObject>)eSettings[EresourcePackage.CDO_RESOURCE__CONTENTS]; if (transientContents == null) {
263
      if (transientContents == null)
261
     * transientContents = new TransientContents<EObject>(); eSettings[EresourcePackage.CDO_RESOURCE__CONTENTS] =
264
      {
262
     * transientContents; // throw new ImplementationError(); } return transientContents; }
265
        transientContents = new TransientContents<EObject>();
263
     */
266
        eSettings[EresourcePackage.CDO_RESOURCE__CONTENTS] = transientContents;
267
        // throw new ImplementationError();
268
      }
269
270
      return transientContents;
271
    }
272
264
273
    return (EList<EObject>)eGet(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS, true);
265
    return (EList<EObject>)eGet(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS, true);
274
  }
266
  }
Lines 846-852 Link Here
846
  {
838
  {
847
    if (eStructuralFeature == EresourcePackage.eINSTANCE.getCDOResource_Contents())
839
    if (eStructuralFeature == EresourcePackage.eINSTANCE.getCDOResource_Contents())
848
    {
840
    {
849
      return new PersistentContents(eStructuralFeature);
841
      return new CDOContentEList(eStructuralFeature);
850
    }
842
    }
851
843
852
    return super.createList(eStructuralFeature);
844
    return super.createList(eStructuralFeature);
Lines 857-875 Link Here
857
   * 
849
   * 
858
   * @ADDED
850
   * @ADDED
859
   * @author Eike Stepper
851
   * @author Eike Stepper
852
   * @since 2.0
860
   */
853
   */
861
  protected class PersistentContents extends CDOStoreEList<Object>
854
  protected class CDOContentEList extends BasicEStoreEList<Object>
862
  {
855
  {
863
    private static final long serialVersionUID = 1L;
856
    private static final long serialVersionUID = 1L;
864
857
865
    @SuppressWarnings("deprecation")
858
    public CDOContentEList(EStructuralFeature eStructuralFeature)
866
    public PersistentContents(EStructuralFeature eStructuralFeature)
867
    {
859
    {
868
      super(eStructuralFeature);
860
      super(CDOResourceImpl.this, eStructuralFeature);
869
      if (!cdoView().hasUniqueResourceContents())
870
      {
871
        kind &= ~IS_UNIQUE;
872
      }
873
    }
861
    }
874
862
875
    /**
863
    /**
Lines 890-904 Link Here
890
    @Override
878
    @Override
891
    public NotificationChain inverseAdd(Object object, NotificationChain notifications)
879
    public NotificationChain inverseAdd(Object object, NotificationChain notifications)
892
    {
880
    {
893
      CDOTransactionImpl transaction = cdoView().toTransaction();
881
      if (FSMUtil.isTransient(CDOResourceImpl.this))
894
      InternalCDOObject cdoObject = FSMUtil.adapt(object, transaction);
895
      notifications = cdoObject.eSetResource(CDOResourceImpl.this, notifications);
896
      // Attach here instead of i CDOObjectImpl.eSetResource because EMF does it also here
897
      if (FSMUtil.isTransient(cdoObject))
898
      {
882
      {
899
        attached(cdoObject, transaction);
883
        InternalEObject eObject = (InternalEObject)object;
884
        notifications = eObject.eSetResource(CDOResourceImpl.this, notifications);
885
      }
886
      else
887
      {
888
        CDOTransactionImpl transaction = cdoView().toTransaction();
889
        InternalCDOObject cdoObject = FSMUtil.adapt(object, transaction);
890
        notifications = cdoObject.eSetResource(CDOResourceImpl.this, notifications);
891
        // Attach here instead of i CDOObjectImpl.eSetResource because EMF does it also here
892
        if (FSMUtil.isTransient(cdoObject))
893
        {
894
          attached(cdoObject, transaction);
895
        }
900
      }
896
      }
901
902
      return notifications;
897
      return notifications;
903
    }
898
    }
904
899
Lines 908-1054 Link Here
908
    @Override
903
    @Override
909
    public NotificationChain inverseRemove(Object object, NotificationChain notifications)
904
    public NotificationChain inverseRemove(Object object, NotificationChain notifications)
910
    {
905
    {
911
      InternalEObject eObject = (InternalEObject)object;
906
      if (FSMUtil.isTransient(CDOResourceImpl.this))
912
      detached(eObject);
913
      return eObject.eSetResource(null, notifications);
914
    }
915
  }
916
917
  /**
918
   * TODO Change superclass to NotifyingInternalEListImpl when EMF 2.3 is out of maintenance
919
   * <p>
920
   * TODO Reuse {@link ResourceImpl.ContentsEList}!!! --> Bugzilla!
921
   * 
922
   * @ADDED
923
   * @author Eike Stepper
924
   */
925
  protected class TransientContents<E extends Object & EObject> extends NotifyingInternalEListImpl<E>
926
  {
927
    private static final long serialVersionUID = 1L;
928
929
    public TransientContents()
930
    {
931
    }
932
933
    public TransientContents(Collection<? extends E> collection)
934
    {
935
      super(collection);
936
    }
937
938
    public TransientContents(int initialCapacity)
939
    {
940
      super(initialCapacity);
941
    }
942
943
    /**
944
     * Optimization taken from ResourceImpl.EContentList.contains
945
     * 
946
     * @since 2.0
947
     */
948
    @Override
949
    public boolean contains(Object object)
950
    {
951
      return size <= 4 ? super.contains(object) : object instanceof InternalEObject
952
          && ((InternalEObject)object).eDirectResource() == CDOResourceImpl.this;
953
    }
954
955
    @Override
956
    public Object getNotifier()
957
    {
958
      return CDOResourceImpl.this;
959
    }
960
961
    @Override
962
    public int getFeatureID()
963
    {
964
      return EresourcePackage.CDO_RESOURCE__CONTENTS;
965
    }
966
967
    @Override
968
    protected boolean isNotificationRequired()
969
    {
970
      return eNotificationRequired();
971
    }
972
973
    @Override
974
    protected boolean useEquals()
975
    {
976
      return false;
977
    }
978
979
    @Override
980
    protected boolean hasInverse()
981
    {
982
      return true;
983
    }
984
985
    @Override
986
    protected boolean isUnique()
987
    {
988
      return true;
989
    }
990
991
    /**
992
     * @since 2.0
993
     */
994
    /*
995
     * IMPORTANT: Compile errors in this method might indicate an old version of EMF. Legacy support is only enabled for
996
     * EMF with fixed bug #247130. These compile errors do not affect native models!
997
     */
998
    public InternalEList<E> readWriteFiringList()
999
    {
1000
      return this;
1001
    }
1002
1003
    @Override
1004
    public NotificationChain inverseAdd(E object, NotificationChain notifications)
1005
    {
1006
      InternalEObject eObject = (InternalEObject)object;
1007
      notifications = eObject.eSetResource(CDOResourceImpl.this, notifications);
1008
      // CDOResourceImpl.this.attached(eObject);
1009
      return notifications;
1010
    }
1011
1012
    @Override
1013
    public NotificationChain inverseRemove(E object, NotificationChain notifications)
1014
    {
1015
      InternalEObject eObject = (InternalEObject)object;
1016
      // CDOResourceImpl.this.detached(eObject);
1017
      return eObject.eSetResource(null, notifications);
1018
    }
1019
1020
    @Override
1021
    protected void didAdd(int index, E object)
1022
    {
1023
      super.didAdd(index, object);
1024
      modified();
1025
    }
1026
1027
    @Override
1028
    protected void didRemove(int index, E object)
1029
    {
1030
      super.didRemove(index, object);
1031
      modified();
1032
    }
1033
1034
    @Override
1035
    protected void didSet(int index, E newObject, E oldObject)
1036
    {
1037
      super.didSet(index, newObject, oldObject);
1038
      modified();
1039
    }
1040
1041
    @Override
1042
    protected void didClear(int oldSize, Object[] oldData)
1043
    {
1044
      if (oldSize == 0)
1045
      {
907
      {
1046
        loaded();
908
        InternalEObject eObject = (InternalEObject)object;
909
        notifications = eObject.eSetResource(null, notifications);
1047
      }
910
      }
1048
      else
911
      else
1049
      {
912
      {
1050
        super.didClear(oldSize, oldData);
913
        InternalEObject eObject = (InternalEObject)object;
914
        detached(eObject);
915
        notifications = eObject.eSetResource(null, notifications);
1051
      }
916
      }
917
      return notifications;
1052
    }
918
    }
1053
919
1054
    /**
920
    /**
Lines 1066-1071 Link Here
1066
      }
932
      }
1067
    }
933
    }
1068
934
935
    /**
936
     * @since 2.0
937
     */
1069
    protected void modified()
938
    protected void modified()
1070
    {
939
    {
1071
      if (isTrackingModification())
940
      if (isTrackingModification())
Lines 1073-1077 Link Here
1073
        setModified(true);
942
        setModified(true);
1074
      }
943
      }
1075
    }
944
    }
945
946
    /**
947
     * @since 2.0
948
     */
949
    @Override
950
    protected boolean useEquals()
951
    {
952
      return false;
953
    }
954
955
    /**
956
     * @since 2.0
957
     */
958
    @Override
959
    protected boolean hasInverse()
960
    {
961
      return true;
962
    }
963
964
    /**
965
     * @since 2.0
966
     */
967
    @Override
968
    protected boolean isUnique()
969
    {
970
      return true;
971
    }
1076
  }
972
  }
973
1077
} // CDOResourceImpl
974
} // CDOResourceImpl
(-)src/org/eclipse/emf/cdo/CDOView.java (-26 lines)
Lines 165-196 Link Here
165
  public boolean hasConflict();
165
  public boolean hasConflict();
166
166
167
  /**
167
  /**
168
   * @see #setUniqueResourceContents(boolean)
169
   * @deprecated This performance tweak is not necessary with EMF 2.5 anymore and is likely to be removed when CDO
170
   *             reaches 2.0. In the meantime it can be safely used.
171
   */
172
  @Deprecated
173
  public boolean hasUniqueResourceContents();
174
175
  /**
176
   * Specifies whether the contents list of resources will be unique or not.
177
   * <p>
178
   * This property is transient in that it does not stick with resources outside of the scope of this view. Especially
179
   * it will not be persisted with resources in the repository. Each new view will start with <code>true</code> as a
180
   * default value. Changing to <code>false</code> will subsequently apply to all resources being loaded or created.
181
   * <p>
182
   * Notice that the resource contents is a containment list and as such <b>must be</b> unique. Setting this property to
183
   * <code>false</code> is only recommended for performance optimization when uniqueness is granted by other means.
184
   * Violating the uniqueness constraint will result in unpredictable behaviour and possible corruption of the
185
   * repository!
186
   * 
187
   * @deprecated This performance tweak is not necessary with EMF 2.5 anymore and is likely to be removed when CDO
188
   *             reaches 2.0. In the meantime it can be safely used.
189
   */
190
  @Deprecated
191
  public void setUniqueResourceContents(boolean uniqueResourceContents);
192
193
  /**
194
   * Returns <code>true</code> if the {@link CDOObject objects} in this view will notify their
168
   * Returns <code>true</code> if the {@link CDOObject objects} in this view will notify their
195
   * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are <em>invalidated</em> (due to
169
   * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are <em>invalidated</em> (due to
196
   * remote changes), <code>false</code> otherwise.
170
   * remote changes), <code>false</code> otherwise.
(-)src/org/eclipse/emf/internal/cdo/CDOViewImpl.java (-14 lines)
Lines 100-107 Link Here
100
100
101
  private CDOURIHandler uriHandler = new CDOURIHandler(this);
101
  private CDOURIHandler uriHandler = new CDOURIHandler(this);
102
102
103
  private boolean uniqueResourceContents = true;
104
105
  private boolean invalidationNotificationEnabled;
103
  private boolean invalidationNotificationEnabled;
106
104
107
  private CDORevisionPrefetchingPolicy revisionPrefetchingPolicy;
105
  private CDORevisionPrefetchingPolicy revisionPrefetchingPolicy;
Lines 225-242 Link Here
225
    return false;
223
    return false;
226
  }
224
  }
227
225
228
  @Deprecated
229
  public boolean hasUniqueResourceContents()
230
  {
231
    return uniqueResourceContents;
232
  }
233
234
  @Deprecated
235
  public void setUniqueResourceContents(boolean uniqueResourceContents)
236
  {
237
    this.uniqueResourceContents = uniqueResourceContents;
238
  }
239
240
  /**
226
  /**
241
   * @since 2.0
227
   * @since 2.0
242
   */
228
   */
(-)src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java (-246 / +175 lines)
Lines 34-39 Link Here
34
import org.eclipse.emf.common.notify.Adapter;
34
import org.eclipse.emf.common.notify.Adapter;
35
import org.eclipse.emf.common.notify.Notification;
35
import org.eclipse.emf.common.notify.Notification;
36
import org.eclipse.emf.common.notify.NotificationChain;
36
import org.eclipse.emf.common.notify.NotificationChain;
37
import org.eclipse.emf.common.util.BasicEList;
37
import org.eclipse.emf.common.util.BasicEMap;
38
import org.eclipse.emf.common.util.BasicEMap;
38
import org.eclipse.emf.common.util.ECollections;
39
import org.eclipse.emf.common.util.ECollections;
39
import org.eclipse.emf.common.util.EList;
40
import org.eclipse.emf.common.util.EList;
Lines 49-55 Link Here
49
import org.eclipse.emf.ecore.impl.EStoreEObjectImpl;
50
import org.eclipse.emf.ecore.impl.EStoreEObjectImpl;
50
import org.eclipse.emf.ecore.resource.Resource;
51
import org.eclipse.emf.ecore.resource.Resource;
51
import org.eclipse.emf.ecore.resource.Resource.Internal;
52
import org.eclipse.emf.ecore.resource.Resource.Internal;
52
import org.eclipse.emf.ecore.util.DelegatingEcoreEList;
53
import org.eclipse.emf.ecore.util.DelegatingFeatureMap;
53
import org.eclipse.emf.ecore.util.DelegatingFeatureMap;
54
import org.eclipse.emf.ecore.util.EcoreEList;
54
import org.eclipse.emf.ecore.util.EcoreEList;
55
import org.eclipse.emf.ecore.util.EcoreEMap;
55
import org.eclipse.emf.ecore.util.EcoreEMap;
Lines 77-86 Link Here
77
77
78
  private InternalCDORevision revision;
78
  private InternalCDORevision revision;
79
79
80
  /**
81
   * CDO used this list instead of eSettings for transient objects. EMF used eSettings as cache. CDO deactivate the
82
   * cache but EMF still use eSettings to store list wrapper. CDO needs another place to store the real list with the
83
   * actual data (transient mode) and accessible through EStore. This allow CDO to always use the same instance of the
84
   * list wrapper.
85
   */
86
  private transient Object eTransientSettings[];
87
80
  public CDOObjectImpl()
88
  public CDOObjectImpl()
81
  {
89
  {
82
    state = CDOState.TRANSIENT;
90
    state = CDOState.TRANSIENT;
83
    eContainer = null;
91
    eContainer = null;
92
    eTransientSettings = null;
84
  }
93
  }
85
94
86
  public CDOID cdoID()
95
  public CDOID cdoID()
Lines 98-103 Link Here
98
    return revision;
107
    return revision;
99
  }
108
  }
100
109
110
  /**
111
   * @since 2.0
112
   */
113
  protected Object[] eTransientSettings()
114
  {
115
    if (eTransientSettings == null)
116
    {
117
      int size = eClass().getFeatureCount() - eStaticFeatureCount();
118
      eTransientSettings = size == 0 ? ENO_SETTINGS : new Object[size];
119
    }
120
    return eTransientSettings;
121
  }
122
123
  /**
124
   * @since 2.0
125
   */
126
  protected Object[] eBasicTransientSettings()
127
  {
128
    return eTransientSettings;
129
  }
130
101
  public CDOClass cdoClass()
131
  public CDOClass cdoClass()
102
  {
132
  {
103
    return getCDOClass(this);
133
    return getCDOClass(this);
Lines 201-206 Link Here
201
231
202
  public void cdoInternalPostLoad()
232
  public void cdoInternalPostLoad()
203
  {
233
  {
234
    // Reset EMAP objects
204
    if (eSettings != null)
235
    if (eSettings != null)
205
    {
236
    {
206
      // Make sure transient feature are kept but persisted value are not cached.
237
      // Make sure transient feature are kept but persisted value are not cached.
Lines 230-249 Link Here
230
   */
261
   */
231
  public void cdoInternalCleanup()
262
  public void cdoInternalCleanup()
232
  {
263
  {
233
    if (eSettings != null)
264
234
    {
235
      // Make sure transient feature are kept but persisted value are not cached.
236
      EClass eClass = eClass();
237
      for (int i = 0; i < eClass.getFeatureCount(); i++)
238
      {
239
        EStructuralFeature eFeature = cdoInternalDynamicFeature(i);
240
        // We need to keep the existing list if possible.
241
        if (!eFeature.isTransient())
242
        {
243
          eSettings[i] = null;
244
        }
245
      }
246
    }
247
  }
265
  }
248
266
249
  public void cdoInternalPostAttach()
267
  public void cdoInternalPostAttach()
Lines 263-270 Link Here
263
      revision.setResourceID(cdoResource.cdoID());
281
      revision.setResourceID(cdoResource.cdoID());
264
    }
282
    }
265
283
266
    eSettings();
267
268
    EClass eClass = eClass();
284
    EClass eClass = eClass();
269
    for (int i = 0; i < eClass.getFeatureCount(); i++)
285
    for (int i = 0; i < eClass.getFeatureCount(); i++)
270
    {
286
    {
Lines 274-279 Link Here
274
        populateRevisionFeature(view, revision, eFeature, eSettings, i);
290
        populateRevisionFeature(view, revision, eFeature, eSettings, i);
275
      }
291
      }
276
    }
292
    }
293
    eTransientSettings = null;
277
  }
294
  }
278
295
279
  @SuppressWarnings("unchecked")
296
  @SuppressWarnings("unchecked")
Lines 287-298 Link Here
287
      TRACER.format("Populating feature {0}", cdoFeature);
304
      TRACER.format("Populating feature {0}", cdoFeature);
288
    }
305
    }
289
306
290
    Object setting = eSettings[i];
307
    Object setting = eBasicTransientSettings() != null ? eTransientSettings()[i] : null;
291
    if (setting == null)
308
    if (setting == null)
292
    {
309
    {
293
      setting = eFeature.getDefaultValue();
310
      setting = eFeature.getDefaultValue();
294
    }
311
    }
295
296
    if (cdoFeature.isMany())
312
    if (cdoFeature.isMany())
297
    {
313
    {
298
      if (setting != null)
314
      if (setting != null)
Lines 330-342 Link Here
330
346
331
      revision.set(cdoFeature, 0, setting);
347
      revision.set(cdoFeature, 0, setting);
332
    }
348
    }
333
334
    if (eSettings != null)
335
    {
336
      eSettings[i] = null;
337
    }
338
  }
349
  }
339
350
351
  /**
352
   * It is really important to access the data to go through getStore. eStore will redirect you to the transient data.
353
   */
340
  public void cdoInternalPostDetach()
354
  public void cdoInternalPostDetach()
341
  {
355
  {
342
    if (TRACER.isEnabled())
356
    if (TRACER.isEnabled())
Lines 346-352 Link Here
346
360
347
    CDOViewImpl view = cdoView();
361
    CDOViewImpl view = cdoView();
348
    super.eSetDirectResource(cdoDirectResource());
362
    super.eSetDirectResource(cdoDirectResource());
349
    eContainer = eStore().getContainer(this);
363
    eContainer = getStore().getContainer(this);
350
    eContainerFeatureID = getStore().getContainingFeatureID(this);
364
    eContainerFeatureID = getStore().getContainingFeatureID(this);
351
    if (eContainer != null && eContainmentFeature().isResolveProxies())
365
    if (eContainer != null && eContainmentFeature().isResolveProxies())
352
    {
366
    {
Lines 354-360 Link Here
354
    }
368
    }
355
369
356
    // Ensure that the internal eSettings array is initialized;
370
    // Ensure that the internal eSettings array is initialized;
357
    eSettings();
371
    eTransientSettings = null;
372
    eTransientSettings();
358
373
359
    EClass eClass = eClass();
374
    EClass eClass = eClass();
360
    for (int i = 0; i < eClass.getFeatureCount(); i++)
375
    for (int i = 0; i < eClass.getFeatureCount(); i++)
Lines 367-373 Link Here
367
    }
382
    }
368
  }
383
  }
369
384
370
  @SuppressWarnings("unchecked")
371
  private void depopulateRevisionFeature(CDOViewImpl view, InternalCDORevision revision, EStructuralFeature eFeature,
385
  private void depopulateRevisionFeature(CDOViewImpl view, InternalCDORevision revision, EStructuralFeature eFeature,
372
      Object[] eSettings, int i)
386
      Object[] eSettings, int i)
373
  {
387
  {
Lines 379-395 Link Here
379
    EStructuralFeature.Internal internalFeature = (EStructuralFeature.Internal)eFeature;
393
    EStructuralFeature.Internal internalFeature = (EStructuralFeature.Internal)eFeature;
380
    EReference oppositeReference = cdoID().isTemporary() ? null : internalFeature.getEOpposite();
394
    EReference oppositeReference = cdoID().isTemporary() ? null : internalFeature.getEOpposite();
381
395
396
    CDOStore cdoStore = getStore();
397
    EStore transientStore = eStore();
382
    if (eFeature.isMany())
398
    if (eFeature.isMany())
383
    {
399
    {
384
      eSettings[i] = null;
400
385
      InternalEList<Object> setting = (InternalEList<Object>)eGet(eFeature, true);
401
      int size = cdoStore.size(this, eFeature);
386
      int size = eStore().size(this, eFeature);
387
      for (int index = 0; index < size; index++)
402
      for (int index = 0; index < size; index++)
388
      {
403
      {
389
        // Do not trigger events
404
        // Do not trigger events
390
        // Do not trigger inverse updates
405
        // Do not trigger inverse updates
391
        Object object = eStore().get(this, eFeature, index);
406
        Object object = cdoStore.get(this, eFeature, index);
392
        setting.basicAdd(object, null);
407
        transientStore.add(this, eFeature, index, object);
393
        if (oppositeReference != null)
408
        if (oppositeReference != null)
394
        {
409
        {
395
          adjustOppositeReference((InternalEObject)object, oppositeReference);
410
          adjustOppositeReference((InternalEObject)object, oppositeReference);
Lines 398-407 Link Here
398
    }
413
    }
399
    else
414
    else
400
    {
415
    {
401
      eSettings[i] = eStore().get(this, eFeature, 0);
416
      Object object = cdoStore.get(this, eFeature, EStore.NO_INDEX);
417
      transientStore.set(this, eFeature, EStore.NO_INDEX, object);
402
      if (oppositeReference != null)
418
      if (oppositeReference != null)
403
      {
419
      {
404
        adjustOppositeReference((InternalEObject)eSettings[i], oppositeReference);
420
        adjustOppositeReference((InternalEObject)object, oppositeReference);
405
      }
421
      }
406
    }
422
    }
407
  }
423
  }
Lines 534-540 Link Here
534
        public EStoreEcoreEMap()
550
        public EStoreEcoreEMap()
535
        {
551
        {
536
          super((EClass)eType, eType.getInstanceClass(), null);
552
          super((EClass)eType, eType.getInstanceClass(), null);
537
          delegateEList = new CDOStoreEList<BasicEMap.Entry<Object, Object>>(eStructuralFeature)
553
          delegateEList = new BasicEStoreEList<BasicEMap.Entry<Object, Object>>(CDOObjectImpl.this, eStructuralFeature)
538
          {
554
          {
539
            private static final long serialVersionUID = 1L;
555
            private static final long serialVersionUID = 1L;
540
556
Lines 576-582 Link Here
576
592
577
        private void checkListForReading()
593
        private void checkListForReading()
578
        {
594
        {
579
          CDOStateMachine.INSTANCE.read(CDOObjectImpl.this);
595
          if (!FSMUtil.isTransient(CDOObjectImpl.this))
596
          {
597
            CDOStateMachine.INSTANCE.read(CDOObjectImpl.this);
598
          }
580
        }
599
        }
581
600
582
        /**
601
        /**
Lines 641-647 Link Here
641
      return new EStoreEcoreEMap();
660
      return new EStoreEcoreEMap();
642
    }
661
    }
643
662
644
    return new CDOStoreEList<Object>(eStructuralFeature);
663
    return super.createList(eStructuralFeature);
645
  }
664
  }
646
665
647
  @Override
666
  @Override
Lines 682-760 Link Here
682
  }
701
  }
683
702
684
  /**
703
  /**
685
   * Don't cache non-transient features in this CDOObject's {@link #eSettings()}.
704
   * @since 2.0
686
   */
705
   */
687
  @Override
706
  @Override
688
  protected boolean eIsCaching()
707
  public InternalEObject.EStore eStore()
689
  {
690
    return false;
691
  }
692
693
  @Override
694
  public Object dynamicGet(int dynamicFeatureID)
695
  {
708
  {
696
    if (FSMUtil.isTransient(this))
709
    if (FSMUtil.isTransient(this))
697
    {
710
    {
698
      if (eSettings == null)
711
      return CDOStoreSettingsImpl.TRANSIENT_STORE;
699
      {
700
        return null;
701
      }
702
703
      return eSettings[dynamicFeatureID];
704
    }
705
706
    // Delegate to CDOStore
707
    return super.dynamicGet(dynamicFeatureID);
708
  }
709
710
  @Override
711
  public boolean eIsSet(EStructuralFeature feature)
712
  {
713
    if (FSMUtil.isTransient(this))
714
    {
715
      // TODO What about defaultValues != null?
716
      if (eSettings == null)
717
      {
718
        return false;
719
      }
720
721
      return eSettings[eDynamicFeatureID(feature)] != null;
722
    }
723
724
    // Delegate to CDOStore
725
    return super.eIsSet(feature);
726
  }
727
728
  @Override
729
  public void dynamicSet(int dynamicFeatureID, Object value)
730
  {
731
    if (FSMUtil.isTransient(this))
732
    {
733
      eSettings(); // Important to create eSettings array if necessary
734
      eSettings[dynamicFeatureID] = value;
735
    }
736
    else
737
    {
738
      // Delegate to CDOStore
739
      super.dynamicSet(dynamicFeatureID, value);
740
    }
712
    }
713
    return getStore();
741
  }
714
  }
742
715
716
  /**
717
   * Don't cache non-transient features in this CDOObject's {@link #eSettings()}.
718
   */
743
  @Override
719
  @Override
744
  public void dynamicUnset(int dynamicFeatureID)
720
  protected boolean eIsCaching()
745
  {
721
  {
746
    if (FSMUtil.isTransient(this))
722
    return false;
747
    {
748
      if (eSettings != null)
749
      {
750
        eSettings[dynamicFeatureID] = null;
751
      }
752
    }
753
    else
754
    {
755
      // Delegate to CDOStore
756
      super.dynamicUnset(dynamicFeatureID);
757
    }
758
  }
723
  }
759
724
760
  @Override
725
  @Override
Lines 993-1206 Link Here
993
958
994
  private CDOStore getStore()
959
  private CDOStore getStore()
995
  {
960
  {
996
    return (CDOStore)eStore();
961
    return cdoView().getStore();
997
  }
962
  }
998
963
999
  /**
964
  /**
1000
   * TODO Remove this when EMF has fixed http://bugs.eclipse.org/197487
965
   * @since 2.0
1001
   * 
1002
   * @author Eike Stepper
1003
   */
966
   */
1004
  public class CDOStoreEList<E> extends DelegatingEcoreEList.Dynamic<E>
967
  public static class CDOStoreSettingsImpl implements InternalEObject.EStore
1005
  {
968
  {
1006
    private static final long serialVersionUID = 1L;
969
    protected static CDOStoreSettingsImpl TRANSIENT_STORE = new CDOStoreSettingsImpl();
1007
970
1008
    public CDOStoreEList(EStructuralFeature eStructuralFeature)
971
    protected Object getValue(InternalEObject eObject, int dynamicFeatureID)
1009
    {
972
    {
1010
      super(CDOObjectImpl.this, eStructuralFeature);
973
      return ((CDOObjectImpl)eObject).eTransientSettings()[dynamicFeatureID];
1011
    }
1012
974
1013
    @Override
1014
    protected List<E> delegateList()
1015
    {
1016
      throw new UnsupportedOperationException();
1017
    }
975
    }
1018
976
1019
    @Override
977
    protected EList<Object> getValueAsList(InternalEObject eObject, int dynamicFeatureID)
1020
    public EStructuralFeature getEStructuralFeature()
1021
    {
978
    {
1022
      return eStructuralFeature;
979
      @SuppressWarnings("unchecked")
980
      EList<Object> result = (EList<Object>)getValue(eObject, dynamicFeatureID);
981
      if (result == null)
982
      {
983
        result = new BasicEList<Object>();
984
        ((CDOObjectImpl)eObject).eTransientSettings()[dynamicFeatureID] = result;
985
      }
986
      return result;
1023
    }
987
    }
1024
988
1025
    @Override
989
    protected Object setValue(InternalEObject eObject, int dynamicFeatureID, Object newValue)
1026
    protected void delegateAdd(int index, Object object)
1027
    {
990
    {
1028
      getStore().add(owner, eStructuralFeature, index, object);
991
      Object eSettings[] = ((CDOObjectImpl)eObject).eTransientSettings();
992
      try
993
      {
994
        return eSettings[dynamicFeatureID];
995
      }
996
      finally
997
      {
998
        eSettings[dynamicFeatureID] = newValue;
999
      }
1029
    }
1000
    }
1030
1001
1031
    @Override
1002
    protected int eDynamicFeatureID(InternalEObject eObject, EStructuralFeature feature)
1032
    protected void delegateAdd(Object object)
1033
    {
1003
    {
1034
      delegateAdd(delegateSize(), object);
1004
      return ((CDOObjectImpl)eObject).eDynamicFeatureID(feature);
1035
    }
1005
    }
1036
1006
1037
    @Override
1007
    public Object get(InternalEObject eObject, EStructuralFeature feature, int index)
1038
    protected List<E> delegateBasicList()
1039
    {
1008
    {
1040
      int size = delegateSize();
1009
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1041
      if (size == 0)
1010
      if (feature.isMany())
1042
      {
1011
      {
1043
        return ECollections.emptyEList();
1012
        return getValueAsList(eObject, dynamicFeatureID).get(index);
1044
      }
1013
      }
1045
1014
      return getValue(eObject, dynamicFeatureID);
1046
      Object[] data = getStore().toArray(owner, eStructuralFeature);
1047
      return new EcoreEList.UnmodifiableEList<E>(owner, eStructuralFeature, data.length, data);
1048
    }
1015
    }
1049
1016
1050
    @Override
1017
    public Object set(InternalEObject eObject, EStructuralFeature feature, int index, Object value)
1051
    protected void delegateClear()
1052
    {
1018
    {
1053
      getStore().clear(owner, eStructuralFeature);
1019
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1020
      if (feature.isMany())
1021
      {
1022
        return getValueAsList(eObject, dynamicFeatureID).set(index, value);
1023
      }
1024
      return setValue(eObject, dynamicFeatureID, value);
1054
    }
1025
    }
1055
1026
1056
    @Override
1027
    public void add(InternalEObject eObject, EStructuralFeature feature, int index, Object value)
1057
    protected boolean delegateContains(Object object)
1058
    {
1028
    {
1059
      return getStore().contains(owner, eStructuralFeature, object);
1029
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1030
      getValueAsList(eObject, dynamicFeatureID).add(index, value);
1060
    }
1031
    }
1061
1032
1062
    @Override
1033
    public Object remove(InternalEObject eObject, EStructuralFeature feature, int index)
1063
    protected boolean delegateContainsAll(Collection<?> collection)
1064
    {
1034
    {
1065
      for (Object o : collection)
1035
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1066
      {
1036
      return getValueAsList(eObject, dynamicFeatureID).remove(index);
1067
        if (!delegateContains(o))
1068
        {
1069
          return false;
1070
        }
1071
      }
1072
      return true;
1073
    }
1037
    }
1074
1038
1075
    @SuppressWarnings("unchecked")
1039
    public Object move(InternalEObject eObject, EStructuralFeature feature, int targetIndex, int sourceIndex)
1076
    @Override
1077
    protected E delegateGet(int index)
1078
    {
1040
    {
1079
      return (E)getStore().get(owner, eStructuralFeature, index);
1041
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1042
      return getValueAsList(eObject, dynamicFeatureID).move(targetIndex, sourceIndex);
1080
    }
1043
    }
1081
1044
1082
    @Override
1045
    public void clear(InternalEObject eObject, EStructuralFeature feature)
1083
    protected int delegateHashCode()
1084
    {
1046
    {
1085
      return getStore().hashCode(owner, eStructuralFeature);
1047
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1048
      if (feature.isMany())
1049
      {
1050
        getValueAsList(eObject, dynamicFeatureID).clear();
1051
      }
1052
      setValue(eObject, dynamicFeatureID, null);
1086
    }
1053
    }
1087
1054
1088
    @Override
1055
    public int size(InternalEObject eObject, EStructuralFeature feature)
1089
    protected int delegateIndexOf(Object object)
1090
    {
1056
    {
1091
      return getStore().indexOf(owner, eStructuralFeature, object);
1057
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1058
      return getValueAsList(eObject, dynamicFeatureID).size();
1092
    }
1059
    }
1093
1060
1094
    @Override
1061
    public int indexOf(InternalEObject eObject, EStructuralFeature feature, Object value)
1095
    protected boolean delegateIsEmpty()
1096
    {
1062
    {
1097
      return getStore().isEmpty(owner, eStructuralFeature);
1063
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1064
      return getValueAsList(eObject, dynamicFeatureID).indexOf(value);
1098
    }
1065
    }
1099
1066
1100
    @Override
1067
    public int lastIndexOf(InternalEObject eObject, EStructuralFeature feature, Object value)
1101
    protected Iterator<E> delegateIterator()
1102
    {
1068
    {
1103
      return iterator();
1069
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1070
      return getValueAsList(eObject, dynamicFeatureID).lastIndexOf(value);
1104
    }
1071
    }
1105
1072
1106
    @Override
1073
    public Object[] toArray(InternalEObject eObject, EStructuralFeature feature)
1107
    protected int delegateLastIndexOf(Object object)
1108
    {
1074
    {
1109
      return getStore().lastIndexOf(owner, eStructuralFeature, object);
1075
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1076
      return getValueAsList(eObject, dynamicFeatureID).toArray();
1110
    }
1077
    }
1111
1078
1112
    @Override
1079
    public <T> T[] toArray(InternalEObject eObject, EStructuralFeature feature, T[] array)
1113
    protected ListIterator<E> delegateListIterator()
1114
    {
1080
    {
1115
      return listIterator();
1081
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1082
      return getValueAsList(eObject, dynamicFeatureID).toArray(array);
1116
    }
1083
    }
1117
1084
1118
    @SuppressWarnings("unchecked")
1085
    public boolean isEmpty(InternalEObject eObject, EStructuralFeature feature)
1119
    @Override
1120
    protected E delegateRemove(int index)
1121
    {
1086
    {
1122
      return (E)getStore().remove(owner, eStructuralFeature, index);
1087
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1088
      return getValueAsList(eObject, dynamicFeatureID).isEmpty();
1123
    }
1089
    }
1124
1090
1125
    @SuppressWarnings("unchecked")
1091
    public boolean contains(InternalEObject eObject, EStructuralFeature feature, Object value)
1126
    @Override
1127
    protected E delegateSet(int index, E object)
1128
    {
1092
    {
1129
      return (E)getStore().set(owner, eStructuralFeature, index, object);
1093
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1094
      return getValueAsList(eObject, dynamicFeatureID).contains(value);
1130
    }
1095
    }
1131
1096
1132
    @Override
1097
    public int hashCode(InternalEObject eObject, EStructuralFeature feature)
1133
    protected int delegateSize()
1134
    {
1098
    {
1135
      return getStore().size(owner, eStructuralFeature);
1099
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1100
      return getValueAsList(eObject, dynamicFeatureID).hashCode();
1136
    }
1101
    }
1137
1102
1138
    @Override
1103
    public InternalEObject getContainer(InternalEObject eObject)
1139
    protected Object[] delegateToArray()
1140
    {
1104
    {
1141
      return getStore().toArray(owner, eStructuralFeature);
1105
      return null;
1142
    }
1106
    }
1143
1107
1144
    @Override
1108
    public EStructuralFeature getContainingFeature(InternalEObject eObject)
1145
    protected <T> T[] delegateToArray(T[] array)
1146
    {
1109
    {
1147
      return getStore().toArray(owner, eStructuralFeature, array);
1110
      // This should never be called.
1111
      //
1112
      throw new UnsupportedOperationException();
1113
      // Entry entry = new Entry(eObject, CONTAINING_FEATURE);
1114
      // return (EStructuralFeature)map.get(entry);
1148
    }
1115
    }
1149
1116
1150
    @SuppressWarnings("unchecked")
1117
    public EObject create(EClass eClass)
1151
    @Override
1152
    protected E delegateMove(int targetIndex, int sourceIndex)
1153
    {
1118
    {
1154
      return (E)getStore().move(owner, eStructuralFeature, targetIndex, sourceIndex);
1119
      InternalEObject result = new EStoreEObjectImpl(eClass, this);
1120
      return result;
1155
    }
1121
    }
1156
1122
1157
    @Override
1123
    public boolean isSet(InternalEObject eObject, EStructuralFeature feature)
1158
    protected boolean delegateEquals(Object object)
1159
    {
1124
    {
1160
      if (object == this)
1125
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1161
      {
1126
      return getValue(eObject, dynamicFeatureID) != null;
1162
        return true;
1163
      }
1164
1165
      if (!(object instanceof List))
1166
      {
1167
        return false;
1168
      }
1169
1170
      List<?> list = (List<?>)object;
1171
      if (list.size() != delegateSize())
1172
      {
1173
        return false;
1174
      }
1175
1176
      for (ListIterator<?> i = list.listIterator(); i.hasNext();)
1177
      {
1178
        Object element = i.next();
1179
        if (element == null ? get(i.previousIndex()) != null : !element.equals(get(i.previousIndex())))
1180
        {
1181
          return false;
1182
        }
1183
      }
1184
1185
      return true;
1186
    }
1127
    }
1187
1128
1188
    @Override
1129
    public void unset(InternalEObject eObject, EStructuralFeature feature)
1189
    protected String delegateToString()
1190
    {
1130
    {
1191
      StringBuffer stringBuffer = new StringBuffer();
1131
      int dynamicFeatureID = eDynamicFeatureID(eObject, feature);
1192
      stringBuffer.append("[");
1132
      setValue(eObject, dynamicFeatureID, null);
1193
      for (int i = 0, size = size(); i < size;)
1194
      {
1195
        Object value = delegateGet(i);
1196
        stringBuffer.append(String.valueOf(value));
1197
        if (++i < size)
1198
        {
1199
          stringBuffer.append(", ");
1200
        }
1201
      }
1202
      stringBuffer.append("]");
1203
      return stringBuffer.toString();
1204
    }
1133
    }
1205
  }
1134
  }
1206
1135
Lines 1233-1239 Link Here
1233
    @Override
1162
    @Override
1234
    protected void delegateAdd(int index, Entry object)
1163
    protected void delegateAdd(int index, Entry object)
1235
    {
1164
    {
1236
      getStore().add(owner, eStructuralFeature, index, object);
1165
      eStore().add(owner, eStructuralFeature, index, object);
1237
    }
1166
    }
1238
1167
1239
    @Override
1168
    @Override
Lines 1258-1270 Link Here
1258
    @Override
1187
    @Override
1259
    protected void delegateClear()
1188
    protected void delegateClear()
1260
    {
1189
    {
1261
      getStore().clear(owner, eStructuralFeature);
1190
      eStore().clear(owner, eStructuralFeature);
1262
    }
1191
    }
1263
1192
1264
    @Override
1193
    @Override
1265
    protected boolean delegateContains(Object object)
1194
    protected boolean delegateContains(Object object)
1266
    {
1195
    {
1267
      return getStore().contains(owner, eStructuralFeature, object);
1196
      return eStore().contains(owner, eStructuralFeature, object);
1268
    }
1197
    }
1269
1198
1270
    @Override
1199
    @Override
Lines 1283-1307 Link Here
1283
    @Override
1212
    @Override
1284
    protected Entry delegateGet(int index)
1213
    protected Entry delegateGet(int index)
1285
    {
1214
    {
1286
      return (Entry)getStore().get(owner, eStructuralFeature, index);
1215
      return (Entry)eStore().get(owner, eStructuralFeature, index);
1287
    }
1216
    }
1288
1217
1289
    @Override
1218
    @Override
1290
    protected int delegateHashCode()
1219
    protected int delegateHashCode()
1291
    {
1220
    {
1292
      return getStore().hashCode(owner, eStructuralFeature);
1221
      return eStore().hashCode(owner, eStructuralFeature);
1293
    }
1222
    }
1294
1223
1295
    @Override
1224
    @Override
1296
    protected int delegateIndexOf(Object object)
1225
    protected int delegateIndexOf(Object object)
1297
    {
1226
    {
1298
      return getStore().indexOf(owner, eStructuralFeature, object);
1227
      return eStore().indexOf(owner, eStructuralFeature, object);
1299
    }
1228
    }
1300
1229
1301
    @Override
1230
    @Override
1302
    protected boolean delegateIsEmpty()
1231
    protected boolean delegateIsEmpty()
1303
    {
1232
    {
1304
      return getStore().isEmpty(owner, eStructuralFeature);
1233
      return eStore().isEmpty(owner, eStructuralFeature);
1305
    }
1234
    }
1306
1235
1307
    @Override
1236
    @Override
Lines 1313-1319 Link Here
1313
    @Override
1242
    @Override
1314
    protected int delegateLastIndexOf(Object object)
1243
    protected int delegateLastIndexOf(Object object)
1315
    {
1244
    {
1316
      return getStore().lastIndexOf(owner, eStructuralFeature, object);
1245
      return eStore().lastIndexOf(owner, eStructuralFeature, object);
1317
    }
1246
    }
1318
1247
1319
    @Override
1248
    @Override
Lines 1325-1361 Link Here
1325
    @Override
1254
    @Override
1326
    protected Entry delegateRemove(int index)
1255
    protected Entry delegateRemove(int index)
1327
    {
1256
    {
1328
      return (Entry)getStore().remove(owner, eStructuralFeature, index);
1257
      return (Entry)eStore().remove(owner, eStructuralFeature, index);
1329
    }
1258
    }
1330
1259
1331
    @Override
1260
    @Override
1332
    protected Entry delegateSet(int index, Entry object)
1261
    protected Entry delegateSet(int index, Entry object)
1333
    {
1262
    {
1334
      return (Entry)getStore().set(owner, eStructuralFeature, index, object);
1263
      return (Entry)eStore().set(owner, eStructuralFeature, index, object);
1335
    }
1264
    }
1336
1265
1337
    @Override
1266
    @Override
1338
    protected int delegateSize()
1267
    protected int delegateSize()
1339
    {
1268
    {
1340
      return getStore().size(owner, eStructuralFeature);
1269
      return eStore().size(owner, eStructuralFeature);
1341
    }
1270
    }
1342
1271
1343
    @Override
1272
    @Override
1344
    protected Object[] delegateToArray()
1273
    protected Object[] delegateToArray()
1345
    {
1274
    {
1346
      return getStore().toArray(owner, eStructuralFeature);
1275
      return eStore().toArray(owner, eStructuralFeature);
1347
    }
1276
    }
1348
1277
1349
    @Override
1278
    @Override
1350
    protected <T> T[] delegateToArray(T[] array)
1279
    protected <T> T[] delegateToArray(T[] array)
1351
    {
1280
    {
1352
      return getStore().toArray(owner, eStructuralFeature, array);
1281
      return eStore().toArray(owner, eStructuralFeature, array);
1353
    }
1282
    }
1354
1283
1355
    @Override
1284
    @Override
1356
    protected Entry delegateMove(int targetIndex, int sourceIndex)
1285
    protected Entry delegateMove(int targetIndex, int sourceIndex)
1357
    {
1286
    {
1358
      return (Entry)getStore().move(owner, eStructuralFeature, targetIndex, sourceIndex);
1287
      return (Entry)eStore().move(owner, eStructuralFeature, targetIndex, sourceIndex);
1359
    }
1288
    }
1360
1289
1361
    @Override
1290
    @Override

Return to bug 251544