CloneSet9


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
166220.956class_body_declarations[3]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
11542393
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
21662226
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
Next
Last
Clone Instance
1
Line Count
154
Source Line
2393
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java

/**
 * -------------------------------------------
 */
public static class ResolvingFeatureEIterator<E> extends FeatureEIterator<E> {
  public ResolvingFeatureEIterator(EStructuralFeature eStructuralFeature, FeatureMap.Internal featureMap) {
    super(eStructuralFeature, featureMap);
  }

  @Override protected boolean resolve() {
    return true;
  }
}

/**
 * Temporary for testing purposes only.
 */
public static class FeatureMapEObjectImpl extends org.eclipse.emf.ecore.impl.EObjectImpl {
  protected BasicFeatureMap featureMap = new BasicFeatureMap(this, -1);

  public FeatureMapEObjectImpl() {
    super();
  }

  @Override public Object eDynamicGet(EStructuralFeature eFeature, boolean resolve) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      return eSettingDelegate(eFeature).dynamicGet(this, null, -1, true, true);
    }
    else {
      return featureMap.setting(eFeature).get(resolve);
    }
  }

  @Override public void eDynamicSet(EStructuralFeature eFeature, Object newValue) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      eSettingDelegate(eFeature).dynamicSet(this, null, -1, newValue);
    }
    else {
      if ( !eFeature.isUnsettable()) {
        Object defaultValue = eFeature.getDefaultValue();
        if (defaultValue == null ? newValue == null: defaultValue.equals(newValue)) {
          featureMap.setting(eFeature).unset();
          return;
        }
      }
      featureMap.setting(eFeature).set(newValue);
    }
  }

  @Override public void eDynamicUnset(EStructuralFeature eFeature) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      eSettingDelegate(eFeature).dynamicUnset(this, null, -1);
    }
    else {
      featureMap.setting(eFeature).unset();
    }
  }

  @Override public boolean eDynamicIsSet(EStructuralFeature eFeature) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      return eSettingDelegate(eFeature).dynamicIsSet(this, null, -1);
    }
    else {
      return featureMap.setting(eFeature).isSet();
    }
  }

  @Override public NotificationChain eDynamicInverseAdd(InternalEObject otherEnd, int featureID, Class<? > inverseClass, NotificationChain notifications) {
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal) eClass().getEStructuralFeature(featureID);
    if (feature.isMany()) {
      return featureMap.basicAdd(feature, otherEnd, notifications);
    }
    else
      if (feature instanceof EReference && ((EReference) feature).isContainer()) {
        return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);
      }
      else {
        InternalEObject oldValue = (InternalEObject) eDynamicGet(feature, false);
        if (oldValue != null) {
          notifications = oldValue.eInverseRemove(this, oldValue.eClass().getFeatureID(((EReference) feature).getEOpposite()), null, notifications);
          notifications = featureMap.basicRemove(feature, oldValue, notifications);
        }
        return featureMap.basicAdd(feature, otherEnd, notifications);
      }
  }

  @Override public NotificationChain eDynamicInverseRemove(InternalEObject otherEnd, int featureID, Class<? > inverseClass, NotificationChain notifications) {
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal) eClass().getEStructuralFeature(featureID);
    if (feature instanceof EReference && ((EReference) feature).isContainer()) {
      return eSettingDelegate(feature).dynamicInverseRemove(this, null, -1, otherEnd, notifications);
    }
    else {
      return featureMap.basicRemove(feature, otherEnd, notifications);
    }
  }

  public FeatureMap featureMap() {
    return featureMap;
  }

  @Override public void eNotify(Notification notification) {
    if (notification.getFeatureID(null) != -1) {
      super.eNotify(notification);
    }
  }

  @Override public String toString() {
    String result = super.toString();
    result = "org.eclipse.emf.ecore.impl.EObjectImpl" + result.substring(result.indexOf("@"));
    return result;
  }
}

@Override public void set(Object newValue) {
  super.set(newValue instanceof FeatureMap ? newValue: ((FeatureMap.Internal.Wrapper) newValue).featureMap());
}


First
Previous
Clone Instance
2
Line Count
166
Source Line
2226
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java

/**
 * -------------------------------------------
 */
public static class ResolvingFeatureEIterator<E> extends FeatureEIterator<E> {
  public ResolvingFeatureEIterator(EStructuralFeature eStructuralFeature, FeatureMap.Internal featureMap) {
    super(eStructuralFeature, featureMap);
  }

  @Override protected boolean resolve() {
    return true;
  }
}

/**
 * Temporary for testing purposes only.
 */
public static class FeatureMapEObjectImpl extends org.eclipse.emf.ecore.impl.EObjectImpl {
  protected DelegatingFeatureMap featureMap = new DelegatingFeatureMap(this, -1) {
                                                private static final long serialVersionUID = 1L;

                                                protected List<Entry> theList = new java.util.ArrayList<Entry>();

                                                @Override protected List<Entry> delegateList() {
                                                  return theList;
                                                }
                                              };

  public FeatureMapEObjectImpl() {
    super();
  }

  @Override public Object eDynamicGet(EStructuralFeature eFeature, boolean resolve) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      return eSettingDelegate(eFeature).dynamicGet(this, null, -1, true, true);
    }
    else {
      return featureMap.setting(eFeature).get(resolve);
    }
  }

  @Override public void eDynamicSet(EStructuralFeature eFeature, Object newValue) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      eSettingDelegate(eFeature).dynamicSet(this, null, -1, newValue);
    }
    else {
      if ( !eFeature.isUnsettable()) {
        Object defaultValue = eFeature.getDefaultValue();
        if (defaultValue == null ? newValue == null: defaultValue.equals(newValue)) {
          featureMap.setting(eFeature).unset();
          return;
        }
      }
      featureMap.setting(eFeature).set(newValue);
    }
  }

  @Override public void eDynamicUnset(EStructuralFeature eFeature) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      eSettingDelegate(eFeature).dynamicUnset(this, null, -1);
    }
    else {
      featureMap.setting(eFeature).unset();
    }
  }

  @Override public boolean eDynamicIsSet(EStructuralFeature eFeature) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      return eSettingDelegate(eFeature).dynamicIsSet(this, null, -1);
    }
    else {
      return featureMap.setting(eFeature).isSet();
    }
  }

  @Override public NotificationChain eDynamicInverseAdd(InternalEObject otherEnd, int featureID, Class<? > inverseClass, NotificationChain notifications) {
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal) eClass().getEStructuralFeature(featureID);
    if (feature.isMany()) {
      return featureMap.basicAdd(feature, otherEnd, notifications);
    }
    else
      if (feature instanceof EReference && ((EReference) feature).isContainer()) {
        return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);
      }
      else {
        InternalEObject oldValue = (InternalEObject) eDynamicGet(feature, false);
        if (oldValue != null) {
          notifications = oldValue.eInverseRemove(this, oldValue.eClass().getFeatureID(((EReference) feature).getEOpposite()), null, notifications);
          notifications = featureMap.basicRemove(feature, oldValue, notifications);
        }
        return featureMap.basicAdd(feature, otherEnd, notifications);
      }
  }

  @Override public NotificationChain eDynamicInverseRemove(InternalEObject otherEnd, int featureID, Class<? > inverseClass, NotificationChain notifications) {
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal) eClass().getEStructuralFeature(featureID);
    if (feature instanceof EReference && ((EReference) feature).isContainer()) {
      return eSettingDelegate(feature).dynamicInverseRemove(this, null, -1, otherEnd, notifications);
    }
    else {
      return featureMap.basicRemove(feature, otherEnd, notifications);
    }
  }

  public FeatureMap featureMap() {
    return featureMap;
  }

  @Override public void eNotify(Notification notification) {
    if (notification.getFeatureID(null) != -1) {
      super.eNotify(notification);
    }
  }

  @Override public String toString() {
    String result = super.toString();
    result = "org.eclipse.emf.ecore.impl.EObjectImpl" + result.substring(result.indexOf("@"));
    return result;
  }
}

@Override public void set(Object newValue) {
  super.set(newValue instanceof FeatureMap ? newValue: ((FeatureMap.Internal.Wrapper) newValue).featureMap());
}


Clone AbstractionParameter Count: 2Parameter Bindings

/**
   * -------------------------------------------
   */
public static class ResolvingFeatureEIterator<E> extends FeatureEIterator<E> {
  public ResolvingFeatureEIterator(EStructuralFeature eStructuralFeature, FeatureMap.Internal featureMap) {
    super(eStructuralFeature, featureMap);
  }

  @Override protected boolean resolve() {
    return true;
  }
}

/**
   * Temporary for testing purposes only.
   */
public static class FeatureMapEObjectImpl extends org.eclipse.emf.ecore.impl.EObjectImpl {
  protected [[#variable170e9c40]] featureMap = [[#variable170e9bc0]];

  public FeatureMapEObjectImpl() {
    super();
  }

  @Override public Object eDynamicGet(EStructuralFeature eFeature, boolean resolve) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      return eSettingDelegate(eFeature).dynamicGet(this, null, -1, true, true);
    }
    else {
      return featureMap.setting(eFeature).get(resolve);
    }
  }

  @Override public void eDynamicSet(EStructuralFeature eFeature, Object newValue) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      eSettingDelegate(eFeature).dynamicSet(this, null, -1, newValue);
    }
    else {
      if ( !eFeature.isUnsettable()) {
        Object defaultValue = eFeature.getDefaultValue();
        if (defaultValue == null ? newValue == null: defaultValue.equals(newValue)) {
          featureMap.setting(eFeature).unset();
          return;
        }
      }
      featureMap.setting(eFeature).set(newValue);
    }
  }

  @Override public void eDynamicUnset(EStructuralFeature eFeature) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      eSettingDelegate(eFeature).dynamicUnset(this, null, -1);
    }
    else {
      featureMap.setting(eFeature).unset();
    }
  }

  @Override public boolean eDynamicIsSet(EStructuralFeature eFeature) {
    if (eFeature instanceof EReference && ((EReference) eFeature).isContainer()) {
      return eSettingDelegate(eFeature).dynamicIsSet(this, null, -1);
    }
    else {
      return featureMap.setting(eFeature).isSet();
    }
  }

  @Override public NotificationChain eDynamicInverseAdd(InternalEObject otherEnd, int featureID, Class<? > inverseClass, NotificationChain notifications) {
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal) eClass().getEStructuralFeature(featureID);
    if (feature.isMany()) {
      return featureMap.basicAdd(feature, otherEnd, notifications);
    }
    else
      if (feature instanceof EReference && ((EReference) feature).isContainer()) {
        return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);
      }
      else {
        InternalEObject oldValue = (InternalEObject) eDynamicGet(feature, false);
        if (oldValue != null) {
          notifications = oldValue.eInverseRemove(this, oldValue.eClass().getFeatureID(((EReference) feature).getEOpposite()), null, notifications);
          notifications = featureMap.basicRemove(feature, oldValue, notifications);
        }
        return featureMap.basicAdd(feature, otherEnd, notifications);
      }
  }

  @Override public NotificationChain eDynamicInverseRemove(InternalEObject otherEnd, int featureID, Class<? > inverseClass, NotificationChain notifications) {
    EStructuralFeature.Internal feature = (EStructuralFeature.Internal) eClass().getEStructuralFeature(featureID);
    if (feature instanceof EReference && ((EReference) feature).isContainer()) {
      return eSettingDelegate(feature).dynamicInverseRemove(this, null, -1, otherEnd, notifications);
    }
    else {
      return featureMap.basicRemove(feature, otherEnd, notifications);
    }
  }

  public FeatureMap featureMap() {
    return featureMap;
  }

  @Override public void eNotify(Notification notification) {
    if (notification.getFeatureID(null) != -1) {
      super.eNotify(notification);
    }
  }

  @Override public String toString() {
    String result = super.toString();
    result = "org.eclipse.emf.ecore.impl.EObjectImpl" + result.substring(result.indexOf("@"));
    return result;
  }
}

@Override public void set(Object newValue) {
  super.set(newValue instanceof FeatureMap ? newValue: ((FeatureMap.Internal.Wrapper) newValue).featureMap());
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#170e9c40]]
BasicFeatureMap 
12[[#170e9c40]]
DelegatingFeatureMap 
21[[#170e9bc0]]
new BasicFeatureMap(this, -1) 
22[[#170e9bc0]]
new DelegatingFeatureMap(this, -1) {
  private static final long serialVersionUID = 1L;

  protected List<Entry> theList = new java.util.ArrayList<Entry>();

  @Override protected List<Entry> delegateList() {
    return theList;
  }
}