if (matchEnd >= 0) { if (con.match != null) { con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd); } con.inuse = false; return true; } else { con.inuse = false; return false; }
if (matchEnd >= 0) { if (con.match != null) { con.match.setBeginning(0, matchStart); con.match.setEnd(0, matchEnd); } con.inuse = false; return true; } else { con.inuse = false; return false; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
Method name: boolean matches(String, int, int, Match) Method name: boolean matches(CharacterIterator, Match)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (matchEnd >= 0) {
1
if (matchEnd >= 0) {
2
              if (con.match != null) {
2
              if (con.match != null) {
3
                  con.match.setBeginning(0, matchStart);
3
                  con.match.setBeginning(0, matchStart);
4
                  con.match.setEnd(0, matchEnd);
4
                  con.match.setEnd(0, matchEnd);
5
              }
5
              }
6
              con.inuse = false;
6
              con.inuse = false;
7
              return true;
7
              return true;
8
          } else {
8
          } else {
9
              con.inuse = false;
9
              con.inuse = false;
10
              return false;
10
              return false;
11
          }
11
          }
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 comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    90
    if (matchEnd >= 0)
    87
    if (matchEnd >= 0)
    91
    if (con.match != null)
    88
    if (con.match != null)
    92
    con.match.setBeginning(0, matchStart);
    89
    con.match.setBeginning(0, matchStart);
    93
    con.match.setEnd(0, matchEnd);
    90
    con.match.setEnd(0, matchEnd);
    94
    con.inuse = false;
    91
    con.inuse = false;
    95
    return true;
    95
    return true;
    92
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    92
    return true;
    else
    else
    96
    con.inuse = false;
    93
    con.inuse = false;
    97
    return false;
    97
    return false;
    94
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    94
    return false;
    Precondition Violations (4)
    Row Violation
    1Conditional return false;
    2Conditional return false;
    3Conditional return true;
    4Conditional return true;