for (int i = 0, length = eClassData.length; i < length; ++i) { EClassData eClassData = this.eClassData[i]; if (eClassData == null) { return i; } } return -1;
for (int i = 0, length = eClassData.length; i < length; ++i) { EClassData eClassData = this.eClassData[i]; if (eClassData == null) { return i; } } return -1;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/BinaryResourceImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/BinaryResourceImpl.java
Method name: int allocateEClassID() Method name: int allocateEClassID()
Number of AST nodes: 5 Number of AST nodes: 5
1
for (int i = 0, length = eClassData.length; i < length; ++i)
1
for (int i = 0, length = eClassData.length; i < length; ++i)
2
        {
2
        {
3
          EClassData eClassData = this.eClassData[i];
3
          EClassData eClassData = this.eClassData[i];
4
          if (eClassData == null)
4
          if (eClassData == null)
5
          {
5
          {
6
            return i;
6
            return i;
7
          }
7
          }
8
        }
8
        }
9
        return -1;
9
        return -1;
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 in the same java file
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0, length = eClassData.length; i < length; ++i)
    1
    for (int i = 0, length = eClassData.length; i < length; ++i)
    1
    for (int i = 0, length = eClassData.length; i < length; ++i)
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassData[]org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassData[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassData[] of variable eClassData does not match with type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassData[] of variable eClassData
    • Make classes org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassData[] and org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassData[] extend a common superclass
    1
    for (int i = 0, length = eClassData.length; i < length; ++i)
                                                                                            
    2
    EClassData eClassData = this.eClassData[i];
    Preondition Violations
    Unmatched statement EClassData eClassData=this.eClassData[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    EClassData eClassData = this.eClassData[i];
    2
    EClassData eClassData = this.eClassData[i];
    2
    EClassData eClassData = this.eClassData[i];
    Preondition Violations
    Unmatched statement EClassData eClassData=this.eClassData[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                            
    3
    if (eClassData == null)
    3
    if (eClassData == null)
    3
    if (eClassData == null)
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassDataorg.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassDataVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassData of variable eClassData does not match with type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassData of variable eClassData
    • Make classes org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassData and org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassData extend a common superclass
    3
    if (eClassData == null)
    4
    return i;
    4
    return i;
    5
    return -1;
    5
    return -1;
    Precondition Violations (4)
    Row Violation
    1Type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassData[] of variable eClassData does not match with type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassData[] of variable eClassData
    2Unmatched statement EClassData eClassData=this.eClassData[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement EClassData eClassData=this.eClassData[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectInputStream.EClassData of variable eClassData does not match with type org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream.EClassData of variable eClassData