Commit 96371bd5 authored by Erwan Bousse's avatar Erwan Bousse
Browse files

Big bug solved (== not working with int, replaced with equals)

parent e456c2b7
...@@ -12,5 +12,5 @@ Export-Package: ab, ...@@ -12,5 +12,5 @@ Export-Package: ab,
ab.util ab.util
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore;visibility:=reexport,
fr.inria.diverse.cloning.cloner;bundle-version="0.1.0" fr.inria.diverse.cloning.runtime;bundle-version="0.1.0"
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
/** /**
*/ */
package mm5mutclassonly; package yayabdeep;
import fr.inria.diverse.cloning.cloner.emfextension.impl.AbstractShareableEObject; import ab.A;
import mm5.Class234; import ab.AbPackage;
import mm5.Class235; import ab.B;
import mm5.Mm5Package; import java.util.Collection;
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Class234</b></em>'. * An implementation of the model object '<em><b>A</b></em>'.
* <!-- end-user-doc --> * <!-- end-user-doc -->
* <p> * <p>
* The following features are implemented: * The following features are implemented:
* <ul> * <ul>
* <li> * <li>
* { @link mm5.impl.Class234MutClassOnlyPImpl#getRefClass235_855 <em>Ref Class235 855</em>} * { @link ab.impl.ADeepPImpl#getI <em>I</em>}
* </li> * </li>
* <li> * <li>
* { @link mm5.impl.Class234MutClassOnlyPImpl#getAttEInt_876 <em>Att EInt 876</em>} * { @link ab.impl.ADeepPImpl#getJ_m <em>Jm</em>}
* </li> * </li>
* <li> * <li>
* { @link mm5.impl.Class234MutClassOnlyPImpl#getAttEInt_952_m <em>Att EInt 952 m</em>} * { @link ab.impl.ADeepPImpl#getB <em>B</em>}
* </li> * </li>
* </ul> * </ul>
* </p> * </p>
* @generated * @generated
*/ */
public class Class234MutClassOnlyPImpl extends AbstractShareableEObject public class ADeepPImpl extends MinimalEObjectImpl.Container implements A {
implements Class234 { protected A cloned;
protected Class234 cloned;
/** /**
* The default value of the ' * The default value of the '
* { @link #getAttEInt_876() <em>Att EInt 876</em>} * { @link #getI() <em>I</em>}
* ' attribute. * ' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @see #getAttEInt_876() * @see #getI()
* @generated * @generated
* @ordered * @ordered
*/ */
protected static final int ATT_EINT_876_EDEFAULT = 0; protected static final int I_EDEFAULT = 0;
/** /**
* The default value of the ' * The default value of the '
* { @link #getAttEInt_952_m() <em>Att EInt 952 m</em>} * { @link #getJ_m() <em>Jm</em>}
* ' attribute. * ' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @see #getAttEInt_952_m() * @see #getJ_m()
* @generated * @generated
* @ordered * @ordered
*/ */
protected static final int ATT_EINT_952_M_EDEFAULT = 0; protected static final int JM_EDEFAULT = 0;
/** /**
* The cached value of the ' * The cached value of the '
* { @link #getAttEInt_952_m() <em>Att EInt 952 m</em>} * { @link #getJ_m() <em>Jm</em>}
* ' attribute. * ' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @see #getAttEInt_952_m() * @see #getJ_m()
* @generated * @generated
* @ordered * @ordered
*/ */
protected int attEInt_952_m = ATT_EINT_952_M_EDEFAULT; protected int j_m = JM_EDEFAULT;
/** /**
* The cached value of the '
* { @link #getB() <em>B</em>}
* ' containment reference list.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @see #getB()
* @generated * @generated
* @ordered
*/ */
protected Class234MutClassOnlyPImpl(Class234 clonedParam) { protected EList<B> b;
super();
cloned = clonedParam;
}
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
@Override protected ADeepPImpl(A clonedParam) {
protected EClass eStaticClass() { super();
return Mm5Package.Literals.CLASS234; cloned = clonedParam;
} }
/** /**
...@@ -94,8 +99,9 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -94,8 +99,9 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public Class235 getRefClass235_855() { @Override
return cloned.getRefClass235_855(); protected EClass eStaticClass() {
return AbPackage.Literals.A;
} }
/** /**
...@@ -103,8 +109,8 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -103,8 +109,8 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public Class235 basicGetRefClass235_855() { public int getI() {
return cloned.getRefClass235_855(); return cloned.getI();
} }
/** /**
...@@ -112,7 +118,9 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -112,7 +118,9 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public void setRefClass235_855(Class235 newRefClass235_855) { public void setI(int newI) {
System.out
.println("[Info] ADeepPImpl: i is readonly and cannot be set.");
} }
/** /**
...@@ -120,8 +128,8 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -120,8 +128,8 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public int getAttEInt_876() { public int getJ_m() {
return cloned.getAttEInt_876(); return j_m;
} }
/** /**
...@@ -129,7 +137,13 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -129,7 +137,13 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public void setAttEInt_876(int newAttEInt_876) { public void setJ_m(int newJ_m) {
int oldJ_m = j_m;
j_m = newJ_m;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
AbPackage.A__JM, oldJ_m, j_m));
} }
/** /**
...@@ -137,8 +151,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -137,8 +151,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public int getAttEInt_952_m() { public EList<B> getB() {
return attEInt_952_m; if (b == null) {
b = new EObjectContainmentEList<B>(B.class, this, AbPackage.A__B);
}
return b;
} }
/** /**
...@@ -146,14 +164,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -146,14 +164,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public void setAttEInt_952_m(int newAttEInt_952_m) { @Override
int oldAttEInt_952_m = attEInt_952_m; public NotificationChain eInverseRemove(InternalEObject otherEnd,
attEInt_952_m = newAttEInt_952_m; int featureID, NotificationChain msgs) {
if (eNotificationRequired()) switch (featureID) {
eNotify(new ENotificationImpl(this, Notification.SET, case AbPackage.A__B:
Mm5Package.CLASS234__ATT_EINT_952_M, oldAttEInt_952_m, return ((InternalEList<?>) getB()).basicRemove(otherEnd, msgs);
attEInt_952_m)); }
return super.eInverseRemove(otherEnd, featureID, msgs);
} }
/** /**
...@@ -164,15 +182,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -164,15 +182,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
@Override @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) { public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) { switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855: case AbPackage.A__I:
if (resolve) return getI();
return getRefClass235_855(); case AbPackage.A__JM:
return getJ_m();
return basicGetRefClass235_855(); case AbPackage.A__B:
case Mm5Package.CLASS234__ATT_EINT_876: return getB();
return getAttEInt_876();
case Mm5Package.CLASS234__ATT_EINT_952_M:
return getAttEInt_952_m();
} }
return super.eGet(featureID, resolve, coreType); return super.eGet(featureID, resolve, coreType);
} }
...@@ -182,17 +197,19 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -182,17 +197,19 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
@SuppressWarnings("unchecked")
@Override @Override
public void eSet(int featureID, Object newValue) { public void eSet(int featureID, Object newValue) {
switch (featureID) { switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855: case AbPackage.A__I:
setRefClass235_855((Class235) newValue); setI((Integer) newValue);
return; return;
case Mm5Package.CLASS234__ATT_EINT_876: case AbPackage.A__JM:
setAttEInt_876((Integer) newValue); setJ_m((Integer) newValue);
return; return;
case Mm5Package.CLASS234__ATT_EINT_952_M: case AbPackage.A__B:
setAttEInt_952_m((Integer) newValue); getB().clear();
getB().addAll((Collection<? extends B>) newValue);
return; return;
} }
super.eSet(featureID, newValue); super.eSet(featureID, newValue);
...@@ -206,14 +223,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -206,14 +223,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
@Override @Override
public void eUnset(int featureID) { public void eUnset(int featureID) {
switch (featureID) { switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855: case AbPackage.A__I:
setRefClass235_855((Class235) null); setI(I_EDEFAULT);
return; return;
case Mm5Package.CLASS234__ATT_EINT_876: case AbPackage.A__JM:
setAttEInt_876(ATT_EINT_876_EDEFAULT); setJ_m(JM_EDEFAULT);
return; return;
case Mm5Package.CLASS234__ATT_EINT_952_M: case AbPackage.A__B:
setAttEInt_952_m(ATT_EINT_952_M_EDEFAULT); getB().clear();
return; return;
} }
super.eUnset(featureID); super.eUnset(featureID);
...@@ -227,12 +244,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -227,12 +244,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
@Override @Override
public boolean eIsSet(int featureID) { public boolean eIsSet(int featureID) {
switch (featureID) { switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855: case AbPackage.A__I:
return cloned.getRefClass235_855() != null; return cloned.getI() != I_EDEFAULT;
case Mm5Package.CLASS234__ATT_EINT_876: case AbPackage.A__JM:
return cloned.getAttEInt_876() != ATT_EINT_876_EDEFAULT; return j_m != JM_EDEFAULT;
case Mm5Package.CLASS234__ATT_EINT_952_M: case AbPackage.A__B:
return attEInt_952_m != ATT_EINT_952_M_EDEFAULT; return b != null && !b.isEmpty();
} }
return super.eIsSet(featureID); return super.eIsSet(featureID);
} }
...@@ -248,14 +265,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject ...@@ -248,14 +265,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
return super.toString(); return super.toString();
StringBuffer result = new StringBuffer(super.toString()); StringBuffer result = new StringBuffer(super.toString());
result.append(" (attEInt_876: "); result.append(" (i: ");
result.append(cloned.getAttEInt_876()); result.append(cloned.getI());
result.append(", attEInt_952_m: "); result.append(", j_m: ");
result.append(attEInt_952_m); result.append(j_m);
result.append(')'); result.append(')');
return result.toString(); return result.toString();
} }
} }
//Class234Impl //AImpl
/** /**
*/ */
package mm2deep; package yayabdeep;
import fr.inria.diverse.cloning.cloner.emfextension.impl.AbstractShareableEObject; import ab.AbPackage;
import mm2.Class42; import ab.B;
import mm2.Mm2Package;
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Class42</b></em>'. * An implementation of the model object '<em><b>B</b></em>'.
* <!-- end-user-doc --> * <!-- end-user-doc -->
* <p> * <p>
* The following features are implemented: * The following features are implemented:
* <ul> * <ul>
* <li> * <li>
* { @link mm2.impl.Class42DeepPImpl#getAttEInt_382 <em>Att EInt 382</em>} * { @link ab.impl.BDeepPImpl#getX <em>X</em>}
* </li> * </li>
* </ul> * </ul>
* </p> * </p>
* @generated * @generated
*/ */
public class Class42DeepPImpl extends AbstractShareableEObject implements public class BDeepPImpl extends MinimalEObjectImpl.Container implements B {
Class42 { protected B cloned;
protected Class42 cloned;
/** /**
* The default value of the ' * The default value of the '
* { @link #getAttEInt_382() <em>Att EInt 382</em>} * { @link #getX() <em>X</em>}
* ' attribute. * ' attribute.
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @see #getAttEInt_382() * @see #getX()
* @generated * @generated
* @ordered * @ordered
*/ */
protected static final int ATT_EINT_382_EDEFAULT = 0; protected static final int X_EDEFAULT = 0;
/** /**
* <!-- begin-user-doc --> * <!-- begin-user-doc -->
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
protected Class42DeepPImpl(Class42 clonedParam) { protected BDeepPImpl(B clonedParam) {
super(); super();
cloned = clonedParam; cloned = clonedParam;
} }
...@@ -56,7 +55,7 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements ...@@ -56,7 +55,7 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
*/ */
@Override @Override
protected EClass eStaticClass() { protected EClass eStaticClass() {
return Mm2Package.Literals.CLASS42; return AbPackage.Literals.B;
} }
/** /**
...@@ -64,8 +63,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements ...@@ -64,8 +63,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public int getAttEInt_382() { public int getX() {
return cloned.getAttEInt_382(); return cloned.getX();
} }
/** /**
...@@ -73,7 +72,9 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements ...@@ -73,7 +72,9 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
* <!-- end-user-doc --> * <!-- end-user-doc -->
* @generated * @generated
*/ */
public void setAttEInt_382(int newAttEInt_382) { public void setX(int newX) {
System.out
.println("[Info] BDeepPImpl: x is readonly and cannot be set.");
} }
/** /**
...@@ -84,8 +85,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements ...@@ -84,8 +85,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
@Override @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) { public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) { switch (featureID) {
case Mm2Package.CLASS42__ATT_EINT_382: case AbPackage.B__X:
return getAttEInt_382(); return getX();
} }
return super.eGet(featureID, resolve, coreType); return super.eGet(featureID, resolve, coreType);
}