if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE)) { int matchEnd = this. matchCharArray (con, this.operations, con.start, 1, this.options); //System.err.println("DEBUG: matchEnd="+matchEnd); if (matchEnd == con.limit) { if (con.match != null) { con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); } con.inuse = false; return true; } return false; }
if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE)) { int matchEnd = this. matchCharacterIterator (con, this.operations, con.start, 1, this.options); //System.err.println("DEBUG: matchEnd="+matchEnd); if (matchEnd == con.limit) { if (con.match != null) { con.match.setBeginning(0, con.start); con.match.setEnd(0, matchEnd); } con.inuse = false; return true; } 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(char[], int, int, Match) Method name: boolean matches(CharacterIterator, Match)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE)) {
1
if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE)) {
2
              int matchEnd = this. matchCharArray (con, this.operations, con.start, 1, this.options);
2
              int matchEnd = this. matchCharacterIterator (con, this.operations, con.start, 1, this.options);
3
              //System.err.println("DEBUG: matchEnd="+matchEnd);
3
              //System.err.println("DEBUG: matchEnd="+matchEnd);
4
              if (matchEnd == con.limit) {
4
              if (matchEnd == con.limit) {
5
                  if (con.match != null) {
5
                  if (con.match != null) {
6
                      con.match.setBeginning(0, con.start);
6
                      con.match.setBeginning(0, con.start);
7
                      con.match.setEnd(0, matchEnd);
7
                      con.match.setEnd(0, matchEnd);
8
                  }
8
                  }
9
                  con.inuse = false;
9
                  con.inuse = false;
10
                  return true;
10
                  return true;
11
              }
11
              }
12
              return false;
12
              return false;
13
          }
13
          }
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 comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE))
    19
    if (RegularExpression.isSet(this.options, XMLSCHEMA_MODE))
    18
    int matchEnd = this.matchCharArray(con, this.operations, con.start, 1, this.options);
    18
    int matchEnd = this.matchCharArray(con, this.operations, con.start, 1, this.options);
    20
    int matchEnd = this.matchCharacterIterator(con, this.operations, con.start, 1, this.options);
    Differences
    Expression1Expression2Difference
    matchCharArraymatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    20
    int matchEnd = this.matchCharacterIterator(con, this.operations, con.start, 1, this.options);
    19
    if (matchEnd == con.limit)
    21
    if (matchEnd == con.limit)
    20
    if (con.match != null)
    22
    if (con.match != null)
    21
    con.match.setBeginning(0, con.start);
    23
    con.match.setBeginning(0, con.start);
    22
    con.match.setEnd(0, matchEnd);
    24
    con.match.setEnd(0, matchEnd);
    23
    con.inuse = false;
    25
    con.inuse = false;
    24
    return true;
    24
    return true;
    26
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    26
    return true;
    25
    return false;
    25
    return false;
    27
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    27
    return false;
    Precondition Violations (4)
    Row Violation
    1Conditional return true;
    2Conditional return true;
    3Conditional return false;
    4Conditional return false;