summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-12-28 08:16:12 (EST)
committerEike Stepper2007-12-28 08:16:12 (EST)
commit9a9f8bd123fb8c8ae78ec0b3290caa17b25ced0c (patch)
tree6b00188af7fdd5ad702e3da3277e5f2b8a7a9179
parent7a7df60205060ad8edbde0c547772b70705fae17 (diff)
downloadcdo-9a9f8bd123fb8c8ae78ec0b3290caa17b25ced0c.zip
cdo-9a9f8bd123fb8c8ae78ec0b3290caa17b25ced0c.tar.gz
cdo-9a9f8bd123fb8c8ae78ec0b3290caa17b25ced0c.tar.bz2
Code Cleanup
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1PackageImpl.java91
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java75
2 files changed, 110 insertions, 56 deletions
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 e1fb2b4..0494a5b 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
@@ -147,7 +147,10 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*/
public static Model1Package init()
{
- if (isInited) return (Model1Package)EPackage.Registry.INSTANCE.getEPackage(Model1Package.eNS_URI);
+ if (isInited)
+ {
+ return (Model1Package)EPackage.Registry.INSTANCE.getEPackage(Model1Package.eNS_URI);
+ }
// Obtain or create and register package
Model1PackageImpl theModel1Package = (Model1PackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Model1PackageImpl ? EPackage.Registry.INSTANCE
@@ -523,7 +526,10 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*/
public void createPackageContents()
{
- if (isCreated) return;
+ if (isCreated)
+ {
+ return;
+ }
isCreated = true;
// Create classes and their features
@@ -586,7 +592,10 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
*/
public void initializePackageContents()
{
- if (isInitialized) return;
+ if (isInitialized)
+ {
+ return;
+ }
isInitialized = true;
// Initialize package
@@ -599,11 +608,11 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
// Set bounds for type parameters
// Add supertypes to classes
- companyEClass.getESuperTypes().add(this.getAddress());
- supplierEClass.getESuperTypes().add(this.getAddress());
- customerEClass.getESuperTypes().add(this.getAddress());
- purchaseOrderEClass.getESuperTypes().add(this.getOrder());
- salesOrderEClass.getESuperTypes().add(this.getOrder());
+ companyEClass.getESuperTypes().add(getAddress());
+ supplierEClass.getESuperTypes().add(getAddress());
+ customerEClass.getESuperTypes().add(getAddress());
+ purchaseOrderEClass.getESuperTypes().add(getOrder());
+ salesOrderEClass.getESuperTypes().add(getOrder());
// Initialize classes and features; add operations and parameters
initEClass(addressEClass, Address.class, "Address", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -615,43 +624,43 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
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,
+ initEReference(getCompany_Categories(), getCategory(), null, "categories", null, 0, -1, Company.class,
!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,
+ initEReference(getCompany_Suppliers(), getSupplier(), null, "suppliers", null, 0, -1, Company.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+ initEReference(getCompany_Customers(), getCustomer(), null, "customers", null, 0, -1, Company.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+ initEReference(getCompany_PurchaseOrders(), getPurchaseOrder(), null, "purchaseOrders", null, 0, -1, Company.class,
!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_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,
- IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getCompany_SalesOrders(), this.getSalesOrder(), null, "salesOrders", null, 0, -1, Company.class,
+ initEReference(getCompany_SalesOrders(), getSalesOrder(), null, "salesOrders", null, 0, -1, Company.class,
!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);
- initEReference(getSupplier_PurchaseOrders(), this.getPurchaseOrder(), this.getPurchaseOrder_Supplier(),
- "purchaseOrders", null, 0, -1, Supplier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
- IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getSupplier_PurchaseOrders(), getPurchaseOrder(), getPurchaseOrder_Supplier(), "purchaseOrders",
+ null, 0, -1, Supplier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
+ !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(customerEClass, Customer.class, "Customer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getCustomer_SalesOrders(), this.getSalesOrder(), this.getSalesOrder_Customer(), "salesOrders", null,
- 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_SalesOrders(), getSalesOrder(), getSalesOrder_Customer(), "salesOrders", null, 0, -1,
+ 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,
- !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getOrder_OrderDetails(), getOrderDetail(), getOrderDetail_Order(), "orderDetails", null, 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,
- !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getOrderDetail_Product(), this.getProduct(), this.getProduct_OrderDetails(), "product", null, 0, 1,
+ initEReference(getOrderDetail_Order(), getOrder(), getOrder_OrderDetails(), "order", null, 1, 1, OrderDetail.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
+ initEReference(getOrderDetail_Product(), getProduct(), getProduct_OrderDetails(), "product", null, 0, 1,
OrderDetail.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getOrderDetail_Price(), ecorePackage.getEFloat(), "price", null, 0, 1, OrderDetail.class,
@@ -661,34 +670,34 @@ public class Model1PackageImpl extends EPackageImpl implements Model1Package
IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getPurchaseOrder_Date(), ecorePackage.getEDate(), "date", null, 0, 1, PurchaseOrder.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getPurchaseOrder_Supplier(), this.getSupplier(), this.getSupplier_PurchaseOrders(), "supplier",
- null, 1, 1, PurchaseOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
+ initEReference(getPurchaseOrder_Supplier(), getSupplier(), getSupplier_PurchaseOrders(), "supplier", null, 1, 1,
+ PurchaseOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(salesOrderEClass, SalesOrder.class, "SalesOrder", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getSalesOrder_Id(), ecorePackage.getEInt(), "id", null, 0, 1, SalesOrder.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getSalesOrder_Customer(), this.getCustomer(), this.getCustomer_SalesOrders(), "customer", null, 1,
- 1, SalesOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
+ initEReference(getSalesOrder_Customer(), getCustomer(), getCustomer_SalesOrders(), "customer", null, 1, 1,
+ SalesOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(categoryEClass, Category.class, "Category", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
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_DERIVED, IS_ORDERED);
- initEReference(getCategory_Products(), this.getProduct(), null, "products", null, 0, -1, Category.class,
+ initEReference(getCategory_Categories(), getCategory(), null, "categories", null, 0, -1, Category.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
+ initEReference(getCategory_Products(), getProduct(), null, "products", null, 0, -1, Category.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
initEClass(productEClass, Product.class, "Product", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getProduct_Name(), ecorePackage.getEString(), "name", null, 0, 1, Product.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getProduct_OrderDetails(), this.getOrderDetail(), this.getOrderDetail_Product(), "orderDetails",
- null, 0, -1, Product.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
- !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProduct_OrderDetails(), getOrderDetail(), getOrderDetail_Product(), "orderDetails", null, 0, -1,
+ Product.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
+ IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java
index edff24c..0f85859 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/util/Model1Switch.java
@@ -99,75 +99,120 @@ public class Model1Switch<T>
{
Address address = (Address)theEObject;
T result = caseAddress(address);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.COMPANY:
{
Company company = (Company)theEObject;
T result = caseCompany(company);
- if (result == null) result = caseAddress(company);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = caseAddress(company);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.SUPPLIER:
{
Supplier supplier = (Supplier)theEObject;
T result = caseSupplier(supplier);
- if (result == null) result = caseAddress(supplier);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = caseAddress(supplier);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.CUSTOMER:
{
Customer customer = (Customer)theEObject;
T result = caseCustomer(customer);
- if (result == null) result = caseAddress(customer);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = caseAddress(customer);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.ORDER:
{
Order order = (Order)theEObject;
T result = caseOrder(order);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.ORDER_DETAIL:
{
OrderDetail orderDetail = (OrderDetail)theEObject;
T result = caseOrderDetail(orderDetail);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.PURCHASE_ORDER:
{
PurchaseOrder purchaseOrder = (PurchaseOrder)theEObject;
T result = casePurchaseOrder(purchaseOrder);
- if (result == null) result = caseOrder(purchaseOrder);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = caseOrder(purchaseOrder);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.SALES_ORDER:
{
SalesOrder salesOrder = (SalesOrder)theEObject;
T result = caseSalesOrder(salesOrder);
- if (result == null) result = caseOrder(salesOrder);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = caseOrder(salesOrder);
+ }
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.CATEGORY:
{
Category category = (Category)theEObject;
T result = caseCategory(category);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
case Model1Package.PRODUCT:
{
Product product = (Product)theEObject;
T result = caseProduct(product);
- if (result == null) result = defaultCase(theEObject);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
return result;
}
default: