Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-03-15 07:49:14 +0000
committerEike Stepper2013-03-15 07:49:14 +0000
commite743103a0cb14f44da88c8f6f24d8c24fef23086 (patch)
treee2f7bd7329977c5f57f95eb114956e59105dc142
parentfff5e2745f2022717e44da61ac32d5123b82f3c2 (diff)
downloadcdo-e743103a0cb14f44da88c8f6f24d8c24fef23086.tar.gz
cdo-e743103a0cb14f44da88c8f6f24d8c24fef23086.tar.xz
cdo-e743103a0cb14f44da88c8f6f24d8c24fef23086.zip
[402371] CDOCompareUtil.compare fails with models that use Containment
Proxies https://bugs.eclipse.org/bugs/show_bug.cgi?id=402371
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/model/model1.genmodel5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/model/model1.legacy.genmodel2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Category.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Company.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Order.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CategoryImpl.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CompanyImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/Model1PackageImpl.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderAddressImpl.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderDetailImpl.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFCompareTest.java75
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java2
16 files changed, 184 insertions, 52 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.genmodel b/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.genmodel
index 535f8fe82b..24eb5368c3 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.genmodel
@@ -4,8 +4,9 @@
editDirectory="" editorDirectory="" modelPluginID="org.eclipse.emf.cdo.tests.model1"
modelName="Model1" updateClasspath="false" rootExtendsClass="org.eclipse.emf.internal.cdo.CDOObjectImpl"
reflectiveDelegation="true" codeFormatting="true" testsDirectory="" importerID="org.eclipse.emf.importer.ecore"
- featureDelegation="Reflective" complianceLevel="5.0" providerRootExtendsClass="org.eclipse.emf.cdo.edit.CDOItemProviderAdapter"
- optimizedHasChildren="true" tableProviders="true" colorProviders="true" fontProviders="true">
+ featureDelegation="Reflective" containmentProxies="true" complianceLevel="5.0"
+ providerRootExtendsClass="org.eclipse.emf.cdo.edit.CDOItemProviderAdapter" optimizedHasChildren="true"
+ tableProviders="true" colorProviders="true" fontProviders="true">
<foreignModel>model1.ecore</foreignModel>
<modelPluginVariables>CDO=org.eclipse.emf.cdo</modelPluginVariables>
<genPackages prefix="Model1" basePackage="org.eclipse.emf.cdo.tests" disposableProviderFactory="true"
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.legacy.genmodel b/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.legacy.genmodel
index 113bd85ce3..3f70907b9e 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.legacy.genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/model/model1.legacy.genmodel
@@ -4,7 +4,7 @@
modelDirectory="/org.eclipse.emf.cdo.tests.model1/src" editDirectory="" editorDirectory=""
modelPluginID="org.eclipse.emf.cdo.tests.model1" modelName="Model1" updateClasspath="false"
codeFormatting="true" testsDirectory="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" runtimeVersion="2.6">
+ containmentProxies="true" complianceLevel="5.0" runtimeVersion="2.6">
<foreignModel>model1.ecore</foreignModel>
<modelPluginVariables>CDO=org.eclipse.emf.cdo</modelPluginVariables>
<genPackages prefix="Model1" basePackage="org.eclipse.emf.cdo.tests" disposableProviderFactory="true"
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Category.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Category.java
index 2d2ca0be35..af4388c21a 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Category.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Category.java
@@ -68,7 +68,7 @@ public interface Category extends EObject
* <!-- end-user-doc -->
* @return the value of the '<em>Categories</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCategory_Categories()
- * @model containment="true"
+ * @model containment="true" resolveProxies="true"
* @generated
*/
EList<Category> getCategories();
@@ -84,7 +84,7 @@ public interface Category extends EObject
* <!-- end-user-doc -->
* @return the value of the '<em>Products</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCategory_Products()
- * @model containment="true"
+ * @model containment="true" resolveProxies="true"
* @generated
*/
EList<Product1> getProducts();
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Company.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Company.java
index 98cacda872..fc44348c2a 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Company.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Company.java
@@ -43,7 +43,7 @@ public interface Company extends Address
* <!-- end-user-doc -->
* @return the value of the '<em>Categories</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCompany_Categories()
- * @model containment="true"
+ * @model containment="true" resolveProxies="true"
* @generated
*/
EList<Category> getCategories();
@@ -59,7 +59,7 @@ public interface Company extends Address
* <!-- end-user-doc -->
* @return the value of the '<em>Suppliers</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCompany_Suppliers()
- * @model containment="true"
+ * @model containment="true" resolveProxies="true"
* @generated
*/
EList<Supplier> getSuppliers();
@@ -75,7 +75,7 @@ public interface Company extends Address
* <!-- end-user-doc -->
* @return the value of the '<em>Purchase Orders</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCompany_PurchaseOrders()
- * @model containment="true"
+ * @model containment="true" resolveProxies="true"
* @generated
*/
EList<PurchaseOrder> getPurchaseOrders();
@@ -91,7 +91,7 @@ public interface Company extends Address
* <!-- end-user-doc -->
* @return the value of the '<em>Customers</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCompany_Customers()
- * @model containment="true"
+ * @model containment="true" resolveProxies="true"
* @generated
*/
EList<Customer> getCustomers();
@@ -107,7 +107,7 @@ public interface Company extends Address
* <!-- end-user-doc -->
* @return the value of the '<em>Sales Orders</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getCompany_SalesOrders()
- * @model containment="true"
+ * @model containment="true" resolveProxies="true"
* @generated
*/
EList<SalesOrder> getSalesOrders();
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Order.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Order.java
index 00119b1b39..e5d8d4745b 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Order.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/Order.java
@@ -43,7 +43,7 @@ public interface Order extends EObject
* @return the value of the '<em>Order Details</em>' containment reference list.
* @see org.eclipse.emf.cdo.tests.model1.Model1Package#getOrder_OrderDetails()
* @see org.eclipse.emf.cdo.tests.model1.OrderDetail#getOrder
- * @model opposite="order" containment="true"
+ * @model opposite="order" containment="true" resolveProxies="true"
* @generated
*/
EList<OrderDetail> getOrderDetails();
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java
index 25295128af..9a0a012235 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java
@@ -710,19 +710,19 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
initEClass(companyEClass, Company.class, "Company", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getCompany_Categories(), this.getCategory(), null, "categories", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCompany_Suppliers(), this.getSupplier(), null, "suppliers", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCompany_Customers(), this.getCustomer(), null, "customers", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCompany_PurchaseOrders(), this.getPurchaseOrder(), null, "purchaseOrders", null, 0, -1,
- Company.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
+ Company.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCompany_SalesOrders(), this.getSalesOrder(), null, "salesOrders", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(supplierEClass, Supplier.class, "Supplier", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -737,18 +737,18 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
0, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCustomer_OrderByProduct(), this.getProductToOrder(), null, "orderByProduct", null, 0, -1,
- Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
+ Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(orderEClass, Order.class, "Order", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getOrder_OrderDetails(), this.getOrderDetail(), this.getOrderDetail_Order(), "orderDetails", null,
- 0, -1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
+ 0, -1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(orderDetailEClass, OrderDetail.class, "OrderDetail", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEReference(getOrderDetail_Order(), this.getOrder(), this.getOrder_OrderDetails(), "order", null, 1, 1,
- OrderDetail.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
+ OrderDetail.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getOrderDetail_Product(), this.getProduct1(), this.getProduct1_OrderDetails(), "product", null, 0,
1, OrderDetail.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
@@ -776,10 +776,10 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
initEAttribute(getCategory_Name(), ecorePackage.getEString(), "name", null, 0, 1, Category.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCategory_Categories(), this.getCategory(), null, "categories", null, 0, -1, Category.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCategory_Products(), this.getProduct1(), null, "products", null, 0, -1, Category.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(product1EClass, Product1.class, "Product1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CategoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CategoryImpl.java
index 1d31f4bbae..6f675f59d6 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CategoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CategoryImpl.java
@@ -134,7 +134,8 @@ public class CategoryImpl extends EObjectImpl implements Category
{
if (categories == null)
{
- categories = new EObjectContainmentEList<Category>(Category.class, this, Model1Package.CATEGORY__CATEGORIES);
+ categories = new EObjectContainmentEList.Resolving<Category>(Category.class, this,
+ Model1Package.CATEGORY__CATEGORIES);
}
return categories;
}
@@ -147,7 +148,7 @@ public class CategoryImpl extends EObjectImpl implements Category
{
if (products == null)
{
- products = new EObjectContainmentEList<Product1>(Product1.class, this, Model1Package.CATEGORY__PRODUCTS);
+ products = new EObjectContainmentEList.Resolving<Product1>(Product1.class, this, Model1Package.CATEGORY__PRODUCTS);
}
return products;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CompanyImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CompanyImpl.java
index fc565da799..38c7d94e7e 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CompanyImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/CompanyImpl.java
@@ -127,7 +127,8 @@ public class CompanyImpl extends AddressImpl implements Company
{
if (categories == null)
{
- categories = new EObjectContainmentEList<Category>(Category.class, this, Model1Package.COMPANY__CATEGORIES);
+ categories = new EObjectContainmentEList.Resolving<Category>(Category.class, this,
+ Model1Package.COMPANY__CATEGORIES);
}
return categories;
}
@@ -140,7 +141,8 @@ public class CompanyImpl extends AddressImpl implements Company
{
if (suppliers == null)
{
- suppliers = new EObjectContainmentEList<Supplier>(Supplier.class, this, Model1Package.COMPANY__SUPPLIERS);
+ suppliers = new EObjectContainmentEList.Resolving<Supplier>(Supplier.class, this,
+ Model1Package.COMPANY__SUPPLIERS);
}
return suppliers;
}
@@ -153,7 +155,8 @@ public class CompanyImpl extends AddressImpl implements Company
{
if (customers == null)
{
- customers = new EObjectContainmentEList<Customer>(Customer.class, this, Model1Package.COMPANY__CUSTOMERS);
+ customers = new EObjectContainmentEList.Resolving<Customer>(Customer.class, this,
+ Model1Package.COMPANY__CUSTOMERS);
}
return customers;
}
@@ -166,7 +169,7 @@ public class CompanyImpl extends AddressImpl implements Company
{
if (purchaseOrders == null)
{
- purchaseOrders = new EObjectContainmentEList<PurchaseOrder>(PurchaseOrder.class, this,
+ purchaseOrders = new EObjectContainmentEList.Resolving<PurchaseOrder>(PurchaseOrder.class, this,
Model1Package.COMPANY__PURCHASE_ORDERS);
}
return purchaseOrders;
@@ -180,7 +183,8 @@ public class CompanyImpl extends AddressImpl implements Company
{
if (salesOrders == null)
{
- salesOrders = new EObjectContainmentEList<SalesOrder>(SalesOrder.class, this, Model1Package.COMPANY__SALES_ORDERS);
+ salesOrders = new EObjectContainmentEList.Resolving<SalesOrder>(SalesOrder.class, this,
+ Model1Package.COMPANY__SALES_ORDERS);
}
return salesOrders;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/Model1PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/Model1PackageImpl.java
index c2d39fc7dd..bc8e382e6f 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/Model1PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/Model1PackageImpl.java
@@ -720,19 +720,19 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
initEClass(companyEClass, Company.class, "Company", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getCompany_Categories(), this.getCategory(), null, "categories", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCompany_Suppliers(), this.getSupplier(), null, "suppliers", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCompany_Customers(), this.getCustomer(), null, "customers", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCompany_PurchaseOrders(), this.getPurchaseOrder(), null, "purchaseOrders", null, 0, -1,
- Company.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
+ Company.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCompany_SalesOrders(), this.getSalesOrder(), null, "salesOrders", null, 0, -1, Company.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(supplierEClass, Supplier.class, "Supplier", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -747,18 +747,18 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
0, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCustomer_OrderByProduct(), this.getProductToOrder(), null, "orderByProduct", null, 0, -1,
- Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
+ Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(orderEClass, Order.class, "Order", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getOrder_OrderDetails(), this.getOrderDetail(), this.getOrderDetail_Order(), "orderDetails", null,
- 0, -1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
+ 0, -1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(orderDetailEClass, OrderDetail.class, "OrderDetail", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEReference(getOrderDetail_Order(), this.getOrder(), this.getOrder_OrderDetails(), "order", null, 1, 1,
- OrderDetail.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
+ OrderDetail.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getOrderDetail_Product(), this.getProduct1(), this.getProduct1_OrderDetails(), "product", null, 0,
1, OrderDetail.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
@@ -786,10 +786,10 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
initEAttribute(getCategory_Name(), ecorePackage.getEString(), "name", null, 0, 1, Category.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCategory_Categories(), this.getCategory(), null, "categories", null, 0, -1, Category.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getCategory_Products(), this.getProduct1(), null, "products", null, 0, -1, Category.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(product1EClass, Product1.class, "Product1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderAddressImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderAddressImpl.java
index 19df5bc739..37d2a0c86c 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderAddressImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderAddressImpl.java
@@ -138,7 +138,7 @@ public class OrderAddressImpl extends AddressImpl implements OrderAddress
{
if (orderDetails == null)
{
- orderDetails = new EObjectContainmentWithInverseEList<OrderDetail>(OrderDetail.class, this,
+ orderDetails = new EObjectContainmentWithInverseEList.Resolving<OrderDetail>(OrderDetail.class, this,
Model1Package.ORDER_ADDRESS__ORDER_DETAILS, Model1Package.ORDER_DETAIL__ORDER);
}
return orderDetails;
@@ -156,6 +156,18 @@ public class OrderAddressImpl extends AddressImpl implements OrderAddress
}
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Order basicGetOrder()
+ {
+ if (eContainerFeatureID() != Model1Package.ORDER_ADDRESS__ORDER)
+ return null;
+ return (Order)eInternalContainer();
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@@ -376,7 +388,9 @@ public class OrderAddressImpl extends AddressImpl implements OrderAddress
case Model1Package.ORDER_ADDRESS__ORDER_DETAILS:
return getOrderDetails();
case Model1Package.ORDER_ADDRESS__ORDER:
- return getOrder();
+ if (resolve)
+ return getOrder();
+ return basicGetOrder();
case Model1Package.ORDER_ADDRESS__PRODUCT:
if (resolve)
return getProduct();
@@ -459,7 +473,7 @@ public class OrderAddressImpl extends AddressImpl implements OrderAddress
case Model1Package.ORDER_ADDRESS__ORDER_DETAILS:
return orderDetails != null && !orderDetails.isEmpty();
case Model1Package.ORDER_ADDRESS__ORDER:
- return getOrder() != null;
+ return basicGetOrder() != null;
case Model1Package.ORDER_ADDRESS__PRODUCT:
return product != null;
case Model1Package.ORDER_ADDRESS__PRICE:
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderDetailImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderDetailImpl.java
index 3082cca7b7..2476c028a2 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderDetailImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderDetailImpl.java
@@ -105,6 +105,18 @@ public class OrderDetailImpl extends EObjectImpl implements OrderDetail
}
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Order basicGetOrder()
+ {
+ if (eContainerFeatureID() != Model1Package.ORDER_DETAIL__ORDER)
+ return null;
+ return (Order)eInternalContainer();
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@@ -295,7 +307,9 @@ public class OrderDetailImpl extends EObjectImpl implements OrderDetail
switch (featureID)
{
case Model1Package.ORDER_DETAIL__ORDER:
- return getOrder();
+ if (resolve)
+ return getOrder();
+ return basicGetOrder();
case Model1Package.ORDER_DETAIL__PRODUCT:
if (resolve)
return getProduct();
@@ -360,7 +374,7 @@ public class OrderDetailImpl extends EObjectImpl implements OrderDetail
switch (featureID)
{
case Model1Package.ORDER_DETAIL__ORDER:
- return getOrder() != null;
+ return basicGetOrder() != null;
case Model1Package.ORDER_DETAIL__PRODUCT:
return product != null;
case Model1Package.ORDER_DETAIL__PRICE:
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderImpl.java
index 7da8a5efc2..3cbedba9c5 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/legacy/impl/OrderImpl.java
@@ -80,7 +80,7 @@ public abstract class OrderImpl extends EObjectImpl implements Order
{
if (orderDetails == null)
{
- orderDetails = new EObjectContainmentWithInverseEList<OrderDetail>(OrderDetail.class, this,
+ orderDetails = new EObjectContainmentWithInverseEList.Resolving<OrderDetail>(OrderDetail.class, this,
Model1Package.ORDER__ORDER_DETAILS, Model1Package.ORDER_DETAIL__ORDER);
}
return orderDetails;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
index 74ef3aafbb..217949104c 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
@@ -565,22 +565,43 @@ public class ContainmentTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.getOrCreateResource(getResourcePath("res1"));
+ // Model1Package.eINSTANCE.getClass();
+ // Resource resource = new XMIResourceImpl();
+
+ EList<EObject> contents = resource.getContents();
+
Company company = getModel1Factory().createCompany();
- resource.getContents().add(company);
+ contents.add(company);
Category category = getModel1Factory().createCategory();
company.getCategories().add(category);
Supplier supplier = getModel1Factory().createSupplier();
supplier.setName("supplier" + System.currentTimeMillis());
- resource.getContents().add(supplier);
- company.getSuppliers().add(supplier);
+ contents.add(supplier);
- // transaction.commit();
+ EList<Supplier> suppliers = company.getSuppliers();
+ suppliers.add(supplier);
- resource.getContents().addAll(resource.getContents().get(0).eContents());
- resource.getContents().remove(0);
+ // // Test succeeds with this intermediary commit:
+ // transaction.commit();
+ EList<EObject> companyContents = company.eContents();
+ contents.addAll(companyContents);
+ contents.remove(company);
+
+ // FileOutputStream stream = IOUtil.openOutputStream("/develop/test.xml");
+ //
+ // try
+ // {
+ // resource.save(stream, null);
+ // }
+ // finally
+ // {
+ // IOUtil.close(stream);
+ // }
+
+ int fails;
transaction.commit();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
index c9a9c4e80f..d163a7561e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/CrossReferenceTest.java
@@ -451,6 +451,8 @@ public class CrossReferenceTest extends AbstractCDOTest
transaction.commit();
CDORevisionData data = CDOUtil.getCDOObject(salesOrder).cdoRevision().data();
CDOID id = (CDOID)data.get(getModel1Package().getSalesOrder_Customer(), 0);
+
+ int fails;
assertEquals(false, id.isExternal());
}
@@ -491,7 +493,7 @@ public class CrossReferenceTest extends AbstractCDOTest
/**
* Bug 369253: bidirectional cross-reference between containing and contained object that
- * is not a containment reference.
+ * is not a containment reference.
*/
public void testCrossCreferenceBetweenContainerAndContained() throws Exception
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFCompareTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFCompareTest.java
index c4c04779cf..87e015322d 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFCompareTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/EMFCompareTest.java
@@ -17,7 +17,9 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.config.IRepositoryConfig;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.Requires;
+import org.eclipse.emf.cdo.tests.model1.Category;
import org.eclipse.emf.cdo.tests.model1.Company;
+import org.eclipse.emf.cdo.tests.model1.Product1;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
@@ -105,6 +107,79 @@ public class EMFCompareTest extends AbstractCDOTest
dump(comparison);
}
+ public void testContainmentProxy() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource1 = transaction.createResource(getResourcePath("/res1"));
+ CDOResource resource2 = transaction.createResource(getResourcePath("/res2"));
+
+ Company company = getModel1Factory().createCompany();
+ company.setName("Eclipse");
+ resource1.getContents().add(company);
+
+ Category categoryCrossContained = getModel1Factory().createCategory();
+ categoryCrossContained.setName("Category");
+ company.getCategories().add(categoryCrossContained);
+ resource2.getContents().add(categoryCrossContained);
+
+ for (int i = 0; i < 10; ++i)
+ {
+ Product1 product = getModel1Factory().createProduct1();
+ categoryCrossContained.getProducts().add(product);
+ }
+
+ CDOCommitInfo commitInfo = transaction.commit();
+
+ Product1 product0 = categoryCrossContained.getProducts().get(0);
+ product0.setName("CHANGED");
+
+ transaction.commit();
+
+ Comparison comparison = CDOCompareUtil.compare(transaction, session.openView(commitInfo), null);
+ dump(comparison);
+
+ Match match = comparison.getMatch(categoryCrossContained);
+ EList<Diff> differences = match.getDifferences();
+
+ int fails;
+ assertEquals(0, differences.size());
+ }
+
+ public void testNoContainmentProxy() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource1 = transaction.createResource(getResourcePath("/res1"));
+
+ Company company = getModel1Factory().createCompany();
+ company.setName("Company");
+ resource1.getContents().add(company);
+
+ Category category = getModel1Factory().createCategory();
+ category.setName("Category");
+ company.getCategories().add(category);
+
+ for (int i = 0; i < 10; ++i)
+ {
+ Product1 product = getModel1Factory().createProduct1();
+ category.getProducts().add(product);
+ }
+
+ company.setName("Company2");
+
+ CDOCommitInfo commitInfo = transaction.commit();
+
+ category.getProducts().get(0).setName("EclipseProduct");
+ transaction.commit();
+
+ Comparison comparison = CDOCompareUtil.compare(transaction, session.openView(commitInfo), null);
+ dump(comparison);
+
+ Match match = comparison.getMatch(category);
+ assertEquals(0, match.getDifferences().size());
+ }
+
private Company createCompany()
{
Company company = getModel1Factory().createCompany();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index 497fbfb2b7..3407d3b58f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -712,7 +712,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
/**
- * Code took from {@link BasicEObjectImpl#eBasicSetContainer} and modify it to detect when object are moved in the
+ * Code taken from {@link BasicEObjectImpl#eBasicSetContainer} and modified to detect whether the object is moved in the
* same context. (E.g.: An object is moved from resA to resB. resA and resB belongs to the same CDORepositoryInfo.
* Without this special handling, a detach and newObject will be generated for the object moved)
*

Back to the top