if (computationInProgress.add(this)) { for (EClass eSuperType : getESuperTypes()) { result.addAll(eSuperType.getEAllAttributes()); } computationInProgress.remove(this); }
if (computationInProgress.add(this)) { for (EClass eSuperType : getESuperTypes()) { result.addAll(eSuperType.getEAllReferences()); } computationInProgress.remove(this); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassImpl.java
Method name: EList getEAllAttributes() Method name: EList getEAllReferences()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (computationInProgress.add(this))
1
if (computationInProgress.add(this))
2
      {
2
      {
3
        for (EClass eSuperType : getESuperTypes())
3
        for (EClass eSuperType : getESuperTypes())
4
        {
4
        {
5
          result.addAll(eSuperType.getEAllAttributes());
5
          result.addAll(eSuperType.getEAllReferences());
6
        }
6
        }
7
        computationInProgress.remove(this);
7
        computationInProgress.remove(this);
8
      }
8
      }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (computationInProgress.add(this))
    5
    if (computationInProgress.add(this))
    7
    for (EClass eSuperType : getESuperTypes())
    6
    for (EClass eSuperType : getESuperTypes())
    8
    result.addAll(eSuperType.getEAllAttributes());
    8
    result.addAll(eSuperType.getEAllAttributes());
    7
    result.addAll(eSuperType.getEAllReferences());
    Differences
    Expression1Expression2Difference
    getEAllAttributesgetEAllReferencesMETHOD_INVOCATION_NAME_MISMATCH
    org.eclipse.emf.common.util.EListorg.eclipse.emf.common.util.EListVARIABLE_TYPE_MISMATCH
    org.eclipse.emf.common.util.BasicEListorg.eclipse.emf.common.util.BasicEListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eSuperType.getEAllAttributes() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eSuperType.getEAllReferences() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EAttribute> of variable eSuperType.getEAllAttributes() does not match with type org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EReference> of variable eSuperType.getEAllReferences()
    • Make classes org.eclipse.emf.common.util.EList and org.eclipse.emf.common.util.EList extend a common superclass
    Type org.eclipse.emf.common.util.BasicEList<org.eclipse.emf.ecore.EAttribute> of variable result does not match with type org.eclipse.emf.common.util.BasicEList<org.eclipse.emf.ecore.EReference> of variable result
    • Make classes org.eclipse.emf.common.util.BasicEList and org.eclipse.emf.common.util.BasicEList extend a common superclass
    7
    result.addAll(eSuperType.getEAllReferences());
    9
    computationInProgress.remove(this);
    8
    computationInProgress.remove(this);
    Precondition Violations (4)
    Row Violation
    1Expression eSuperType.getEAllAttributes() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression eSuperType.getEAllReferences() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EAttribute> of variable eSuperType.getEAllAttributes() does not match with type org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EReference> of variable eSuperType.getEAllReferences()
    4Type org.eclipse.emf.common.util.BasicEList<org.eclipse.emf.ecore.EAttribute> of variable result does not match with type org.eclipse.emf.common.util.BasicEList<org.eclipse.emf.ecore.EReference> of variable result