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 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: 4 Number of AST nodes: 4
1
EGenericType eBoundELowerBound = eBound.getELowerBound();
1
EGenericType eBoundELowerBound = eBound.getELowerBound();
2
          if (eBoundELowerBound != null)
2
            if (eBoundELowerBound != null)
3
          {
3
          
4
  {
4
            // If there is an lower bound, the type argument must bound it.
5
              // 
6
Reverse the test.
5
            //
7
              //
6
            return isBounded(eBoundELowerBound, eGenericType, substitutions);
8
              return isMatching(eBoundELowerBound, eGenericType, substitutions);
7
          }
9
            }
8
          
10
          
11
  
9
          // The bound is a wildcard with no constraints.
12
            // The bound is a wildcard with no constraints.
10
          //
13
            //
11
          return false;
14
            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.2
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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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 (5)
    Row Violation
    1Expression isBounded(eBoundELowerBound,eGenericType,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression isMatching(eBoundELowerBound,eGenericType,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 true;