if (isSet(opts, MULTIPLE_LINES)) { if (!(offset == con.start || offset > con.start && isEOLChar( target [ offset-1 ] ))) return -1; } else { if (offset != con.start) return -1; }
if (isSet(opts, MULTIPLE_LINES)) { if (!(offset == con.start || offset > con.start && isEOLChar( target .setIndex( offset-1 ) ))) return -1; } else { if (offset != con.start) return -1; }
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 matchCharArray(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 (isSet(opts, MULTIPLE_LINES)) {
1
if (isSet(opts, MULTIPLE_LINES)) {
2
                          if (!(offset == con.start
2
                          if (!(offset == con.start
3
                                || offset > con.start && isEOLChar( target [  offset-1 ] )))
3
                                || offset > con.start && isEOLChar( target .setIndex(  offset-1 ) )))
4
                              return -1;
4
                              return -1;
5
                      } else {
5
                      } else {
6
                          if (offset != con.start)
6
                          if (offset != con.start)
7
                              return -1;
7
                              return -1;
8
                      }
8
                      }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.8
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {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)8.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    101
    if (isSet(opts, MULTIPLE_LINES))
    101
    if (isSet(opts, MULTIPLE_LINES))
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target[offset - 1])))
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target[offset - 1])))
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target.setIndex(offset - 1))))
    Differences
    Expression1Expression2Difference
    target[offset - 1]target.setIndex(offset - 1)TYPE_COMPATIBLE_REPLACEMENT
    102
    if (!(offset == con.start || offset > con.start && isEOLChar(target.setIndex(offset - 1))))
    103
    return -1;
    103
    return -1;
    else
    else
    104
    if (offset != con.start)
    104
    if (offset != con.start)
    105
    return -1;
    105
    return -1;
    Precondition Violations (0)
    Row Violation