for (int i = 0; i < uppers.ranges.length; i += 2) { for (int ch = uppers.ranges[i]; ch <= uppers.ranges[i+1]; ch ++) { if (ch > 0xffff) lowers.addRange(ch, ch); else { char uch = Character.toUpperCase((char)ch); lowers.addRange(uch, uch); } } }
for (int i = 0; i < this.ranges.length; i += 2) { for (int ch = this.ranges[i]; ch <= this.ranges[i+1]; ch ++) { if (ch > 0xffff) uppers.addRange(ch, ch); else { char uch = Character.toUpperCase((char)ch); uppers.addRange(uch, uch); } } }
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: RangeToken getCaseInsensitiveToken() Method name: RangeToken getCaseInsensitiveToken()
Number of AST nodes: 6 Number of AST nodes: 6
1
for (int i = 0;  i < uppers.ranges.length;  i += 2) {
1
for (int i = 0;  i < this.ranges.length;  i += 2) {
2
            for (int ch = uppers.ranges[i];  ch <= uppers.ranges[i+1];  ch ++) {
2
            for (int ch = this.ranges[i];  ch <= this.ranges[i+1];  ch ++) {
3
                if (ch > 0xffff)
3
                if (ch > 0xffff)
4
                    lowers.addRange(ch, ch);
4
                    uppers.addRange(ch, ch);
5
                else {
5
                else {
6
                    char uch = Character.toUpperCase((char)ch);
6
                    char uch = Character.toUpperCase((char)ch);
7
                    lowers.addRange(uch, uch);
7
                    uppers.addRange(uch, uch);
8
                }
8
                }
9
            }
9
            }
10
        }
10
        }
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.4
Clones locationClones are in the same method
Number of node comparisons22
  1. {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)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    for (int i = 0; i < uppers.ranges.length; i += 2)
    11
    for (int i = 0; i < uppers.ranges.length; i += 2)
    4
    for (int i = 0; i < this.ranges.length; i += 2)
    Differences
    Expression1Expression2Difference
    uppers.ranges.lengththis.ranges.lengthTYPE_COMPATIBLE_REPLACEMENT
    4
    for (int i = 0; i < this.ranges.length; i += 2)
    12
    for (int ch = uppers.ranges[i]; ch <= uppers.ranges[i + 1]; ch++)
    12
    for (int ch = uppers.ranges[i]; ch <= uppers.ranges[i + 1]; ch++)
    5
    for (int ch = this.ranges[i]; ch <= this.ranges[i + 1]; ch++)
    Differences
    Expression1Expression2Difference
    uppers.rangesthis.rangesTYPE_COMPATIBLE_REPLACEMENT
    uppers.rangesthis.rangesTYPE_COMPATIBLE_REPLACEMENT
    5
    for (int ch = this.ranges[i]; ch <= this.ranges[i + 1]; ch++)
    13
    if (ch > 0xffff)
    6
    if (ch > 0xffff)
    14
    lowers.addRange(ch, ch);
    14
    lowers.addRange(ch, ch);
    7
    uppers.addRange(ch, ch);
    Differences
    Expression1Expression2Difference
    lowersuppersVARIABLE_NAME_MISMATCH
    7
    uppers.addRange(ch, ch);
    else
    else
    15
    char uch = Character.toUpperCase((char)ch);
    8
    char uch = Character.toUpperCase((char)ch);
    16
    lowers.addRange(uch, uch);
    16
    lowers.addRange(uch, uch);
    9
    uppers.addRange(uch, uch);
    Differences
    Expression1Expression2Difference
    lowersuppersVARIABLE_NAME_MISMATCH
    9
    uppers.addRange(uch, uch);
    Precondition Violations (0)
    Row Violation