for (int i = 0; i < size; ++i) { EGenericType eTypeArgument1 = eTypeArguments1.get(i); EGenericType eTypeArgument2 = eTypeArguments2.get(i); if (!equalTypeArguments(eTypeArgument1, eTypeArgument2, substitutions)) { return false; } } return true;
for (int i = 0; i < size; ++i) { EGenericType eTypeArgument1 = eTypeArguments1.get(i); EGenericType eTypeArgument2 = eTypeArguments2.get(i); if (!isMatching(eTypeArgument1, eTypeArgument2, substitutions)) { return false; } } return true;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java
Method name: boolean equalTypeArguments(EList, EList, Map) Method name: boolean matchingTypeArguments(EList, EList, Map)
Number of AST nodes: 6 Number of AST nodes: 6
1
for (int i = 0; i < size; ++i)
1
for (int i = 0; i < size; ++i)
2
      {
2
      {
3
        EGenericType eTypeArgument1 = eTypeArguments1.get(i);
3
        EGenericType eTypeArgument1 = eTypeArguments1.get(i);
4
        EGenericType eTypeArgument2 = eTypeArguments2.get(i);
4
        EGenericType eTypeArgument2 = eTypeArguments2.get(i);
5
        if (!equalTypeArguments(eTypeArgument1, eTypeArgument2, substitutions))
5
        if (!isMatching(eTypeArgument1, eTypeArgument2, substitutions))
6
        {
6
        {
7
          return false;
7
          return false;
8
        }
8
        }
9
      }
9
      }
10
      return true;
10
      return true;
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.4
Clones locationClones are declared in the same class
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    for (int i = 0; i < size; ++i)
    4
    for (int i = 0; i < size; ++i)
    5
    EGenericType eTypeArgument1 = eTypeArguments1.get(i);
    5
    EGenericType eTypeArgument1 = eTypeArguments1.get(i);
    6
    EGenericType eTypeArgument2 = eTypeArguments2.get(i);
    6
    EGenericType eTypeArgument2 = eTypeArguments2.get(i);
    7
    if (!equalTypeArguments(eTypeArgument1, eTypeArgument2, substitutions))
    7
    if (!equalTypeArguments(eTypeArgument1, eTypeArgument2, substitutions))
    7
    if (!isMatching(eTypeArgument1, eTypeArgument2, substitutions))
    Differences
    Expression1Expression2Difference
    equalTypeArgumentsisMatchingMETHOD_INVOCATION_NAME_MISMATCH
    java.util.Map<,>java.util.Map<,>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression equalTypeArguments(eTypeArgument1,eTypeArgument2,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression isMatching(eTypeArgument1,eTypeArgument2,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.Map<,> of variable substitutions does not match with type java.util.Map<,> of variable substitutions
    • Make classes java.util.Map<,> and java.util.Map<,> extend a common superclass
    7
    if (!isMatching(eTypeArgument1, eTypeArgument2, substitutions))
    8
    return false;
    8
    return false;
    8
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    8
    return false;
    9
    return true;
    9
    return true;
    9
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    9
    return true;
    Precondition Violations (7)
    Row Violation
    1Expression equalTypeArguments(eTypeArgument1,eTypeArgument2,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression isMatching(eTypeArgument1,eTypeArgument2,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.util.Map<,> of variable substitutions does not match with type java.util.Map<,> of variable substitutions
    4Conditional return false;
    5Conditional return false;
    6Conditional return true;
    7Conditional return true;