if (tok.ranges == null || this.ranges == null) return; this.icaseCache = null; this.sortRanges(); this.compactRanges(); tok.sortRanges(); tok.compactRanges(); //System.err.println("Token#substractRanges(): Entry: "+this.ranges.length+", "+tok.ranges.length); int[] result = new int[this.ranges.length+tok.ranges.length]; int wp = 0, src = 0, sub = 0;
if (tok.ranges == null || this.ranges == null) return; this.icaseCache = null; this.sortRanges(); this.compactRanges(); tok.sortRanges(); tok.compactRanges(); int[] result = new int[this.ranges.length+tok.ranges.length]; int wp = 0, src1 = 0, src2 = 0;
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: void subtractRanges(Token) Method name: void intersectRanges(Token)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (tok.ranges == null || this.ranges == null)
1
if (tok.ranges == null || this.ranges == null)
2
            return;
2
            return;
3
        this.icaseCache = null;
3
        this.icaseCache = null;
4
        this.sortRanges();
4
        this.sortRanges();
5
        this.compactRanges();
5
        this.compactRanges();
6
        tok.sortRanges();
6
        tok.sortRanges();
7
        tok.compactRanges();
7
        tok.compactRanges();
8
        //System.err.println("Token#substractRanges(): Entry: "+this.ranges.length+", "+tok.ranges.length);
9
        int[] result = new int[this.ranges.length+tok.ranges.length];
8
        int[] result = new int[this.ranges.length+tok.ranges.length];
10
        int wp = 0, src = 0, sub = 0;
9
        int wp = 0, src1 = 0, src2 = 0;
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 comparisons31
  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)2.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (tok.ranges == null || this.ranges == null)
    2
    if (tok.ranges == null || this.ranges == null)
    6
    return;
    6
    return;
    3
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    3
    return;
    7
    this.icaseCache = null;
    4
    this.icaseCache = null;
    8
    this.sortRanges();
    5
    this.sortRanges();
    9
    this.compactRanges();
    6
    this.compactRanges();
    10
    tok.sortRanges();
    7
    tok.sortRanges();
    11
    tok.compactRanges();
    8
    tok.compactRanges();
    12
    int[] result = new int[this.ranges.length + tok.ranges.length];
    9
    int[] result = new int[this.ranges.length + tok.ranges.length];
    13
    int wp = 0, src = 0, sub = 0;
    13
    int wp = 0, src = 0, sub = 0;
    10
    int wp = 0, src1 = 0, src2 = 0;
    Differences
    Expression1Expression2Difference
    srcsrc1VARIABLE_NAME_MISMATCH
    subsrc2VARIABLE_NAME_MISMATCH
    10
    int wp = 0, src1 = 0, src2 = 0;
    Precondition Violations (3)
    Row Violation
    1Conditional return;
    2Conditional return;
    3Clone fragment #1 returns variables src, sub, result, wp , while Clone fragment #2 returns variables src1, src2, result, wp