Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 220113 Details for
Bug 387689
Abusive IllegalStateException on Notification.getNewXXXValue with dynamic feature delegation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed fix + Junit test case (git patch)
bug387689.patch (text/plain), 134.69 KB, created by
Matthieu Helleboid
on 2012-08-21 13:23:54 EDT
(
hide
)
Description:
Proposed fix + Junit test case (git patch)
Filename:
MIME Type:
Creator:
Matthieu Helleboid
Created:
2012-08-21 13:23:54 EDT
Size:
134.69 KB
patch
obsolete
>diff --git plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java >index 5f80dac..da14f42 100644 >--- plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java >+++ plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java >@@ -874,98 +874,178 @@ public class NotificationImpl implements Notification, NotificationChain > > public boolean getOldBooleanValue() > { >- if (primitiveType != PRIMITIVE_TYPE_BOOLEAN) throw new IllegalStateException(); >- return oldSimplePrimitiveValue != 0; >+ if (primitiveType == PRIMITIVE_TYPE_BOOLEAN) >+ return oldSimplePrimitiveValue != 0; >+ >+ if (oldValue instanceof Boolean) >+ return ((Boolean) oldValue).booleanValue(); >+ >+ throw new IllegalStateException(); > } > > public boolean getNewBooleanValue() > { >- if (primitiveType != PRIMITIVE_TYPE_BOOLEAN) throw new IllegalStateException(); >- return newSimplePrimitiveValue != 0; >+ if (primitiveType == PRIMITIVE_TYPE_BOOLEAN) >+ return newSimplePrimitiveValue != 0; >+ >+ if (newValue instanceof Boolean) >+ return ((Boolean) newValue).booleanValue(); >+ >+ throw new IllegalStateException(); > } > > public byte getOldByteValue() > { >- if (primitiveType != PRIMITIVE_TYPE_BYTE) throw new IllegalStateException(); >- return (byte)oldSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_BYTE) >+ return (byte)oldSimplePrimitiveValue; >+ >+ if (oldValue instanceof Byte) >+ return ((Byte) oldValue).byteValue(); >+ >+ throw new IllegalStateException(); > } > > public byte getNewByteValue() > { >- if (primitiveType != PRIMITIVE_TYPE_BYTE) throw new IllegalStateException(); >- return (byte)newSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_BYTE) >+ return (byte)newSimplePrimitiveValue; >+ >+ if (newValue instanceof Byte) >+ return ((Byte) newValue).byteValue(); >+ >+ throw new IllegalStateException(); > } > > public char getOldCharValue() > { >- if (primitiveType != PRIMITIVE_TYPE_CHAR) throw new IllegalStateException(); >- return (char)oldSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_CHAR) >+ return (char)oldSimplePrimitiveValue; >+ >+ if (oldValue instanceof Character) >+ return ((Character) oldValue).charValue(); >+ >+ throw new IllegalStateException(); > } > > public char getNewCharValue() > { >- if (primitiveType != PRIMITIVE_TYPE_CHAR) throw new IllegalStateException(); >- return (char)newSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_CHAR) >+ return (char)newSimplePrimitiveValue; >+ >+ if (newValue instanceof Character) >+ return ((Character) newValue).charValue(); >+ >+ throw new IllegalStateException(); > } > > public double getOldDoubleValue() > { >- if (primitiveType != PRIMITIVE_TYPE_DOUBLE) throw new IllegalStateException(); >- return oldIEEEPrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_DOUBLE) >+ return oldIEEEPrimitiveValue; >+ >+ if (oldValue instanceof Double) >+ return ((Double) oldValue).doubleValue(); >+ >+ throw new IllegalStateException(); > } > > public double getNewDoubleValue() > { >- if (primitiveType != PRIMITIVE_TYPE_DOUBLE) throw new IllegalStateException(); >- return newIEEEPrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_DOUBLE) >+ return newIEEEPrimitiveValue; >+ >+ if (newValue instanceof Double) >+ return ((Double) newValue).doubleValue(); >+ >+ throw new IllegalStateException(); > } > > public float getOldFloatValue() > { >- if (primitiveType != PRIMITIVE_TYPE_FLOAT) throw new IllegalStateException(); >- return (float)oldIEEEPrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_FLOAT) >+ return (float)oldIEEEPrimitiveValue; >+ >+ if (oldValue instanceof Float) >+ return ((Float) oldValue).floatValue(); >+ >+ throw new IllegalStateException(); > } > > public float getNewFloatValue() > { >- if (primitiveType != PRIMITIVE_TYPE_FLOAT) throw new IllegalStateException(); >- return (float)newIEEEPrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_FLOAT) >+ return (float)newIEEEPrimitiveValue; >+ >+ if (newValue instanceof Float) >+ return ((Float) newValue).floatValue(); >+ >+ throw new IllegalStateException(); > } > > public int getOldIntValue() > { >- if (primitiveType != PRIMITIVE_TYPE_INT) throw new IllegalStateException(); >- return (int)oldSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_INT) >+ return (int)oldSimplePrimitiveValue; >+ >+ if (oldValue instanceof Integer) >+ return ((Integer) oldValue).intValue(); >+ >+ throw new IllegalStateException(); > } > > public int getNewIntValue() > { >- if (primitiveType != PRIMITIVE_TYPE_INT) throw new IllegalStateException(); >- return (int)newSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_INT) >+ return (int)newSimplePrimitiveValue; >+ >+ if (newValue instanceof Integer) >+ return ((Integer) newValue).intValue(); >+ >+ throw new IllegalStateException(); > } > > public long getOldLongValue() > { >- if (primitiveType != PRIMITIVE_TYPE_LONG) throw new IllegalStateException(); >- return oldSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_LONG) >+ return oldSimplePrimitiveValue; >+ >+ if (oldValue instanceof Long) >+ return ((Long) oldValue).longValue(); >+ >+ throw new IllegalStateException(); > } > > public long getNewLongValue() > { >- if (primitiveType != PRIMITIVE_TYPE_LONG) throw new IllegalStateException(); >- return newSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_LONG) >+ return newSimplePrimitiveValue; >+ >+ if (newValue instanceof Long) >+ return ((Long) newValue).longValue(); >+ >+ throw new IllegalStateException(); > } > > public short getOldShortValue() > { >- if (primitiveType != PRIMITIVE_TYPE_SHORT) throw new IllegalStateException(); >- return (short)oldSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_SHORT) >+ return (short)oldSimplePrimitiveValue; >+ >+ if (oldValue instanceof Short) >+ return ((Short) oldValue).shortValue(); >+ >+ throw new IllegalStateException(); > } > > public short getNewShortValue() > { >- if (primitiveType != PRIMITIVE_TYPE_SHORT) throw new IllegalStateException(); >- return (short)newSimplePrimitiveValue; >+ if (primitiveType == PRIMITIVE_TYPE_SHORT) >+ return (short)newSimplePrimitiveValue; >+ >+ if (newValue instanceof Short) >+ return ((Short) newValue).shortValue(); >+ >+ throw new IllegalStateException(); > } > > public String getOldStringValue() >diff --git tests/org.eclipse.emf.test.common/META-INF/MANIFEST.MF tests/org.eclipse.emf.test.common/META-INF/MANIFEST.MF >index 8bfc0e7..51beb16 100644 >--- tests/org.eclipse.emf.test.common/META-INF/MANIFEST.MF >+++ tests/org.eclipse.emf.test.common/META-INF/MANIFEST.MF >@@ -23,6 +23,10 @@ Export-Package: org.eclipse.emf.test.common, > org.eclipse.emf.test.models.dbprice, > org.eclipse.emf.test.models.dbprice.impl, > org.eclipse.emf.test.models.dbprice.util, >+ org.eclipse.emf.test.models.dynamicDelegation, >+ org.eclipse.emf.test.models.dynamicDelegation.impl, >+ org.eclipse.emf.test.models.dynamicDelegation.impl.none, >+ org.eclipse.emf.test.models.dynamicDelegation.util, > org.eclipse.emf.test.models.ext, > org.eclipse.emf.test.models.ext.impl, > org.eclipse.emf.test.models.ext.provider, >diff --git tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.ecore tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.ecore >new file mode 100644 >index 0000000..2943e18 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.ecore >@@ -0,0 +1,19 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<ecore:EPackage xmi:version="2.0" >+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="dynamicDelegation" >+ nsURI="http:///org.eclipse.emf.test.models/DynamicDelegation" nsPrefix="dynamicDelegation"> >+ <eClassifiers xsi:type="ecore:EClass" name="Class0"> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testBoolean" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testByte" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte"/> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testChar" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar"/> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testDouble" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testFloat" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testInt" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testLong" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/> >+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testShort" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/> >+ <eStructuralFeatures xsi:type="ecore:EReference" name="class1" eType="#//Class1" >+ containment="true"/> >+ </eClassifiers> >+ <eClassifiers xsi:type="ecore:EClass" name="Class1"/> >+</ecore:EPackage> >diff --git tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.genmodel tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.genmodel >new file mode 100644 >index 0000000..d951fdd >--- /dev/null >+++ tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.genmodel >@@ -0,0 +1,23 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<genmodel:GenModel xmi:version="2.0" >+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" >+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.test.common/src" >+ modelPluginID="org.eclipse.emf.test.common" modelName="DynamicDelegation" importerID="org.eclipse.emf.importer.ecore" >+ featureDelegation="Dynamic" complianceLevel="5.0" copyrightFields="false"> >+ <foreignModel>dynamicDelegation.ecore</foreignModel> >+ <genPackages prefix="DynamicDelegation" basePackage="org.eclipse.emf.test.models" >+ disposableProviderFactory="true" ecorePackage="dynamicDelegation.ecore#/"> >+ <genClasses ecoreClass="dynamicDelegation.ecore#//Class0"> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testBoolean"/> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testByte"/> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testChar"/> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testDouble"/> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testFloat"/> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testInt"/> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testLong"/> >+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testShort"/> >+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference dynamicDelegation.ecore#//Class0/class1"/> >+ </genClasses> >+ <genClasses ecoreClass="dynamicDelegation.ecore#//Class1"/> >+ </genPackages> >+</genmodel:GenModel> >diff --git tests/org.eclipse.emf.test.common/plugin.xml tests/org.eclipse.emf.test.common/plugin.xml >index 789457e..e9f9543 100644 >--- tests/org.eclipse.emf.test.common/plugin.xml >+++ tests/org.eclipse.emf.test.common/plugin.xml >@@ -12,6 +12,13 @@ > class = "org.eclipse.emf.test.models.lib.LibPackage" > genModel = "models/crossresourcecontainment.SimpleLib/SimpleLib.genmodel" /> > >+ <!-- Dynamic Delegation --> >+ >+ <package >+ uri = "http:///org.eclipse.emf.test.models/DynamicDelegation" >+ class = "org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage" >+ genModel = "models/dynamicDelegation/dynamicDelegation.genmodel" /> >+ > <!-- edit.RefTest --> > > <package >@@ -105,6 +112,13 @@ > class = "org.eclipse.emf.test.models.switch3.Switch3Package" > genModel = "models/Switch/switch.genmodel" /> > >+ <!-- Dynamic Delegation --> >+ >+ <package >+ uri = "http:///org.eclipse.emf.test.models/DynamicDelegation" >+ class = "org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage" >+ genModel = "models/dynamicDelegation/dynamicDelegation.genmodel" /> >+ > </extension> > > <extension point="org.eclipse.emf.ecore.extension_parser"> >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/common/templates/DiagnosticTestGen.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/common/templates/DiagnosticTestGen.java >index 7c98adb..2a56ada 100644 >--- tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/common/templates/DiagnosticTestGen.java >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/common/templates/DiagnosticTestGen.java >@@ -1,170 +1,170 @@ >-package org.eclipse.emf.test.common.templates; >- >-import java.util.*; >-import org.eclipse.emf.common.util.*; >- >-public class DiagnosticTestGen >-{ >- protected static String nl; >- public static synchronized DiagnosticTestGen create(String lineSeparator) >- { >- nl = lineSeparator; >- DiagnosticTestGen result = new DiagnosticTestGen(); >- nl = null; >- return result; >- } >- >- public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; >- protected final String TEXT_1 = NL + "import java.util.Iterator;" + NL + "" + NL + "import junit.framework.Test;" + NL + "import junit.framework.TestCase;" + NL + "import junit.framework.TestSuite;" + NL + "" + NL + "import org.eclipse.emf.common.util.AbstractTreeIterator;" + NL + "import org.eclipse.emf.common.util.Diagnostic;" + NL + "import org.eclipse.emf.common.util.TreeIterator;" + NL + "import org.eclipse.emf.common.util.URI;" + NL + "import org.eclipse.emf.ecore.EPackage;" + NL + "import org.eclipse.emf.ecore.resource.Resource;" + NL + "import org.eclipse.emf.ecore.util.Diagnostician;" + NL + "import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;" + NL + "import org.eclipse.emf.test.common.TestUtil;" + NL + "" + NL + "public class "; >- protected final String TEXT_2 = "DiagnosticTest extends TestCase" + NL + "{" + NL + "\tprotected Diagnostic diagnostic;" + NL + "\t" + NL + "\tpublic "; >- protected final String TEXT_3 = "DiagnosticTest(String name)" + NL + "\t{" + NL + "\t\tsuper(name);" + NL + "\t}" + NL + "\t" + NL + "\tpublic static Test suite()" + NL + "\t{" + NL + "\t\tTestSuite ts = new TestSuite(\"DianosticTest\");" + NL + "\t\tts.addTest(new "; >- protected final String TEXT_4 = "DiagnosticTest(\"testDiagnostic\"));" + NL + "\t\treturn ts;" + NL + "\t}" + NL + "\t" + NL + "\t@Override" + NL + "\tprotected void setUp() throws Exception" + NL + "\t{" + NL + "\t\t//TODO:Instantiates the diagnostic here" + NL + "\t\t" + NL + "\t\tassertNotNull(diagnostic);" + NL + "\t}" + NL + "\t" + NL + "\tpublic void testDiagnostic() throws Exception" + NL + "\t{" + NL + "\t\tTreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(diagnostic)" + NL + "\t\t{" + NL + "\t\t\tprivate static final long serialVersionUID = 1L;" + NL + "\t\t\t@Override" + NL + "\t\t\tprotected Iterator<? extends Diagnostic> getChildren(Object object)" + NL + "\t\t\t{" + NL + "\t\t\t\treturn ((Diagnostic)object).getChildren().iterator();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t"; >- protected final String TEXT_5 = NL + "\t\tDiagnostic diagnostic"; >- protected final String TEXT_6 = " = diagnosticIterator.next();" + NL + "\t\tassertEquals("; >- protected final String TEXT_7 = ", diagnostic"; >- protected final String TEXT_8 = ".getSeverity());" + NL + "\t\tassertEquals("; >- protected final String TEXT_9 = ", diagnostic"; >- protected final String TEXT_10 = ".getSource());" + NL + "\t\tassertEquals("; >- protected final String TEXT_11 = ", removeObjectHashCode(diagnostic"; >- protected final String TEXT_12 = ".getMessage()));" + NL + "\t\tassertEquals("; >- protected final String TEXT_13 = ", diagnostic"; >- protected final String TEXT_14 = ".getCode());" + NL + "\t\tassertEquals("; >- protected final String TEXT_15 = ", diagnostic"; >- protected final String TEXT_16 = ".getChildren().size());" + NL + "\t\tassertEquals("; >- protected final String TEXT_17 = ", diagnostic"; >- protected final String TEXT_18 = ".getData().size());" + NL + "\t\t"; >- protected final String TEXT_19 = "assertEquals("; >- protected final String TEXT_20 = ", toString(diagnostic"; >- protected final String TEXT_21 = ".getException()));" + NL + "\t\t"; >- protected final String TEXT_22 = "assertNull(diagnostic"; >- protected final String TEXT_23 = ".getException());"; >- protected final String TEXT_24 = NL + "\t\t" + NL + "\t\tassertFalse(diagnosticIterator.hasNext());" + NL + "\t}" + NL + "\t" + NL + "\tprotected String toString(Throwable throwable)" + NL + "\t{" + NL + "\t\tStringBuilder sb = new StringBuilder();" + NL + "\t\tsb.append(throwable.getClass().getName());" + NL + "\t\tsb.append(\"#\").append(throwable.getMessage());" + NL + "" + NL + "\t\tThrowable cause = throwable.getCause();" + NL + "\t\tif (cause != null && cause != throwable)" + NL + "\t\t{" + NL + "\t\t\tsb.append(\"--\").append(toString(cause));" + NL + "\t\t}" + NL + "\t\treturn sb.toString();" + NL + "\t}" + NL + "\t" + NL + "\tprotected String removeObjectHashCode(String string)" + NL + "\t{" + NL + "\t\treturn string.replaceAll(\"@\\\\w+\", \"\");" + NL + "\t}" + NL + "}"; >- protected final String TEXT_25 = NL; >- >- public String generate(Object argument) >- { >- final StringBuffer stringBuffer = new StringBuffer(); >- >-/** >- * Copyright (c) 2006-2007 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM - Initial API and implementation >- */ >- >- >- String name = (String)((Object[])argument)[0]; >- Diagnostic rootDiagnostic = (Diagnostic)((Object[])argument)[1]; >- TreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(rootDiagnostic) >- { >- private static final long serialVersionUID = 1L; >- @Override >- protected Iterator<? extends Diagnostic> getChildren(Object object) >- { >- return ((Diagnostic)object).getChildren().iterator(); >- } >- }; >- >- class Helper >- { >- public String toString(Throwable throwable) >- { >- StringBuilder sb = new StringBuilder(); >- sb.append(throwable.getClass().getName()); >- sb.append("#").append(throwable.getMessage()); >- >- Throwable cause = throwable.getCause(); >- if (cause != null && cause != throwable) >- { >- sb.append("--").append(toString(cause)); >- } >- return sb.toString(); >- } >- >- protected String removeObjectHashCode(String string) >- { >- return string.replaceAll("@\\w+", ""); >- } >- >- >- public String toCodeString(String string) >- { >- return "\"" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\\"", "\\\\\"") + "\""; >- } >- >- public String getDiagnosticSeverity(int value) >- { >- switch(value) >- { >- case Diagnostic.CANCEL: >- return "Diagnostic.CANCEL"; >- case Diagnostic.OK: >- return "Diagnostic.OK"; >- case Diagnostic.INFO: >- return "Diagnostic.INFO"; >- case Diagnostic.ERROR: >- return "Diagnostic.ERROR"; >- case Diagnostic.WARNING: >- return "Diagnostic.WARNING"; >- default: >- return Integer.toString(value); >- } >- } >- } >- Helper helper = new Helper(); >- >- stringBuffer.append(TEXT_1); >- stringBuffer.append(name); >- stringBuffer.append(TEXT_2); >- stringBuffer.append(name); >- stringBuffer.append(TEXT_3); >- stringBuffer.append(name); >- stringBuffer.append(TEXT_4); >- int count=0; while(diagnosticIterator.hasNext()){Diagnostic diagnostic = diagnosticIterator.next(); count++; >- stringBuffer.append(TEXT_5); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_6); >- stringBuffer.append(helper.getDiagnosticSeverity(diagnostic.getSeverity())); >- stringBuffer.append(TEXT_7); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_8); >- stringBuffer.append(helper.toCodeString(diagnostic.getSource())); >- stringBuffer.append(TEXT_9); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_10); >- stringBuffer.append(helper.removeObjectHashCode(helper.toCodeString(diagnostic.getMessage()))); >- stringBuffer.append(TEXT_11); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_12); >- stringBuffer.append(diagnostic.getCode()); >- stringBuffer.append(TEXT_13); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_14); >- stringBuffer.append(diagnostic.getChildren().size()); >- stringBuffer.append(TEXT_15); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_16); >- stringBuffer.append(diagnostic.getData().size()); >- stringBuffer.append(TEXT_17); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_18); >- Throwable throwable = diagnostic.getException(); if (throwable != null) { >- stringBuffer.append(TEXT_19); >- stringBuffer.append(helper.toCodeString(helper.toString(diagnostic.getException()))); >- stringBuffer.append(TEXT_20); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_21); >- } else { >- stringBuffer.append(TEXT_22); >- stringBuffer.append(count); >- stringBuffer.append(TEXT_23); >- } if (diagnosticIterator.hasNext()) {stringBuffer.append(NL);}} >- stringBuffer.append(TEXT_24); >- stringBuffer.append(TEXT_25); >- return stringBuffer.toString(); >- } >-} >+package org.eclipse.emf.test.common.templates; >+ >+import java.util.*; >+import org.eclipse.emf.common.util.*; >+ >+public class DiagnosticTestGen >+{ >+ protected static String nl; >+ public static synchronized DiagnosticTestGen create(String lineSeparator) >+ { >+ nl = lineSeparator; >+ DiagnosticTestGen result = new DiagnosticTestGen(); >+ nl = null; >+ return result; >+ } >+ >+ public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; >+ protected final String TEXT_1 = NL + "import java.util.Iterator;" + NL + "" + NL + "import junit.framework.Test;" + NL + "import junit.framework.TestCase;" + NL + "import junit.framework.TestSuite;" + NL + "" + NL + "import org.eclipse.emf.common.util.AbstractTreeIterator;" + NL + "import org.eclipse.emf.common.util.Diagnostic;" + NL + "import org.eclipse.emf.common.util.TreeIterator;" + NL + "import org.eclipse.emf.common.util.URI;" + NL + "import org.eclipse.emf.ecore.EPackage;" + NL + "import org.eclipse.emf.ecore.resource.Resource;" + NL + "import org.eclipse.emf.ecore.util.Diagnostician;" + NL + "import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;" + NL + "import org.eclipse.emf.test.common.TestUtil;" + NL + "" + NL + "public class "; >+ protected final String TEXT_2 = "DiagnosticTest extends TestCase" + NL + "{" + NL + "\tprotected Diagnostic diagnostic;" + NL + "\t" + NL + "\tpublic "; >+ protected final String TEXT_3 = "DiagnosticTest(String name)" + NL + "\t{" + NL + "\t\tsuper(name);" + NL + "\t}" + NL + "\t" + NL + "\tpublic static Test suite()" + NL + "\t{" + NL + "\t\tTestSuite ts = new TestSuite(\"DianosticTest\");" + NL + "\t\tts.addTest(new "; >+ protected final String TEXT_4 = "DiagnosticTest(\"testDiagnostic\"));" + NL + "\t\treturn ts;" + NL + "\t}" + NL + "\t" + NL + "\t@Override" + NL + "\tprotected void setUp() throws Exception" + NL + "\t{" + NL + "\t\t//TODO:Instantiates the diagnostic here" + NL + "\t\t" + NL + "\t\tassertNotNull(diagnostic);" + NL + "\t}" + NL + "\t" + NL + "\tpublic void testDiagnostic() throws Exception" + NL + "\t{" + NL + "\t\tTreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(diagnostic)" + NL + "\t\t{" + NL + "\t\t\tprivate static final long serialVersionUID = 1L;" + NL + "\t\t\t@Override" + NL + "\t\t\tprotected Iterator<? extends Diagnostic> getChildren(Object object)" + NL + "\t\t\t{" + NL + "\t\t\t\treturn ((Diagnostic)object).getChildren().iterator();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t"; >+ protected final String TEXT_5 = NL + "\t\tDiagnostic diagnostic"; >+ protected final String TEXT_6 = " = diagnosticIterator.next();" + NL + "\t\tassertEquals("; >+ protected final String TEXT_7 = ", diagnostic"; >+ protected final String TEXT_8 = ".getSeverity());" + NL + "\t\tassertEquals("; >+ protected final String TEXT_9 = ", diagnostic"; >+ protected final String TEXT_10 = ".getSource());" + NL + "\t\tassertEquals("; >+ protected final String TEXT_11 = ", removeObjectHashCode(diagnostic"; >+ protected final String TEXT_12 = ".getMessage()));" + NL + "\t\tassertEquals("; >+ protected final String TEXT_13 = ", diagnostic"; >+ protected final String TEXT_14 = ".getCode());" + NL + "\t\tassertEquals("; >+ protected final String TEXT_15 = ", diagnostic"; >+ protected final String TEXT_16 = ".getChildren().size());" + NL + "\t\tassertEquals("; >+ protected final String TEXT_17 = ", diagnostic"; >+ protected final String TEXT_18 = ".getData().size());" + NL + "\t\t"; >+ protected final String TEXT_19 = "assertEquals("; >+ protected final String TEXT_20 = ", toString(diagnostic"; >+ protected final String TEXT_21 = ".getException()));" + NL + "\t\t"; >+ protected final String TEXT_22 = "assertNull(diagnostic"; >+ protected final String TEXT_23 = ".getException());"; >+ protected final String TEXT_24 = NL + "\t\t" + NL + "\t\tassertFalse(diagnosticIterator.hasNext());" + NL + "\t}" + NL + "\t" + NL + "\tprotected String toString(Throwable throwable)" + NL + "\t{" + NL + "\t\tStringBuilder sb = new StringBuilder();" + NL + "\t\tsb.append(throwable.getClass().getName());" + NL + "\t\tsb.append(\"#\").append(throwable.getMessage());" + NL + "" + NL + "\t\tThrowable cause = throwable.getCause();" + NL + "\t\tif (cause != null && cause != throwable)" + NL + "\t\t{" + NL + "\t\t\tsb.append(\"--\").append(toString(cause));" + NL + "\t\t}" + NL + "\t\treturn sb.toString();" + NL + "\t}" + NL + "\t" + NL + "\tprotected String removeObjectHashCode(String string)" + NL + "\t{" + NL + "\t\treturn string.replaceAll(\"@\\\\w+\", \"\");" + NL + "\t}" + NL + "}"; >+ protected final String TEXT_25 = NL; >+ >+ public String generate(Object argument) >+ { >+ final StringBuffer stringBuffer = new StringBuffer(); >+ >+/** >+ * Copyright (c) 2006-2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ */ >+ >+ >+ String name = (String)((Object[])argument)[0]; >+ Diagnostic rootDiagnostic = (Diagnostic)((Object[])argument)[1]; >+ TreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(rootDiagnostic) >+ { >+ private static final long serialVersionUID = 1L; >+ @Override >+ protected Iterator<? extends Diagnostic> getChildren(Object object) >+ { >+ return ((Diagnostic)object).getChildren().iterator(); >+ } >+ }; >+ >+ class Helper >+ { >+ public String toString(Throwable throwable) >+ { >+ StringBuilder sb = new StringBuilder(); >+ sb.append(throwable.getClass().getName()); >+ sb.append("#").append(throwable.getMessage()); >+ >+ Throwable cause = throwable.getCause(); >+ if (cause != null && cause != throwable) >+ { >+ sb.append("--").append(toString(cause)); >+ } >+ return sb.toString(); >+ } >+ >+ protected String removeObjectHashCode(String string) >+ { >+ return string.replaceAll("@\\w+", ""); >+ } >+ >+ >+ public String toCodeString(String string) >+ { >+ return "\"" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\\"", "\\\\\"") + "\""; >+ } >+ >+ public String getDiagnosticSeverity(int value) >+ { >+ switch(value) >+ { >+ case Diagnostic.CANCEL: >+ return "Diagnostic.CANCEL"; >+ case Diagnostic.OK: >+ return "Diagnostic.OK"; >+ case Diagnostic.INFO: >+ return "Diagnostic.INFO"; >+ case Diagnostic.ERROR: >+ return "Diagnostic.ERROR"; >+ case Diagnostic.WARNING: >+ return "Diagnostic.WARNING"; >+ default: >+ return Integer.toString(value); >+ } >+ } >+ } >+ Helper helper = new Helper(); >+ >+ stringBuffer.append(TEXT_1); >+ stringBuffer.append(name); >+ stringBuffer.append(TEXT_2); >+ stringBuffer.append(name); >+ stringBuffer.append(TEXT_3); >+ stringBuffer.append(name); >+ stringBuffer.append(TEXT_4); >+ int count=0; while(diagnosticIterator.hasNext()){Diagnostic diagnostic = diagnosticIterator.next(); count++; >+ stringBuffer.append(TEXT_5); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_6); >+ stringBuffer.append(helper.getDiagnosticSeverity(diagnostic.getSeverity())); >+ stringBuffer.append(TEXT_7); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_8); >+ stringBuffer.append(helper.toCodeString(diagnostic.getSource())); >+ stringBuffer.append(TEXT_9); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_10); >+ stringBuffer.append(helper.removeObjectHashCode(helper.toCodeString(diagnostic.getMessage()))); >+ stringBuffer.append(TEXT_11); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_12); >+ stringBuffer.append(diagnostic.getCode()); >+ stringBuffer.append(TEXT_13); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_14); >+ stringBuffer.append(diagnostic.getChildren().size()); >+ stringBuffer.append(TEXT_15); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_16); >+ stringBuffer.append(diagnostic.getData().size()); >+ stringBuffer.append(TEXT_17); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_18); >+ Throwable throwable = diagnostic.getException(); if (throwable != null) { >+ stringBuffer.append(TEXT_19); >+ stringBuffer.append(helper.toCodeString(helper.toString(diagnostic.getException()))); >+ stringBuffer.append(TEXT_20); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_21); >+ } else { >+ stringBuffer.append(TEXT_22); >+ stringBuffer.append(count); >+ stringBuffer.append(TEXT_23); >+ } if (diagnosticIterator.hasNext()) {stringBuffer.append(NL);}} >+ stringBuffer.append(TEXT_24); >+ stringBuffer.append(TEXT_25); >+ return stringBuffer.toString(); >+ } >+} >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class0.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class0.java >new file mode 100644 >index 0000000..1e29d13 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class0.java >@@ -0,0 +1,270 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation; >+ >+import org.eclipse.emf.ecore.EObject; >+ >+/** >+ * <!-- begin-user-doc --> >+ * A representation of the model object '<em><b>Class0</b></em>'. >+ * <!-- end-user-doc --> >+ * >+ * <p> >+ * The following features are supported: >+ * <ul> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean <em>Test Boolean</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte <em>Test Byte</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar <em>Test Char</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble <em>Test Double</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat <em>Test Float</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt <em>Test Int</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong <em>Test Long</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort <em>Test Short</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1 <em>Class1</em>}</li> >+ * </ul> >+ * </p> >+ * >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0() >+ * @model >+ * @generated >+ */ >+public interface Class0 extends EObject { >+ /** >+ * Returns the value of the '<em><b>Test Boolean</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Boolean</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Boolean</em>' attribute. >+ * @see #setTestBoolean(boolean) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestBoolean() >+ * @model >+ * @generated >+ */ >+ boolean isTestBoolean(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean <em>Test Boolean</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Boolean</em>' attribute. >+ * @see #isTestBoolean() >+ * @generated >+ */ >+ void setTestBoolean(boolean value); >+ >+ /** >+ * Returns the value of the '<em><b>Test Byte</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Byte</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Byte</em>' attribute. >+ * @see #setTestByte(byte) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestByte() >+ * @model >+ * @generated >+ */ >+ byte getTestByte(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte <em>Test Byte</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Byte</em>' attribute. >+ * @see #getTestByte() >+ * @generated >+ */ >+ void setTestByte(byte value); >+ >+ /** >+ * Returns the value of the '<em><b>Test Char</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Char</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Char</em>' attribute. >+ * @see #setTestChar(char) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestChar() >+ * @model >+ * @generated >+ */ >+ char getTestChar(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar <em>Test Char</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Char</em>' attribute. >+ * @see #getTestChar() >+ * @generated >+ */ >+ void setTestChar(char value); >+ >+ /** >+ * Returns the value of the '<em><b>Test Double</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Double</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Double</em>' attribute. >+ * @see #setTestDouble(double) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestDouble() >+ * @model >+ * @generated >+ */ >+ double getTestDouble(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble <em>Test Double</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Double</em>' attribute. >+ * @see #getTestDouble() >+ * @generated >+ */ >+ void setTestDouble(double value); >+ >+ /** >+ * Returns the value of the '<em><b>Test Float</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Float</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Float</em>' attribute. >+ * @see #setTestFloat(float) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestFloat() >+ * @model >+ * @generated >+ */ >+ float getTestFloat(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat <em>Test Float</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Float</em>' attribute. >+ * @see #getTestFloat() >+ * @generated >+ */ >+ void setTestFloat(float value); >+ >+ /** >+ * Returns the value of the '<em><b>Test Int</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Int</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Int</em>' attribute. >+ * @see #setTestInt(int) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestInt() >+ * @model >+ * @generated >+ */ >+ int getTestInt(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt <em>Test Int</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Int</em>' attribute. >+ * @see #getTestInt() >+ * @generated >+ */ >+ void setTestInt(int value); >+ >+ /** >+ * Returns the value of the '<em><b>Test Long</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Long</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Long</em>' attribute. >+ * @see #setTestLong(long) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestLong() >+ * @model >+ * @generated >+ */ >+ long getTestLong(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong <em>Test Long</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Long</em>' attribute. >+ * @see #getTestLong() >+ * @generated >+ */ >+ void setTestLong(long value); >+ >+ /** >+ * Returns the value of the '<em><b>Test Short</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Test Short</em>' attribute isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Test Short</em>' attribute. >+ * @see #setTestShort(short) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestShort() >+ * @model >+ * @generated >+ */ >+ short getTestShort(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort <em>Test Short</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Test Short</em>' attribute. >+ * @see #getTestShort() >+ * @generated >+ */ >+ void setTestShort(short value); >+ >+ /** >+ * Returns the value of the '<em><b>Class1</b></em>' containment reference. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Class1</em>' containment reference isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Class1</em>' containment reference. >+ * @see #setClass1(Class1) >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_Class1() >+ * @model containment="true" >+ * @generated >+ */ >+ Class1 getClass1(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1 <em>Class1</em>}' containment reference. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Class1</em>' containment reference. >+ * @see #getClass1() >+ * @generated >+ */ >+ void setClass1(Class1 value); >+ >+} // Class0 >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class1.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class1.java >new file mode 100644 >index 0000000..3f2ad46 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class1.java >@@ -0,0 +1,22 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation; >+ >+import org.eclipse.emf.ecore.EObject; >+ >+/** >+ * <!-- begin-user-doc --> >+ * A representation of the model object '<em><b>Class1</b></em>'. >+ * <!-- end-user-doc --> >+ * >+ * >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass1() >+ * @model >+ * @generated >+ */ >+public interface Class1 extends EObject { >+} // Class1 >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationFactory.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationFactory.java >new file mode 100644 >index 0000000..72f695a >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationFactory.java >@@ -0,0 +1,55 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation; >+ >+import org.eclipse.emf.ecore.EFactory; >+ >+/** >+ * <!-- begin-user-doc --> >+ * The <b>Factory</b> for the model. >+ * It provides a create method for each non-abstract class of the model. >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage >+ * @generated >+ */ >+public interface DynamicDelegationFactory extends EFactory { >+ /** >+ * The singleton instance of the factory. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ DynamicDelegationFactory eINSTANCE = org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationFactoryImpl.init(); >+ >+ /** >+ * Returns a new object of class '<em>Class0</em>'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return a new object of class '<em>Class0</em>'. >+ * @generated >+ */ >+ Class0 createClass0(); >+ >+ /** >+ * Returns a new object of class '<em>Class1</em>'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return a new object of class '<em>Class1</em>'. >+ * @generated >+ */ >+ Class1 createClass1(); >+ >+ /** >+ * Returns the package supported by this factory. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the package supported by this factory. >+ * @generated >+ */ >+ DynamicDelegationPackage getDynamicDelegationPackage(); >+ >+} //DynamicDelegationFactory >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationPackage.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationPackage.java >new file mode 100644 >index 0000000..cbafec5 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationPackage.java >@@ -0,0 +1,417 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation; >+ >+import org.eclipse.emf.ecore.EAttribute; >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.EPackage; >+import org.eclipse.emf.ecore.EReference; >+ >+/** >+ * <!-- begin-user-doc --> >+ * The <b>Package</b> for the model. >+ * It contains accessors for the meta objects to represent >+ * <ul> >+ * <li>each class,</li> >+ * <li>each feature of each class,</li> >+ * <li>each enum,</li> >+ * <li>and each data type</li> >+ * </ul> >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationFactory >+ * @model kind="package" >+ * @generated >+ */ >+public interface DynamicDelegationPackage extends EPackage { >+ /** >+ * The package name. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ String eNAME = "dynamicDelegation"; >+ >+ /** >+ * The package namespace URI. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ String eNS_URI = "http:///org.eclipse.emf.test.models/DynamicDelegation"; >+ >+ /** >+ * The package namespace name. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ String eNS_PREFIX = "dynamicDelegation"; >+ >+ /** >+ * The singleton instance of the package. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ DynamicDelegationPackage eINSTANCE = org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl.init(); >+ >+ /** >+ * The meta object id for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl <em>Class0</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass0() >+ * @generated >+ */ >+ int CLASS0 = 0; >+ >+ /** >+ * The feature id for the '<em><b>Test Boolean</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_BOOLEAN = 0; >+ >+ /** >+ * The feature id for the '<em><b>Test Byte</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_BYTE = 1; >+ >+ /** >+ * The feature id for the '<em><b>Test Char</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_CHAR = 2; >+ >+ /** >+ * The feature id for the '<em><b>Test Double</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_DOUBLE = 3; >+ >+ /** >+ * The feature id for the '<em><b>Test Float</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_FLOAT = 4; >+ >+ /** >+ * The feature id for the '<em><b>Test Int</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_INT = 5; >+ >+ /** >+ * The feature id for the '<em><b>Test Long</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_LONG = 6; >+ >+ /** >+ * The feature id for the '<em><b>Test Short</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__TEST_SHORT = 7; >+ >+ /** >+ * The feature id for the '<em><b>Class1</b></em>' containment reference. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0__CLASS1 = 8; >+ >+ /** >+ * The number of structural features of the '<em>Class0</em>' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS0_FEATURE_COUNT = 9; >+ >+ /** >+ * The meta object id for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl <em>Class1</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass1() >+ * @generated >+ */ >+ int CLASS1 = 1; >+ >+ /** >+ * The number of structural features of the '<em>Class1</em>' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ */ >+ int CLASS1_FEATURE_COUNT = 0; >+ >+ >+ /** >+ * Returns the meta object for class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0 <em>Class0</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for class '<em>Class0</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0 >+ * @generated >+ */ >+ EClass getClass0(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean <em>Test Boolean</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Boolean</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestBoolean(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte <em>Test Byte</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Byte</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestByte(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar <em>Test Char</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Char</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestChar(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble <em>Test Double</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Double</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestDouble(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat <em>Test Float</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Float</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestFloat(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt <em>Test Int</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Int</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestInt(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong <em>Test Long</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Long</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestLong(); >+ >+ /** >+ * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort <em>Test Short</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the attribute '<em>Test Short</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort() >+ * @see #getClass0() >+ * @generated >+ */ >+ EAttribute getClass0_TestShort(); >+ >+ /** >+ * Returns the meta object for the containment reference '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1 <em>Class1</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for the containment reference '<em>Class1</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1() >+ * @see #getClass0() >+ * @generated >+ */ >+ EReference getClass0_Class1(); >+ >+ /** >+ * Returns the meta object for class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class1 <em>Class1</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for class '<em>Class1</em>'. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class1 >+ * @generated >+ */ >+ EClass getClass1(); >+ >+ /** >+ * Returns the factory that creates the instances of the model. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the factory that creates the instances of the model. >+ * @generated >+ */ >+ DynamicDelegationFactory getDynamicDelegationFactory(); >+ >+ /** >+ * <!-- begin-user-doc --> >+ * Defines literals for the meta objects that represent >+ * <ul> >+ * <li>each class,</li> >+ * <li>each feature of each class,</li> >+ * <li>each enum,</li> >+ * <li>and each data type</li> >+ * </ul> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ interface Literals { >+ /** >+ * The meta object literal for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl <em>Class0</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass0() >+ * @generated >+ */ >+ EClass CLASS0 = eINSTANCE.getClass0(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Boolean</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_BOOLEAN = eINSTANCE.getClass0_TestBoolean(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Byte</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_BYTE = eINSTANCE.getClass0_TestByte(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Char</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_CHAR = eINSTANCE.getClass0_TestChar(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Double</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_DOUBLE = eINSTANCE.getClass0_TestDouble(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Float</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_FLOAT = eINSTANCE.getClass0_TestFloat(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Int</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_INT = eINSTANCE.getClass0_TestInt(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Long</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_LONG = eINSTANCE.getClass0_TestLong(); >+ >+ /** >+ * The meta object literal for the '<em><b>Test Short</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CLASS0__TEST_SHORT = eINSTANCE.getClass0_TestShort(); >+ >+ /** >+ * The meta object literal for the '<em><b>Class1</b></em>' containment reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference CLASS0__CLASS1 = eINSTANCE.getClass0_Class1(); >+ >+ /** >+ * The meta object literal for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl <em>Class1</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl >+ * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass1() >+ * @generated >+ */ >+ EClass CLASS1 = eINSTANCE.getClass1(); >+ >+ } >+ >+} //DynamicDelegationPackage >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class0Impl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class0Impl.java >new file mode 100644 >index 0000000..25aac83 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class0Impl.java >@@ -0,0 +1,475 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl; >+ >+import org.eclipse.emf.common.notify.NotificationChain; >+ >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.InternalEObject; >+ >+import org.eclipse.emf.ecore.impl.EObjectImpl; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.Class0; >+import org.eclipse.emf.test.models.dynamicDelegation.Class1; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model object '<em><b>Class0</b></em>'. >+ * <!-- end-user-doc --> >+ * <p> >+ * The following features are implemented: >+ * <ul> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#isTestBoolean <em>Test Boolean</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestByte <em>Test Byte</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestChar <em>Test Char</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestDouble <em>Test Double</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestFloat <em>Test Float</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestInt <em>Test Int</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestLong <em>Test Long</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestShort <em>Test Short</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getClass1 <em>Class1</em>}</li> >+ * </ul> >+ * </p> >+ * >+ * @generated >+ */ >+public class Class0Impl extends EObjectImpl implements Class0 { >+ /** >+ * The default value of the '{@link #isTestBoolean() <em>Test Boolean</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #isTestBoolean() >+ * @generated >+ * @ordered >+ */ >+ protected static final boolean TEST_BOOLEAN_EDEFAULT = false; >+ >+ /** >+ * The default value of the '{@link #getTestByte() <em>Test Byte</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestByte() >+ * @generated >+ * @ordered >+ */ >+ protected static final byte TEST_BYTE_EDEFAULT = 0x00; >+ >+ /** >+ * The default value of the '{@link #getTestChar() <em>Test Char</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestChar() >+ * @generated >+ * @ordered >+ */ >+ protected static final char TEST_CHAR_EDEFAULT = '\u0000'; >+ >+ /** >+ * The default value of the '{@link #getTestDouble() <em>Test Double</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestDouble() >+ * @generated >+ * @ordered >+ */ >+ protected static final double TEST_DOUBLE_EDEFAULT = 0.0; >+ >+ /** >+ * The default value of the '{@link #getTestFloat() <em>Test Float</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestFloat() >+ * @generated >+ * @ordered >+ */ >+ protected static final float TEST_FLOAT_EDEFAULT = 0.0F; >+ >+ /** >+ * The default value of the '{@link #getTestInt() <em>Test Int</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestInt() >+ * @generated >+ * @ordered >+ */ >+ protected static final int TEST_INT_EDEFAULT = 0; >+ >+ /** >+ * The default value of the '{@link #getTestLong() <em>Test Long</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestLong() >+ * @generated >+ * @ordered >+ */ >+ protected static final long TEST_LONG_EDEFAULT = 0L; >+ >+ /** >+ * The default value of the '{@link #getTestShort() <em>Test Short</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestShort() >+ * @generated >+ * @ordered >+ */ >+ protected static final short TEST_SHORT_EDEFAULT = 0; >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ protected Class0Impl() { >+ super(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ protected EClass eStaticClass() { >+ return DynamicDelegationPackage.Literals.CLASS0; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ protected int eStaticFeatureCount() { >+ return 0; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public boolean isTestBoolean() { >+ return (Boolean)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_BOOLEAN, DynamicDelegationPackage.Literals.CLASS0__TEST_BOOLEAN, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestBoolean(boolean newTestBoolean) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_BOOLEAN, DynamicDelegationPackage.Literals.CLASS0__TEST_BOOLEAN, newTestBoolean); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public byte getTestByte() { >+ return (Byte)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_BYTE, DynamicDelegationPackage.Literals.CLASS0__TEST_BYTE, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestByte(byte newTestByte) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_BYTE, DynamicDelegationPackage.Literals.CLASS0__TEST_BYTE, newTestByte); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public char getTestChar() { >+ return (Character)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_CHAR, DynamicDelegationPackage.Literals.CLASS0__TEST_CHAR, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestChar(char newTestChar) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_CHAR, DynamicDelegationPackage.Literals.CLASS0__TEST_CHAR, newTestChar); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public double getTestDouble() { >+ return (Double)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_DOUBLE, DynamicDelegationPackage.Literals.CLASS0__TEST_DOUBLE, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestDouble(double newTestDouble) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_DOUBLE, DynamicDelegationPackage.Literals.CLASS0__TEST_DOUBLE, newTestDouble); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public float getTestFloat() { >+ return (Float)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_FLOAT, DynamicDelegationPackage.Literals.CLASS0__TEST_FLOAT, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestFloat(float newTestFloat) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_FLOAT, DynamicDelegationPackage.Literals.CLASS0__TEST_FLOAT, newTestFloat); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public int getTestInt() { >+ return (Integer)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_INT, DynamicDelegationPackage.Literals.CLASS0__TEST_INT, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestInt(int newTestInt) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_INT, DynamicDelegationPackage.Literals.CLASS0__TEST_INT, newTestInt); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public long getTestLong() { >+ return (Long)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_LONG, DynamicDelegationPackage.Literals.CLASS0__TEST_LONG, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestLong(long newTestLong) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_LONG, DynamicDelegationPackage.Literals.CLASS0__TEST_LONG, newTestLong); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public short getTestShort() { >+ return (Short)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_SHORT, DynamicDelegationPackage.Literals.CLASS0__TEST_SHORT, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestShort(short newTestShort) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_SHORT, DynamicDelegationPackage.Literals.CLASS0__TEST_SHORT, newTestShort); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public Class1 getClass1() { >+ return (Class1)eDynamicGet(DynamicDelegationPackage.CLASS0__CLASS1, DynamicDelegationPackage.Literals.CLASS0__CLASS1, true, true); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetClass1(Class1 newClass1, NotificationChain msgs) { >+ msgs = eDynamicInverseAdd((InternalEObject)newClass1, DynamicDelegationPackage.CLASS0__CLASS1, msgs); >+ return msgs; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setClass1(Class1 newClass1) { >+ eDynamicSet(DynamicDelegationPackage.CLASS0__CLASS1, DynamicDelegationPackage.Literals.CLASS0__CLASS1, newClass1); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ return basicSetClass1(null, msgs); >+ } >+ return super.eInverseRemove(otherEnd, featureID, msgs); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ return isTestBoolean(); >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ return getTestByte(); >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ return getTestChar(); >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ return getTestDouble(); >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ return getTestFloat(); >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ return getTestInt(); >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ return getTestLong(); >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ return getTestShort(); >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ return getClass1(); >+ } >+ return super.eGet(featureID, resolve, coreType); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ setTestBoolean((Boolean)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ setTestByte((Byte)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ setTestChar((Character)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ setTestDouble((Double)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ setTestFloat((Float)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ setTestInt((Integer)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ setTestLong((Long)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ setTestShort((Short)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ setClass1((Class1)newValue); >+ return; >+ } >+ super.eSet(featureID, newValue); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ setTestBoolean(TEST_BOOLEAN_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ setTestByte(TEST_BYTE_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ setTestChar(TEST_CHAR_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ setTestDouble(TEST_DOUBLE_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ setTestFloat(TEST_FLOAT_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ setTestInt(TEST_INT_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ setTestLong(TEST_LONG_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ setTestShort(TEST_SHORT_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ setClass1((Class1)null); >+ return; >+ } >+ super.eUnset(featureID); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ return isTestBoolean() != TEST_BOOLEAN_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ return getTestByte() != TEST_BYTE_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ return getTestChar() != TEST_CHAR_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ return getTestDouble() != TEST_DOUBLE_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ return getTestFloat() != TEST_FLOAT_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ return getTestInt() != TEST_INT_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ return getTestLong() != TEST_LONG_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ return getTestShort() != TEST_SHORT_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ return getClass1() != null; >+ } >+ return super.eIsSet(featureID); >+ } >+ >+} //Class0Impl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class1Impl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class1Impl.java >new file mode 100644 >index 0000000..e46ec0a >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class1Impl.java >@@ -0,0 +1,55 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl; >+ >+import org.eclipse.emf.ecore.EClass; >+ >+import org.eclipse.emf.ecore.impl.EObjectImpl; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.Class1; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model object '<em><b>Class1</b></em>'. >+ * <!-- end-user-doc --> >+ * <p> >+ * </p> >+ * >+ * @generated >+ */ >+public class Class1Impl extends EObjectImpl implements Class1 { >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ protected Class1Impl() { >+ super(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ protected EClass eStaticClass() { >+ return DynamicDelegationPackage.Literals.CLASS1; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ protected int eStaticFeatureCount() { >+ return 0; >+ } >+ >+} //Class1Impl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationFactoryImpl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationFactoryImpl.java >new file mode 100644 >index 0000000..51653ed >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationFactoryImpl.java >@@ -0,0 +1,110 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl; >+ >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EPackage; >+ >+import org.eclipse.emf.ecore.impl.EFactoryImpl; >+ >+import org.eclipse.emf.ecore.plugin.EcorePlugin; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.*; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model <b>Factory</b>. >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+public class DynamicDelegationFactoryImpl extends EFactoryImpl implements DynamicDelegationFactory { >+ /** >+ * Creates the default factory implementation. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public static DynamicDelegationFactory init() { >+ try { >+ DynamicDelegationFactory theDynamicDelegationFactory = (DynamicDelegationFactory)EPackage.Registry.INSTANCE.getEFactory("http:///org.eclipse.emf.test.models/DynamicDelegation"); >+ if (theDynamicDelegationFactory != null) { >+ return theDynamicDelegationFactory; >+ } >+ } >+ catch (Exception exception) { >+ EcorePlugin.INSTANCE.log(exception); >+ } >+ return new DynamicDelegationFactoryImpl(); >+ } >+ >+ /** >+ * Creates an instance of the factory. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationFactoryImpl() { >+ super(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public EObject create(EClass eClass) { >+ switch (eClass.getClassifierID()) { >+ case DynamicDelegationPackage.CLASS0: return createClass0(); >+ case DynamicDelegationPackage.CLASS1: return createClass1(); >+ default: >+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); >+ } >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public Class0 createClass0() { >+ Class0Impl class0 = new Class0Impl(); >+ return class0; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public Class1 createClass1() { >+ Class1Impl class1 = new Class1Impl(); >+ return class1; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationPackage getDynamicDelegationPackage() { >+ return (DynamicDelegationPackage)getEPackage(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @deprecated >+ * @generated >+ */ >+ @Deprecated >+ public static DynamicDelegationPackage getPackage() { >+ return DynamicDelegationPackage.eINSTANCE; >+ } >+ >+} //DynamicDelegationFactoryImpl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationPackageImpl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationPackageImpl.java >new file mode 100644 >index 0000000..65e7281 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationPackageImpl.java >@@ -0,0 +1,291 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl; >+ >+import org.eclipse.emf.ecore.EAttribute; >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.EPackage; >+import org.eclipse.emf.ecore.EReference; >+ >+import org.eclipse.emf.ecore.impl.EPackageImpl; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.Class0; >+import org.eclipse.emf.test.models.dynamicDelegation.Class1; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationFactory; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model <b>Package</b>. >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+public class DynamicDelegationPackageImpl extends EPackageImpl implements DynamicDelegationPackage { >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private EClass class0EClass = null; >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private EClass class1EClass = null; >+ >+ /** >+ * Creates an instance of the model <b>Package</b>, registered with >+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package >+ * package URI value. >+ * <p>Note: the correct way to create the package is via the static >+ * factory method {@link #init init()}, which also performs >+ * initialization of the package, or returns the registered package, >+ * if one already exists. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.ecore.EPackage.Registry >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#eNS_URI >+ * @see #init() >+ * @generated >+ */ >+ private DynamicDelegationPackageImpl() { >+ super(eNS_URI, DynamicDelegationFactory.eINSTANCE); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private static boolean isInited = false; >+ >+ /** >+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. >+ * >+ * <p>This method is used to initialize {@link DynamicDelegationPackage#eINSTANCE} when that field is accessed. >+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #eNS_URI >+ * @see #createPackageContents() >+ * @see #initializePackageContents() >+ * @generated >+ */ >+ public static DynamicDelegationPackage init() { >+ if (isInited) return (DynamicDelegationPackage)EPackage.Registry.INSTANCE.getEPackage(DynamicDelegationPackage.eNS_URI); >+ >+ // Obtain or create and register package >+ DynamicDelegationPackageImpl theDynamicDelegationPackage = (DynamicDelegationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DynamicDelegationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DynamicDelegationPackageImpl()); >+ >+ isInited = true; >+ >+ // Create package meta-data objects >+ theDynamicDelegationPackage.createPackageContents(); >+ >+ // Initialize created meta-data >+ theDynamicDelegationPackage.initializePackageContents(); >+ >+ // Mark meta-data to indicate it can't be changed >+ theDynamicDelegationPackage.freeze(); >+ >+ >+ // Update the registry and return the package >+ EPackage.Registry.INSTANCE.put(DynamicDelegationPackage.eNS_URI, theDynamicDelegationPackage); >+ return theDynamicDelegationPackage; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EClass getClass0() { >+ return class0EClass; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestBoolean() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(0); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestByte() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(1); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestChar() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(2); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestDouble() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(3); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestFloat() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(4); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestInt() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(5); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestLong() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(6); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestShort() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(7); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EReference getClass0_Class1() { >+ return (EReference)class0EClass.getEStructuralFeatures().get(8); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EClass getClass1() { >+ return class1EClass; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationFactory getDynamicDelegationFactory() { >+ return (DynamicDelegationFactory)getEFactoryInstance(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private boolean isCreated = false; >+ >+ /** >+ * Creates the meta-model objects for the package. This method is >+ * guarded to have no affect on any invocation but its first. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void createPackageContents() { >+ if (isCreated) return; >+ isCreated = true; >+ >+ // Create classes and their features >+ class0EClass = createEClass(CLASS0); >+ createEAttribute(class0EClass, CLASS0__TEST_BOOLEAN); >+ createEAttribute(class0EClass, CLASS0__TEST_BYTE); >+ createEAttribute(class0EClass, CLASS0__TEST_CHAR); >+ createEAttribute(class0EClass, CLASS0__TEST_DOUBLE); >+ createEAttribute(class0EClass, CLASS0__TEST_FLOAT); >+ createEAttribute(class0EClass, CLASS0__TEST_INT); >+ createEAttribute(class0EClass, CLASS0__TEST_LONG); >+ createEAttribute(class0EClass, CLASS0__TEST_SHORT); >+ createEReference(class0EClass, CLASS0__CLASS1); >+ >+ class1EClass = createEClass(CLASS1); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private boolean isInitialized = false; >+ >+ /** >+ * Complete the initialization of the package and its meta-model. This >+ * method is guarded to have no affect on any invocation but its first. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void initializePackageContents() { >+ if (isInitialized) return; >+ isInitialized = true; >+ >+ // Initialize package >+ setName(eNAME); >+ setNsPrefix(eNS_PREFIX); >+ setNsURI(eNS_URI); >+ >+ // Create type parameters >+ >+ // Set bounds for type parameters >+ >+ // Add supertypes to classes >+ >+ // Initialize classes and features; add operations and parameters >+ initEClass(class0EClass, Class0.class, "Class0", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); >+ initEAttribute(getClass0_TestBoolean(), ecorePackage.getEBoolean(), "testBoolean", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestByte(), ecorePackage.getEByte(), "testByte", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestChar(), ecorePackage.getEChar(), "testChar", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestDouble(), ecorePackage.getEDouble(), "testDouble", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestFloat(), ecorePackage.getEFloat(), "testFloat", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestInt(), ecorePackage.getEInt(), "testInt", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestLong(), ecorePackage.getELong(), "testLong", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestShort(), ecorePackage.getEShort(), "testShort", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEReference(getClass0_Class1(), this.getClass1(), null, "class1", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ >+ initEClass(class1EClass, Class1.class, "Class1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); >+ >+ // Create resource >+ createResource(eNS_URI); >+ } >+ >+} //DynamicDelegationPackageImpl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class0Impl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class0Impl.java >new file mode 100644 >index 0000000..2767c4c >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class0Impl.java >@@ -0,0 +1,609 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl.none; >+ >+import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.common.notify.NotificationChain; >+ >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.InternalEObject; >+ >+import org.eclipse.emf.ecore.impl.ENotificationImpl; >+import org.eclipse.emf.ecore.impl.EObjectImpl; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.Class0; >+import org.eclipse.emf.test.models.dynamicDelegation.Class1; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model object '<em><b>Class0</b></em>'. >+ * <!-- end-user-doc --> >+ * <p> >+ * The following features are implemented: >+ * <ul> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#isTestBoolean <em>Test Boolean</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestByte <em>Test Byte</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestChar <em>Test Char</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestDouble <em>Test Double</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestFloat <em>Test Float</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestInt <em>Test Int</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestLong <em>Test Long</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestShort <em>Test Short</em>}</li> >+ * <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getClass1 <em>Class1</em>}</li> >+ * </ul> >+ * </p> >+ * >+ * @generated >+ */ >+public class Class0Impl extends EObjectImpl implements Class0 { >+ /** >+ * The default value of the '{@link #isTestBoolean() <em>Test Boolean</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #isTestBoolean() >+ * @generated >+ * @ordered >+ */ >+ protected static final boolean TEST_BOOLEAN_EDEFAULT = false; >+ /** >+ * The cached value of the '{@link #isTestBoolean() <em>Test Boolean</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #isTestBoolean() >+ * @generated >+ * @ordered >+ */ >+ protected boolean testBoolean = TEST_BOOLEAN_EDEFAULT; >+ /** >+ * The default value of the '{@link #getTestByte() <em>Test Byte</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestByte() >+ * @generated >+ * @ordered >+ */ >+ protected static final byte TEST_BYTE_EDEFAULT = 0x00; >+ /** >+ * The cached value of the '{@link #getTestByte() <em>Test Byte</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestByte() >+ * @generated >+ * @ordered >+ */ >+ protected byte testByte = TEST_BYTE_EDEFAULT; >+ /** >+ * The default value of the '{@link #getTestChar() <em>Test Char</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestChar() >+ * @generated >+ * @ordered >+ */ >+ protected static final char TEST_CHAR_EDEFAULT = '\u0000'; >+ /** >+ * The cached value of the '{@link #getTestChar() <em>Test Char</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestChar() >+ * @generated >+ * @ordered >+ */ >+ protected char testChar = TEST_CHAR_EDEFAULT; >+ /** >+ * The default value of the '{@link #getTestDouble() <em>Test Double</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestDouble() >+ * @generated >+ * @ordered >+ */ >+ protected static final double TEST_DOUBLE_EDEFAULT = 0.0; >+ /** >+ * The cached value of the '{@link #getTestDouble() <em>Test Double</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestDouble() >+ * @generated >+ * @ordered >+ */ >+ protected double testDouble = TEST_DOUBLE_EDEFAULT; >+ /** >+ * The default value of the '{@link #getTestFloat() <em>Test Float</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestFloat() >+ * @generated >+ * @ordered >+ */ >+ protected static final float TEST_FLOAT_EDEFAULT = 0.0F; >+ /** >+ * The cached value of the '{@link #getTestFloat() <em>Test Float</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestFloat() >+ * @generated >+ * @ordered >+ */ >+ protected float testFloat = TEST_FLOAT_EDEFAULT; >+ /** >+ * The default value of the '{@link #getTestInt() <em>Test Int</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestInt() >+ * @generated >+ * @ordered >+ */ >+ protected static final int TEST_INT_EDEFAULT = 0; >+ /** >+ * The cached value of the '{@link #getTestInt() <em>Test Int</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestInt() >+ * @generated >+ * @ordered >+ */ >+ protected int testInt = TEST_INT_EDEFAULT; >+ /** >+ * The default value of the '{@link #getTestLong() <em>Test Long</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestLong() >+ * @generated >+ * @ordered >+ */ >+ protected static final long TEST_LONG_EDEFAULT = 0L; >+ /** >+ * The cached value of the '{@link #getTestLong() <em>Test Long</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestLong() >+ * @generated >+ * @ordered >+ */ >+ protected long testLong = TEST_LONG_EDEFAULT; >+ /** >+ * The default value of the '{@link #getTestShort() <em>Test Short</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestShort() >+ * @generated >+ * @ordered >+ */ >+ protected static final short TEST_SHORT_EDEFAULT = 0; >+ /** >+ * The cached value of the '{@link #getTestShort() <em>Test Short</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getTestShort() >+ * @generated >+ * @ordered >+ */ >+ protected short testShort = TEST_SHORT_EDEFAULT; >+ /** >+ * The cached value of the '{@link #getClass1() <em>Class1</em>}' containment reference. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #getClass1() >+ * @generated >+ * @ordered >+ */ >+ protected Class1 class1; >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ protected Class0Impl() { >+ super(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ protected EClass eStaticClass() { >+ return DynamicDelegationPackage.Literals.CLASS0; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public boolean isTestBoolean() { >+ return testBoolean; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestBoolean(boolean newTestBoolean) { >+ boolean oldTestBoolean = testBoolean; >+ testBoolean = newTestBoolean; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_BOOLEAN, oldTestBoolean, testBoolean)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public byte getTestByte() { >+ return testByte; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestByte(byte newTestByte) { >+ byte oldTestByte = testByte; >+ testByte = newTestByte; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_BYTE, oldTestByte, testByte)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public char getTestChar() { >+ return testChar; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestChar(char newTestChar) { >+ char oldTestChar = testChar; >+ testChar = newTestChar; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_CHAR, oldTestChar, testChar)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public double getTestDouble() { >+ return testDouble; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestDouble(double newTestDouble) { >+ double oldTestDouble = testDouble; >+ testDouble = newTestDouble; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_DOUBLE, oldTestDouble, testDouble)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public float getTestFloat() { >+ return testFloat; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestFloat(float newTestFloat) { >+ float oldTestFloat = testFloat; >+ testFloat = newTestFloat; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_FLOAT, oldTestFloat, testFloat)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public int getTestInt() { >+ return testInt; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestInt(int newTestInt) { >+ int oldTestInt = testInt; >+ testInt = newTestInt; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_INT, oldTestInt, testInt)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public long getTestLong() { >+ return testLong; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestLong(long newTestLong) { >+ long oldTestLong = testLong; >+ testLong = newTestLong; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_LONG, oldTestLong, testLong)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public short getTestShort() { >+ return testShort; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setTestShort(short newTestShort) { >+ short oldTestShort = testShort; >+ testShort = newTestShort; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_SHORT, oldTestShort, testShort)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public Class1 getClass1() { >+ return class1; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetClass1(Class1 newClass1, NotificationChain msgs) { >+ Class1 oldClass1 = class1; >+ class1 = newClass1; >+ if (eNotificationRequired()) { >+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__CLASS1, oldClass1, newClass1); >+ if (msgs == null) msgs = notification; else msgs.add(notification); >+ } >+ return msgs; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setClass1(Class1 newClass1) { >+ if (newClass1 != class1) { >+ NotificationChain msgs = null; >+ if (class1 != null) >+ msgs = ((InternalEObject)class1).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DynamicDelegationPackage.CLASS0__CLASS1, null, msgs); >+ if (newClass1 != null) >+ msgs = ((InternalEObject)newClass1).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DynamicDelegationPackage.CLASS0__CLASS1, null, msgs); >+ msgs = basicSetClass1(newClass1, msgs); >+ if (msgs != null) msgs.dispatch(); >+ } >+ else if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__CLASS1, newClass1, newClass1)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ return basicSetClass1(null, msgs); >+ } >+ return super.eInverseRemove(otherEnd, featureID, msgs); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ return isTestBoolean(); >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ return getTestByte(); >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ return getTestChar(); >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ return getTestDouble(); >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ return getTestFloat(); >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ return getTestInt(); >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ return getTestLong(); >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ return getTestShort(); >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ return getClass1(); >+ } >+ return super.eGet(featureID, resolve, coreType); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ setTestBoolean((Boolean)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ setTestByte((Byte)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ setTestChar((Character)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ setTestDouble((Double)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ setTestFloat((Float)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ setTestInt((Integer)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ setTestLong((Long)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ setTestShort((Short)newValue); >+ return; >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ setClass1((Class1)newValue); >+ return; >+ } >+ super.eSet(featureID, newValue); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ setTestBoolean(TEST_BOOLEAN_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ setTestByte(TEST_BYTE_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ setTestChar(TEST_CHAR_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ setTestDouble(TEST_DOUBLE_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ setTestFloat(TEST_FLOAT_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ setTestInt(TEST_INT_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ setTestLong(TEST_LONG_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ setTestShort(TEST_SHORT_EDEFAULT); >+ return; >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ setClass1((Class1)null); >+ return; >+ } >+ super.eUnset(featureID); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { >+ case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN: >+ return testBoolean != TEST_BOOLEAN_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_BYTE: >+ return testByte != TEST_BYTE_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_CHAR: >+ return testChar != TEST_CHAR_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_DOUBLE: >+ return testDouble != TEST_DOUBLE_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_FLOAT: >+ return testFloat != TEST_FLOAT_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_INT: >+ return testInt != TEST_INT_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_LONG: >+ return testLong != TEST_LONG_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__TEST_SHORT: >+ return testShort != TEST_SHORT_EDEFAULT; >+ case DynamicDelegationPackage.CLASS0__CLASS1: >+ return class1 != null; >+ } >+ return super.eIsSet(featureID); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public String toString() { >+ if (eIsProxy()) return super.toString(); >+ >+ StringBuffer result = new StringBuffer(super.toString()); >+ result.append(" (testBoolean: "); >+ result.append(testBoolean); >+ result.append(", testByte: "); >+ result.append(testByte); >+ result.append(", testChar: "); >+ result.append(testChar); >+ result.append(", testDouble: "); >+ result.append(testDouble); >+ result.append(", testFloat: "); >+ result.append(testFloat); >+ result.append(", testInt: "); >+ result.append(testInt); >+ result.append(", testLong: "); >+ result.append(testLong); >+ result.append(", testShort: "); >+ result.append(testShort); >+ result.append(')'); >+ return result.toString(); >+ } >+ >+} //Class0Impl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class1Impl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class1Impl.java >new file mode 100644 >index 0000000..49d0270 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class1Impl.java >@@ -0,0 +1,45 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl.none; >+ >+import org.eclipse.emf.ecore.EClass; >+ >+import org.eclipse.emf.ecore.impl.EObjectImpl; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.Class1; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model object '<em><b>Class1</b></em>'. >+ * <!-- end-user-doc --> >+ * <p> >+ * </p> >+ * >+ * @generated >+ */ >+public class Class1Impl extends EObjectImpl implements Class1 { >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ protected Class1Impl() { >+ super(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ protected EClass eStaticClass() { >+ return DynamicDelegationPackage.Literals.CLASS1; >+ } >+ >+} //Class1Impl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationFactoryImpl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationFactoryImpl.java >new file mode 100644 >index 0000000..cf0b66e >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationFactoryImpl.java >@@ -0,0 +1,110 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl.none; >+ >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EPackage; >+ >+import org.eclipse.emf.ecore.impl.EFactoryImpl; >+ >+import org.eclipse.emf.ecore.plugin.EcorePlugin; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.*; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model <b>Factory</b>. >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+public class DynamicDelegationFactoryImpl extends EFactoryImpl implements DynamicDelegationFactory { >+ /** >+ * Creates the default factory implementation. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public static DynamicDelegationFactory init() { >+ try { >+ DynamicDelegationFactory theDynamicDelegationFactory = (DynamicDelegationFactory)EPackage.Registry.INSTANCE.getEFactory("http:///org.eclipse.emf.test.models/DynamicDelegation"); >+ if (theDynamicDelegationFactory != null) { >+ return theDynamicDelegationFactory; >+ } >+ } >+ catch (Exception exception) { >+ EcorePlugin.INSTANCE.log(exception); >+ } >+ return new DynamicDelegationFactoryImpl(); >+ } >+ >+ /** >+ * Creates an instance of the factory. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationFactoryImpl() { >+ super(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public EObject create(EClass eClass) { >+ switch (eClass.getClassifierID()) { >+ case DynamicDelegationPackage.CLASS0: return createClass0(); >+ case DynamicDelegationPackage.CLASS1: return createClass1(); >+ default: >+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); >+ } >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public Class0 createClass0() { >+ Class0Impl class0 = new Class0Impl(); >+ return class0; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public Class1 createClass1() { >+ Class1Impl class1 = new Class1Impl(); >+ return class1; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationPackage getDynamicDelegationPackage() { >+ return (DynamicDelegationPackage)getEPackage(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @deprecated >+ * @generated >+ */ >+ @Deprecated >+ public static DynamicDelegationPackage getPackage() { >+ return DynamicDelegationPackage.eINSTANCE; >+ } >+ >+} //DynamicDelegationFactoryImpl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationPackageImpl.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationPackageImpl.java >new file mode 100644 >index 0000000..7063903 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationPackageImpl.java >@@ -0,0 +1,291 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.impl.none; >+ >+import org.eclipse.emf.ecore.EAttribute; >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.EPackage; >+import org.eclipse.emf.ecore.EReference; >+ >+import org.eclipse.emf.ecore.impl.EPackageImpl; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.Class0; >+import org.eclipse.emf.test.models.dynamicDelegation.Class1; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationFactory; >+import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage; >+ >+/** >+ * <!-- begin-user-doc --> >+ * An implementation of the model <b>Package</b>. >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+public class DynamicDelegationPackageImpl extends EPackageImpl implements DynamicDelegationPackage { >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private EClass class0EClass = null; >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private EClass class1EClass = null; >+ >+ /** >+ * Creates an instance of the model <b>Package</b>, registered with >+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package >+ * package URI value. >+ * <p>Note: the correct way to create the package is via the static >+ * factory method {@link #init init()}, which also performs >+ * initialization of the package, or returns the registered package, >+ * if one already exists. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.ecore.EPackage.Registry >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#eNS_URI >+ * @see #init() >+ * @generated >+ */ >+ private DynamicDelegationPackageImpl() { >+ super(eNS_URI, DynamicDelegationFactory.eINSTANCE); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private static boolean isInited = false; >+ >+ /** >+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. >+ * >+ * <p>This method is used to initialize {@link DynamicDelegationPackage#eINSTANCE} when that field is accessed. >+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see #eNS_URI >+ * @see #createPackageContents() >+ * @see #initializePackageContents() >+ * @generated >+ */ >+ public static DynamicDelegationPackage init() { >+ if (isInited) return (DynamicDelegationPackage)EPackage.Registry.INSTANCE.getEPackage(DynamicDelegationPackage.eNS_URI); >+ >+ // Obtain or create and register package >+ DynamicDelegationPackageImpl theDynamicDelegationPackage = (DynamicDelegationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DynamicDelegationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DynamicDelegationPackageImpl()); >+ >+ isInited = true; >+ >+ // Create package meta-data objects >+ theDynamicDelegationPackage.createPackageContents(); >+ >+ // Initialize created meta-data >+ theDynamicDelegationPackage.initializePackageContents(); >+ >+ // Mark meta-data to indicate it can't be changed >+ theDynamicDelegationPackage.freeze(); >+ >+ >+ // Update the registry and return the package >+ EPackage.Registry.INSTANCE.put(DynamicDelegationPackage.eNS_URI, theDynamicDelegationPackage); >+ return theDynamicDelegationPackage; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EClass getClass0() { >+ return class0EClass; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestBoolean() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(0); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestByte() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(1); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestChar() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(2); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestDouble() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(3); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestFloat() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(4); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestInt() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(5); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestLong() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(6); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EAttribute getClass0_TestShort() { >+ return (EAttribute)class0EClass.getEStructuralFeatures().get(7); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EReference getClass0_Class1() { >+ return (EReference)class0EClass.getEStructuralFeatures().get(8); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public EClass getClass1() { >+ return class1EClass; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationFactory getDynamicDelegationFactory() { >+ return (DynamicDelegationFactory)getEFactoryInstance(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private boolean isCreated = false; >+ >+ /** >+ * Creates the meta-model objects for the package. This method is >+ * guarded to have no affect on any invocation but its first. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void createPackageContents() { >+ if (isCreated) return; >+ isCreated = true; >+ >+ // Create classes and their features >+ class0EClass = createEClass(CLASS0); >+ createEAttribute(class0EClass, CLASS0__TEST_BOOLEAN); >+ createEAttribute(class0EClass, CLASS0__TEST_BYTE); >+ createEAttribute(class0EClass, CLASS0__TEST_CHAR); >+ createEAttribute(class0EClass, CLASS0__TEST_DOUBLE); >+ createEAttribute(class0EClass, CLASS0__TEST_FLOAT); >+ createEAttribute(class0EClass, CLASS0__TEST_INT); >+ createEAttribute(class0EClass, CLASS0__TEST_LONG); >+ createEAttribute(class0EClass, CLASS0__TEST_SHORT); >+ createEReference(class0EClass, CLASS0__CLASS1); >+ >+ class1EClass = createEClass(CLASS1); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ private boolean isInitialized = false; >+ >+ /** >+ * Complete the initialization of the package and its meta-model. This >+ * method is guarded to have no affect on any invocation but its first. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void initializePackageContents() { >+ if (isInitialized) return; >+ isInitialized = true; >+ >+ // Initialize package >+ setName(eNAME); >+ setNsPrefix(eNS_PREFIX); >+ setNsURI(eNS_URI); >+ >+ // Create type parameters >+ >+ // Set bounds for type parameters >+ >+ // Add supertypes to classes >+ >+ // Initialize classes and features; add operations and parameters >+ initEClass(class0EClass, Class0.class, "Class0", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); >+ initEAttribute(getClass0_TestBoolean(), ecorePackage.getEBoolean(), "testBoolean", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestByte(), ecorePackage.getEByte(), "testByte", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestChar(), ecorePackage.getEChar(), "testChar", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestDouble(), ecorePackage.getEDouble(), "testDouble", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestFloat(), ecorePackage.getEFloat(), "testFloat", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestInt(), ecorePackage.getEInt(), "testInt", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestLong(), ecorePackage.getELong(), "testLong", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEAttribute(getClass0_TestShort(), ecorePackage.getEShort(), "testShort", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ initEReference(getClass0_Class1(), this.getClass1(), null, "class1", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); >+ >+ initEClass(class1EClass, Class1.class, "Class1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); >+ >+ // Create resource >+ createResource(eNS_URI); >+ } >+ >+} //DynamicDelegationPackageImpl >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationAdapterFactory.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationAdapterFactory.java >new file mode 100644 >index 0000000..d691031 >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationAdapterFactory.java >@@ -0,0 +1,145 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.util; >+ >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.emf.common.notify.Adapter; >+import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.common.notify.Notifier; >+ >+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; >+import org.eclipse.emf.common.notify.impl.AdapterImpl; >+ >+import org.eclipse.emf.ecore.EObject; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.*; >+ >+/** >+ * <!-- begin-user-doc --> >+ * The <b>Adapter Factory</b> for the model. >+ * It provides an adapter <code>createXXX</code> method for each class of the model. >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage >+ * @generated >+ */ >+public class DynamicDelegationAdapterFactory extends AdapterFactoryImpl { >+ /** >+ * The cached model package. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ protected static DynamicDelegationPackage modelPackage; >+ >+ /** >+ * Creates an instance of the adapter factory. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationAdapterFactory() { >+ if (modelPackage == null) { >+ modelPackage = DynamicDelegationPackage.eINSTANCE; >+ } >+ } >+ >+ /** >+ * Returns whether this factory is applicable for the type of the object. >+ * <!-- begin-user-doc --> >+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. >+ * <!-- end-user-doc --> >+ * @return whether this factory is applicable for the type of the object. >+ * @generated >+ */ >+ @Override >+ public boolean isFactoryForType(Object object) { >+ if (object == modelPackage) { >+ return true; >+ } >+ if (object instanceof EObject) { >+ return ((EObject)object).eClass().getEPackage() == modelPackage; >+ } >+ return false; >+ } >+ >+ /** >+ * The switch that delegates to the <code>createXXX</code> methods. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ protected DynamicDelegationSwitch<Adapter> modelSwitch = >+ new DynamicDelegationSwitch<Adapter>() { >+ @Override >+ public Adapter caseClass0(Class0 object) { >+ return createClass0Adapter(); >+ } >+ @Override >+ public Adapter caseClass1(Class1 object) { >+ return createClass1Adapter(); >+ } >+ @Override >+ public Adapter defaultCase(EObject object) { >+ return createEObjectAdapter(); >+ } >+ }; >+ >+ /** >+ * Creates an adapter for the <code>target</code>. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @param target the object to adapt. >+ * @return the adapter for the <code>target</code>. >+ * @generated >+ */ >+ @Override >+ public Adapter createAdapter(Notifier target) { >+ return modelSwitch.doSwitch((EObject)target); >+ } >+ >+ >+ /** >+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0 <em>Class0</em>}'. >+ * <!-- begin-user-doc --> >+ * This default implementation returns null so that we can easily ignore cases; >+ * it's useful to ignore a case when inheritance will catch all the cases anyway. >+ * <!-- end-user-doc --> >+ * @return the new adapter. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class0 >+ * @generated >+ */ >+ public Adapter createClass0Adapter() { >+ return null; >+ } >+ >+ /** >+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class1 <em>Class1</em>}'. >+ * <!-- begin-user-doc --> >+ * This default implementation returns null so that we can easily ignore cases; >+ * it's useful to ignore a case when inheritance will catch all the cases anyway. >+ * <!-- end-user-doc --> >+ * @return the new adapter. >+ * @see org.eclipse.emf.test.models.dynamicDelegation.Class1 >+ * @generated >+ */ >+ public Adapter createClass1Adapter() { >+ return null; >+ } >+ >+ /** >+ * Creates a new adapter for the default case. >+ * <!-- begin-user-doc --> >+ * This default implementation returns null. >+ * <!-- end-user-doc --> >+ * @return the new adapter. >+ * @generated >+ */ >+ public Adapter createEObjectAdapter() { >+ return null; >+ } >+ >+} //DynamicDelegationAdapterFactory >diff --git tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationSwitch.java tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationSwitch.java >new file mode 100644 >index 0000000..2b0f73d >--- /dev/null >+++ tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationSwitch.java >@@ -0,0 +1,135 @@ >+/** >+ * <copyright> >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.test.models.dynamicDelegation.util; >+ >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EPackage; >+ >+import org.eclipse.emf.ecore.util.Switch; >+ >+import org.eclipse.emf.test.models.dynamicDelegation.*; >+ >+/** >+ * <!-- begin-user-doc --> >+ * The <b>Switch</b> for the model's inheritance hierarchy. >+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)} >+ * to invoke the <code>caseXXX</code> method for each class of the model, >+ * starting with the actual class of the object >+ * and proceeding up the inheritance hierarchy >+ * until a non-null result is returned, >+ * which is the result of the switch. >+ * <!-- end-user-doc --> >+ * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage >+ * @generated >+ */ >+public class DynamicDelegationSwitch<T> extends Switch<T> { >+ /** >+ * The cached model package >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ protected static DynamicDelegationPackage modelPackage; >+ >+ /** >+ * Creates an instance of the switch. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public DynamicDelegationSwitch() { >+ if (modelPackage == null) { >+ modelPackage = DynamicDelegationPackage.eINSTANCE; >+ } >+ } >+ >+ /** >+ * Checks whether this is a switch for the given package. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @parameter ePackage the package in question. >+ * @return whether this is a switch for the given package. >+ * @generated >+ */ >+ @Override >+ protected boolean isSwitchFor(EPackage ePackage) { >+ return ePackage == modelPackage; >+ } >+ >+ /** >+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the first non-null result returned by a <code>caseXXX</code> call. >+ * @generated >+ */ >+ @Override >+ protected T doSwitch(int classifierID, EObject theEObject) { >+ switch (classifierID) { >+ case DynamicDelegationPackage.CLASS0: { >+ Class0 class0 = (Class0)theEObject; >+ T result = caseClass0(class0); >+ if (result == null) result = defaultCase(theEObject); >+ return result; >+ } >+ case DynamicDelegationPackage.CLASS1: { >+ Class1 class1 = (Class1)theEObject; >+ T result = caseClass1(class1); >+ if (result == null) result = defaultCase(theEObject); >+ return result; >+ } >+ default: return defaultCase(theEObject); >+ } >+ } >+ >+ /** >+ * Returns the result of interpreting the object as an instance of '<em>Class0</em>'. >+ * <!-- begin-user-doc --> >+ * This implementation returns null; >+ * returning a non-null result will terminate the switch. >+ * <!-- end-user-doc --> >+ * @param object the target of the switch. >+ * @return the result of interpreting the object as an instance of '<em>Class0</em>'. >+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) >+ * @generated >+ */ >+ public T caseClass0(Class0 object) { >+ return null; >+ } >+ >+ /** >+ * Returns the result of interpreting the object as an instance of '<em>Class1</em>'. >+ * <!-- begin-user-doc --> >+ * This implementation returns null; >+ * returning a non-null result will terminate the switch. >+ * <!-- end-user-doc --> >+ * @param object the target of the switch. >+ * @return the result of interpreting the object as an instance of '<em>Class1</em>'. >+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) >+ * @generated >+ */ >+ public T caseClass1(Class1 object) { >+ return null; >+ } >+ >+ /** >+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. >+ * <!-- begin-user-doc --> >+ * This implementation returns null; >+ * returning a non-null result will terminate the switch, but this is the last case anyway. >+ * <!-- end-user-doc --> >+ * @param object the target of the switch. >+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'. >+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) >+ * @generated >+ */ >+ @Override >+ public T defaultCase(EObject object) { >+ return null; >+ } >+ >+} //DynamicDelegationSwitch >diff --git tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/dynamicDelegation/bug387689.java tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/dynamicDelegation/bug387689.java >new file mode 100644 >index 0000000..d7f81b5 >--- /dev/null >+++ tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/dynamicDelegation/bug387689.java >@@ -0,0 +1,129 @@ >+package org.eclipse.emf.test.core.dynamicDelegation; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.common.notify.impl.AdapterImpl; >+import org.eclipse.emf.test.models.dynamicDelegation.Class0; >+ >+public class bug387689 extends TestCase { >+ public void testReflectionNone() { >+ org.eclipse.emf.test.models.dynamicDelegation.impl.none.DynamicDelegationFactoryImpl dynamicDelegationFactoryImpl = new org.eclipse.emf.test.models.dynamicDelegation.impl.none.DynamicDelegationFactoryImpl(); >+ doTestBoolean(dynamicDelegationFactoryImpl.createClass0()); >+ doTestByte(dynamicDelegationFactoryImpl.createClass0()); >+ doTestChar(dynamicDelegationFactoryImpl.createClass0()); >+ doTestDouble(dynamicDelegationFactoryImpl.createClass0()); >+ doTestFloat(dynamicDelegationFactoryImpl.createClass0()); >+ doTestInt(dynamicDelegationFactoryImpl.createClass0()); >+ doTestLong(dynamicDelegationFactoryImpl.createClass0()); >+ doTestShort(dynamicDelegationFactoryImpl.createClass0()); >+ } >+ >+ public void testReflectionDynamic() { >+ org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationFactoryImpl dynamicDelegationFactoryImpl = new org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationFactoryImpl(); >+ doTestBoolean(dynamicDelegationFactoryImpl.createClass0()); >+ doTestByte(dynamicDelegationFactoryImpl.createClass0()); >+ doTestChar(dynamicDelegationFactoryImpl.createClass0()); >+ doTestDouble(dynamicDelegationFactoryImpl.createClass0()); >+ doTestFloat(dynamicDelegationFactoryImpl.createClass0()); >+ doTestInt(dynamicDelegationFactoryImpl.createClass0()); >+ doTestLong(dynamicDelegationFactoryImpl.createClass0()); >+ doTestShort(dynamicDelegationFactoryImpl.createClass0()); >+ } >+ >+ private void doTestBoolean(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewBooleanValue() != msg.getOldBooleanValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestBoolean(Boolean.TRUE); >+ class0.setTestBoolean(Boolean.FALSE); >+ } >+ >+ private void doTestByte(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewByteValue() != msg.getOldByteValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestByte((byte) 2); >+ class0.setTestByte((byte) 1); >+ } >+ >+ private void doTestChar(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewCharValue() != msg.getOldCharValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestChar('b'); >+ class0.setTestChar('a'); >+ } >+ >+ private void doTestDouble(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewDoubleValue() != msg.getOldDoubleValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestDouble(2); >+ class0.setTestDouble(1); >+ } >+ >+ private void doTestFloat(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewFloatValue() != msg.getOldFloatValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestFloat(2); >+ class0.setTestFloat(1); >+ } >+ >+ private void doTestInt(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewIntValue() != msg.getOldIntValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestInt(2); >+ class0.setTestInt(1); >+ } >+ >+ private void doTestLong(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewLongValue() != msg.getOldLongValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestLong(2); >+ class0.setTestLong(1); >+ } >+ >+ private void doTestShort(Class0 class0) { >+ AdapterImpl adapterImpl = new AdapterImpl() { >+ public void notifyChanged(Notification msg) { >+ assertTrue(msg.getNewShortValue() != msg.getOldShortValue()); >+ }; >+ }; >+ >+ class0.eAdapters().add(adapterImpl); >+ class0.setTestShort((short) 2); >+ class0.setTestShort((short) 1); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 387689
: 220113