EGenericType eBoundEUpperBound = eBound.getEUpperBound(); if (eBoundEUpperBound != null) { return isBounded(eGenericType, eBoundEUpperBound, substitutions); } else { EGenericType eBoundELowerBound = eBound.getELowerBound(); if (eBoundELowerBound != null) { // If there is an lower bound, the type argument must bound it. // return isBounded(eBoundELowerBound, eGenericType, substitutions); } // The bound is a wildcard with no constraints. // return false; }
EGenericType eBoundEUpperBound = eBound.getEUpperBound(); if (eBoundEUpperBound != null) { return isBounded(eGenericType, eBoundEUpperBound, substitutions); } else { EGenericType eBoundELowerBound = eBound.getELowerBound(); if (eBoundELowerBound != null) { // Reverse the test. // return isMatching(eBoundELowerBound, eGenericType, substitutions); } // The bound is a wildcard with no constraints. // 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 isBounded(EGenericType, EGenericType, Map) Method name: boolean isMatching(EGenericType, EGenericType, Map)
Number of AST nodes: 7 Number of AST nodes: 7
1
EGenericType eBoundEUpperBound = eBound.getEUpperBound();
1
EGenericType eBoundEUpperBound = eBound.getEUpperBound();
2
        if (eBoundEUpperBound != null)
2
          if (eBoundEUpperBound != null)
3
        {
3
        
4
  {
4
          return isBounded(eGenericType, eBoundEUpperBound, substitutions);
5
            return isBounded(eGenericType, eBoundEUpperBound, substitutions);
5
        }
6
        
7
  }
6
        else
8
          else
7
        {
9
        
10
  {
8
          EGenericType eBoundELowerBound = eBound.getELowerBound();
11
            EGenericType eBoundELowerBound = eBound.getELowerBound();
9
          if (eBoundELowerBound != null)
12
            if (eBoundELowerBound != null)
10
          {
13
          
14
  {
11
            // If there is an lower bound, the type argument must bound it.
15
              // 
16
Reverse the test.
12
            //
17
              //
13
            return isBounded(eBoundELowerBound, eGenericType, substitutions);
18
              return isMatching(eBoundELowerBound, eGenericType, substitutions);
14
          }
19
            }
15
          
20
          
21
  
16
          // The bound is a wildcard with no constraints.
22
            // The bound is a wildcard with no constraints.
17
          //
23
            //
18
          return false;
24
            return  true;
19
        }
25
          }
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 comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    74
    EGenericType eBoundEUpperBound = eBound.getEUpperBound();
    27
    EGenericType eBoundEUpperBound = eBound.getEUpperBound();
    75
    if (eBoundEUpperBound != null)
    28
    if (eBoundEUpperBound != null)
    76
    return isBounded(eGenericType, eBoundEUpperBound, substitutions);
    76
    return isBounded(eGenericType, eBoundEUpperBound, substitutions);
    29
    return isBounded(eGenericType, eBoundEUpperBound, substitutions);
    Differences
    Expression1Expression2Difference
    java.util.Map<,>java.util.Map<,>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    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
    29
    return isBounded(eGenericType, eBoundEUpperBound, substitutions);
    else
    else
    77
    EGenericType eBoundELowerBound = eBound.getELowerBound();
    30
    EGenericType eBoundELowerBound = eBound.getELowerBound();
    78
    if (eBoundELowerBound != null)
    31
    if (eBoundELowerBound != null)
    79
    return isBounded(eBoundELowerBound, eGenericType, substitutions);
    79
    return isBounded(eBoundELowerBound, eGenericType, substitutions);
    32
    return isMatching(eBoundELowerBound, eGenericType, substitutions);
    Differences
    Expression1Expression2Difference
    isBoundedisMatchingMETHOD_INVOCATION_NAME_MISMATCH
    java.util.Map<,>java.util.Map<,>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression isBounded(eBoundELowerBound,eGenericType,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression isMatching(eBoundELowerBound,eGenericType,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
    32
    return isMatching(eBoundELowerBound, eGenericType, substitutions);
    80
    return false;
    80
    return false;
    33
    return true;
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    Preondition Violations
    Conditional return false;
    Conditional return true;
    33
    return true;
    Precondition Violations (6)
    Row Violation
    1Type java.util.Map<,> of variable substitutions does not match with type java.util.Map<,> of variable substitutions
    2Expression isBounded(eBoundELowerBound,eGenericType,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression isMatching(eBoundELowerBound,eGenericType,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.util.Map<,> of variable substitutions does not match with type java.util.Map<,> of variable substitutions
    5Conditional return false;
    6Conditional return true;