if (cop.refNumber > 0) { if (cop.refNumber >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber); matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0; } else { matchp = 0 <= this. matchString (con, cop.condition, offset, dx, opts); }
if (cop.refNumber > 0) { if (cop.refNumber >= this.nofparen) throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber); matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0; } else { matchp = 0 <= this. matchCharacterIterator (con, cop.condition, offset, dx, opts); }
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: 5 Number of AST nodes: 5
1
if (cop.refNumber > 0) {
1
if (cop.refNumber > 0) {
2
                          if (cop.refNumber >= this.nofparen)
2
                          if (cop.refNumber >= this.nofparen)
3
                              throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber);
3
                              throw new RuntimeException("Internal Error: Reference number must be more than zero: "+cop.refNumber);
4
                          matchp = con.match.getBeginning(cop.refNumber) >= 0
4
                          matchp = con.match.getBeginning(cop.refNumber) >= 0
5
                                   && con.match.getEnd(cop.refNumber) >= 0;
5
                                   && con.match.getEnd(cop.refNumber) >= 0;
6
                      } else {
6
                      } else {
7
                          matchp = 0 <= this. matchString (con, cop.condition, offset, dx, opts);
7
                          matchp = 0 <= this. matchCharacterIterator (con, cop.condition, offset, dx, opts);
8
                      }
8
                      }
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 comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)37.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    303
    if (cop.refNumber > 0)
    303
    if (cop.refNumber > 0)
    304
    if (cop.refNumber >= this.nofparen)
    304
    if (cop.refNumber >= this.nofparen)
    305
    throw new RuntimeException("Internal Error: Reference number must be more than zero: " + cop.refNumber);
    305
    throw new RuntimeException("Internal Error: Reference number must be more than zero: " + cop.refNumber);
    306
    matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0;
    306
    matchp = con.match.getBeginning(cop.refNumber) >= 0 && con.match.getEnd(cop.refNumber) >= 0;
    else
    else
    307
    matchp = 0 <= this.matchString(con, cop.condition, offset, dx, opts);
    307
    matchp = 0 <= this.matchString(con, cop.condition, offset, dx, opts);
    307
    matchp = 0 <= this.matchCharacterIterator(con, cop.condition, offset, dx, opts);
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.matchString(con,cop.condition,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,cop.condition,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method matchCharacterIterator
    307
    matchp = 0 <= this.matchCharacterIterator(con, cop.condition, offset, dx, opts);
    Precondition Violations (2)
    Row Violation
    1Expression this.matchString(con,cop.condition,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.matchCharacterIterator(con,cop.condition,offset,dx,opts) cannot be parameterized, because it has dependencies to/from statements that will be extracted