for (int i = 0; i < op.size(); i ++) { int ret = this. matchString (con, op.elementAt(i), offset, dx, opts); if (DEBUG) { System.err.println("UNION: "+i+", ret="+ret); } if (ret >= 0) return ret; }
for (int i = 0; i < op.size(); i ++) { int ret = this. matchCharacterIterator (con, op.elementAt(i), offset, dx, opts); if (DEBUG) { System.err.println("UNION: "+i+", ret="+ret); } if (ret >= 0) return ret; }
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: int matchString(Context, Op, int, int, int) Method name: int matchCharacterIterator(Context, Op, int, int, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
for (int i = 0;  i < op.size();  i ++) {
1
for (int i = 0;  i < op.size();  i ++) {
2
                      int ret = this. matchString (con, op.elementAt(i), offset, dx, opts);
2
                      int ret = this. matchCharacterIterator (con, op.elementAt(i), offset, dx, opts);
3
                      if (DEBUG) {
3
                      if (DEBUG) {
4
                          System.err.println("UNION: "+i+", ret="+ret);
4
                          System.err.println("UNION: "+i+", ret="+ret);
5
                      }
5
                      }
6
                      if (ret >= 0)  return ret;
6
                      if (ret >= 0)  return ret;
7
                  }
7
                  }
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 comparisons21
  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)39.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    237
    for (int i = 0; i < op.size(); i++)
    237
    for (int i = 0; i < op.size(); i++)
    238
    int ret = this.matchString(con, op.elementAt(i), offset, dx, opts);
    238
    int ret = this.matchString(con, op.elementAt(i), offset, dx, opts);
    238
    int ret = this.matchCharacterIterator(con, op.elementAt(i), offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchString
    Expression this.matchCharacterIterator(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    238
    int ret = this.matchCharacterIterator(con, op.elementAt(i), offset, dx, opts);
    239
    if (DEBUG)
    239
    if (DEBUG)
    240
    System.err.println("UNION: " + i + ", ret=" + ret);
    240
    System.err.println("UNION: " + i + ", ret=" + ret);
    241
    if (ret >= 0)
    241
    if (ret >= 0)
    242
    return ret;
    242
    return ret;
    Precondition Violations (2)
    Row Violation
    1Expression this.matchString(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.matchCharacterIterator(con,op.elementAt(i),offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted