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

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

parent e456c2b7

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -12,5 +12,5 @@ Export-Package: ab,
ab.util
Require-Bundle: org.eclipse.core.runtime,
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
/**
*/
package mm5mutclassonly;
package yayabdeep;
import fr.inria.diverse.cloning.cloner.emfextension.impl.AbstractShareableEObject;
import mm5.Class234;
import mm5.Class235;
import mm5.Mm5Package;
import ab.A;
import ab.AbPackage;
import ab.B;
import java.util.Collection;
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.InternalEObject;
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 -->
* 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 -->
* <p>
* The following features are implemented:
* <ul>
* <li>
* { @link mm5.impl.Class234MutClassOnlyPImpl#getRefClass235_855 <em>Ref Class235 855</em>}
* { @link ab.impl.ADeepPImpl#getI <em>I</em>}
* </li>
* <li>
* { @link mm5.impl.Class234MutClassOnlyPImpl#getAttEInt_876 <em>Att EInt 876</em>}
* { @link ab.impl.ADeepPImpl#getJ_m <em>Jm</em>}
* </li>
* <li>
* { @link mm5.impl.Class234MutClassOnlyPImpl#getAttEInt_952_m <em>Att EInt 952 m</em>}
* { @link ab.impl.ADeepPImpl#getB <em>B</em>}
* </li>
* </ul>
* </p>
* @generated
*/
public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
implements Class234 {
protected Class234 cloned;
public class ADeepPImpl extends MinimalEObjectImpl.Container implements A {
protected A cloned;
/**
* The default value of the '
* { @link #getAttEInt_876() <em>Att EInt 876</em>}
* { @link #getI() <em>I</em>}
* ' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttEInt_876()
* @see #getI()
* @generated
* @ordered
*/
protected static final int ATT_EINT_876_EDEFAULT = 0;
protected static final int I_EDEFAULT = 0;
/**
* The default value of the '
* { @link #getAttEInt_952_m() <em>Att EInt 952 m</em>}
* { @link #getJ_m() <em>Jm</em>}
* ' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttEInt_952_m()
* @see #getJ_m()
* @generated
* @ordered
*/
protected static final int ATT_EINT_952_M_EDEFAULT = 0;
protected static final int JM_EDEFAULT = 0;
/**
* The cached value of the '
* { @link #getAttEInt_952_m() <em>Att EInt 952 m</em>}
* { @link #getJ_m() <em>Jm</em>}
* ' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttEInt_952_m()
* @see #getJ_m()
* @generated
* @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 -->
* <!-- end-user-doc -->
* @see #getB()
* @generated
* @ordered
*/
protected Class234MutClassOnlyPImpl(Class234 clonedParam) {
super();
cloned = clonedParam;
}
protected EList<B> b;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Mm5Package.Literals.CLASS234;
protected ADeepPImpl(A clonedParam) {
super();
cloned = clonedParam;
}
/**
......@@ -94,8 +99,9 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc -->
* @generated
*/
public Class235 getRefClass235_855() {
return cloned.getRefClass235_855();
@Override
protected EClass eStaticClass() {
return AbPackage.Literals.A;
}
/**
......@@ -103,8 +109,8 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc -->
* @generated
*/
public Class235 basicGetRefClass235_855() {
return cloned.getRefClass235_855();
public int getI() {
return cloned.getI();
}
/**
......@@ -112,7 +118,9 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc -->
* @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
* <!-- end-user-doc -->
* @generated
*/
public int getAttEInt_876() {
return cloned.getAttEInt_876();
public int getJ_m() {
return j_m;
}
/**
......@@ -129,7 +137,13 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc -->
* @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
* <!-- end-user-doc -->
* @generated
*/
public int getAttEInt_952_m() {
return attEInt_952_m;
public EList<B> getB() {
if (b == null) {
b = new EObjectContainmentEList<B>(B.class, this, AbPackage.A__B);
}
return b;
}
/**
......@@ -146,14 +164,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc -->
* @generated
*/
public void setAttEInt_952_m(int newAttEInt_952_m) {
int oldAttEInt_952_m = attEInt_952_m;
attEInt_952_m = newAttEInt_952_m;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
Mm5Package.CLASS234__ATT_EINT_952_M, oldAttEInt_952_m,
attEInt_952_m));
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case AbPackage.A__B:
return ((InternalEList<?>) getB()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
......@@ -164,15 +182,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855:
if (resolve)
return getRefClass235_855();
return basicGetRefClass235_855();
case Mm5Package.CLASS234__ATT_EINT_876:
return getAttEInt_876();
case Mm5Package.CLASS234__ATT_EINT_952_M:
return getAttEInt_952_m();
case AbPackage.A__I:
return getI();
case AbPackage.A__JM:
return getJ_m();
case AbPackage.A__B:
return getB();
}
return super.eGet(featureID, resolve, coreType);
}
......@@ -182,17 +197,19 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855:
setRefClass235_855((Class235) newValue);
case AbPackage.A__I:
setI((Integer) newValue);
return;
case Mm5Package.CLASS234__ATT_EINT_876:
setAttEInt_876((Integer) newValue);
case AbPackage.A__JM:
setJ_m((Integer) newValue);
return;
case Mm5Package.CLASS234__ATT_EINT_952_M:
setAttEInt_952_m((Integer) newValue);
case AbPackage.A__B:
getB().clear();
getB().addAll((Collection<? extends B>) newValue);
return;
}
super.eSet(featureID, newValue);
......@@ -206,14 +223,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855:
setRefClass235_855((Class235) null);
case AbPackage.A__I:
setI(I_EDEFAULT);
return;
case Mm5Package.CLASS234__ATT_EINT_876:
setAttEInt_876(ATT_EINT_876_EDEFAULT);
case AbPackage.A__JM:
setJ_m(JM_EDEFAULT);
return;
case Mm5Package.CLASS234__ATT_EINT_952_M:
setAttEInt_952_m(ATT_EINT_952_M_EDEFAULT);
case AbPackage.A__B:
getB().clear();
return;
}
super.eUnset(featureID);
......@@ -227,12 +244,12 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Mm5Package.CLASS234__REF_CLASS235_855:
return cloned.getRefClass235_855() != null;
case Mm5Package.CLASS234__ATT_EINT_876:
return cloned.getAttEInt_876() != ATT_EINT_876_EDEFAULT;
case Mm5Package.CLASS234__ATT_EINT_952_M:
return attEInt_952_m != ATT_EINT_952_M_EDEFAULT;
case AbPackage.A__I:
return cloned.getI() != I_EDEFAULT;
case AbPackage.A__JM:
return j_m != JM_EDEFAULT;
case AbPackage.A__B:
return b != null && !b.isEmpty();
}
return super.eIsSet(featureID);
}
......@@ -248,14 +265,14 @@ public class Class234MutClassOnlyPImpl extends AbstractShareableEObject
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (attEInt_876: ");
result.append(cloned.getAttEInt_876());
result.append(", attEInt_952_m: ");
result.append(attEInt_952_m);
result.append(" (i: ");
result.append(cloned.getI());
result.append(", j_m: ");
result.append(j_m);
result.append(')');
return result.toString();
}
}
//Class234Impl
//AImpl
/**
*/
package mm2deep;
package yayabdeep;
import fr.inria.diverse.cloning.cloner.emfextension.impl.AbstractShareableEObject;
import mm2.Class42;
import mm2.Mm2Package;
import ab.AbPackage;
import ab.B;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- 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 -->
* <p>
* The following features are implemented:
* <ul>
* <li>
* { @link mm2.impl.Class42DeepPImpl#getAttEInt_382 <em>Att EInt 382</em>}
* { @link ab.impl.BDeepPImpl#getX <em>X</em>}
* </li>
* </ul>
* </p>
* @generated
*/
public class Class42DeepPImpl extends AbstractShareableEObject implements
Class42 {
protected Class42 cloned;
public class BDeepPImpl extends MinimalEObjectImpl.Container implements B {
protected B cloned;
/**
* The default value of the '
* { @link #getAttEInt_382() <em>Att EInt 382</em>}
* { @link #getX() <em>X</em>}
* ' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttEInt_382()
* @see #getX()
* @generated
* @ordered
*/
protected static final int ATT_EINT_382_EDEFAULT = 0;
protected static final int X_EDEFAULT = 0;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Class42DeepPImpl(Class42 clonedParam) {
protected BDeepPImpl(B clonedParam) {
super();
cloned = clonedParam;
}
......@@ -56,7 +55,7 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
*/
@Override
protected EClass eStaticClass() {
return Mm2Package.Literals.CLASS42;
return AbPackage.Literals.B;
}
/**
......@@ -64,8 +63,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
* <!-- end-user-doc -->
* @generated
*/
public int getAttEInt_382() {
return cloned.getAttEInt_382();
public int getX() {
return cloned.getX();
}
/**
......@@ -73,7 +72,9 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
* <!-- end-user-doc -->
* @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
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Mm2Package.CLASS42__ATT_EINT_382:
return getAttEInt_382();
case AbPackage.B__X:
return getX();
}
return super.eGet(featureID, resolve, coreType);
}
......@@ -98,8 +99,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Mm2Package.CLASS42__ATT_EINT_382:
setAttEInt_382((Integer) newValue);
case AbPackage.B__X:
setX((Integer) newValue);
return;
}
super.eSet(featureID, newValue);
......@@ -113,8 +114,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Mm2Package.CLASS42__ATT_EINT_382:
setAttEInt_382(ATT_EINT_382_EDEFAULT);
case AbPackage.B__X:
setX(X_EDEFAULT);
return;
}
super.eUnset(featureID);
......@@ -128,8 +129,8 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Mm2Package.CLASS42__ATT_EINT_382:
return cloned.getAttEInt_382() != ATT_EINT_382_EDEFAULT;
case AbPackage.B__X:
return cloned.getX() != X_EDEFAULT;
}
return super.eIsSet(featureID);
}
......@@ -145,12 +146,12 @@ public class Class42DeepPImpl extends AbstractShareableEObject implements
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (attEInt_382: ");
result.append(cloned.getAttEInt_382());
result.append(" (x: ");
result.append(cloned.getX());
result.append(')');
return result.toString();
}
}
//Class42Impl
//BImpl
package yayabdeep;
import fr.inria.diverse.cloning.runtime.common.CloningMaterial;
import fr.inria.diverse.cloning.runtime.emfextension.impl.LooseCopier;
import fr.inria.diverse.cloning.runtime.common.MetamodelTags;
public class YayABDeepCloningMaterial implements CloningMaterial {
private static YayABDeepCloningMaterial instance;
private YayABDeepTags tags;
private YayABDeepCloningMaterial(YayABDeepTags tags){this.tags = tags;
};
public static YayABDeepCloningMaterial getInstance() {
if (instance == null)
instance = new YayABDeepCloningMaterial(new YayABDeepTags());
return instance;
}
public MetamodelTags getTags() {
return tags;}
public LooseCopier createLightCopier() {
return new YayABDeepLightCopier();}
}
package yayabdeep;
import org.eclipse.emf.ecore.EObject;
import fr.inria.diverse.cloning.runtime.emfextension.impl.LooseCopier;
import ab.A;
import ab.B;
@SuppressWarnings("serial")
public class YayABDeepLightCopier extends LooseCopier {
protected EObject createCopy(EObject eObject) {
if (eObject instanceof A)
return new ADeepPImpl((A)eObject);
if (eObject instanceof B)
return new BDeepPImpl((B)eObject);
else
return super.createCopy(eObject);
}
}
package yayabdeep;
import org.eclipse.emf.ecore.EClass;
import fr.inria.diverse.cloning.runtime.common.ClassTag;
import fr.inria.diverse.cloning.runtime.common.MetamodelTags;
import org.eclipse.emf.ecore.EStructuralFeature;
import ab.A;
import ab.B;
public class YayABDeepTags implements MetamodelTags {
public ClassTag getTagOf(EClass eClass) {
if (eClass.equals(ab.AbPackage.eINSTANCE.getA()))
return ClassTag.PARTIALLY_SHAREABLE;
if (eClass.equals(ab.AbPackage.eINSTANCE.getB()))
return ClassTag.PARTIALLY_SHAREABLE;
else
return null;
}
public boolean mayTagClassesShareable() {
return false;}
public boolean isPropertyShareable(EStructuralFeature prop) {
if (prop.equals(ab.AbPackage.eINSTANCE.getA_I()))
return true;
if (prop.equals(ab.AbPackage.eINSTANCE.getA_J_m()))
return false;
if (prop.equals(ab.AbPackage.eINSTANCE.getA_B()))
return false;
if (prop.equals(ab.AbPackage.eINSTANCE.getB_X()))
return true;
else
return false;
}
public double getShareableClassesRatio() {
return 0.0;
}
public double getPartShareableClassesRatio() {
return 1.0;
}
public double getIsolatedShareablePropertiesRatio() {
return 0.5;
}
public double getShareablePropertiesInPartShareableClassesDensity() {
return 1.0;
}
public double getShareablePropertiesInShareableClassesDensity() {
return 0.0;
}
}