do { char ch1 = ch = iterator.setIndex(--index); char ch2 = this.pattern[--pindex]; if (ch1 != ch2) { ch1 = Character.toUpperCase(ch1); ch2 = Character.toUpperCase(ch2); if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2)) break; } if (pindex == 0) return index; } while (pindex > 0); index += this.shiftTable[ch % this.shiftTable.length] + 1;
do { char ch1 = ch = text.charAt(--index); char ch2 = this.pattern[--pindex]; if (ch1 != ch2) { ch1 = Character.toUpperCase(ch1); ch2 = Character.toUpperCase(ch2); if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2)) break; } if (pindex == 0) return index; } while (pindex > 0); index += this.shiftTable[ch % this.shiftTable.length] + 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 matchesIgnoreCase(CharacterIterator, int, int) Method name: int matchesIgnoreCase(String, int, int)
Number of AST nodes: 11 Number of AST nodes: 11
1
do
1
do
2
        {
2
        {
3
          char ch1 = ch = iterator.setIndex(--index);
3
          char ch1 = ch = text.charAt(--index);
4
          char ch2 = this.pattern[--pindex];
4
          char ch2 = this.pattern[--pindex];
5
          if (ch1 != ch2)
5
          if (ch1 != ch2)
6
          {
6
          {
7
            ch1 = Character.toUpperCase(ch1);
7
            ch1 = Character.toUpperCase(ch1);
8
            ch2 = Character.toUpperCase(ch2);
8
            ch2 = Character.toUpperCase(ch2);
9
            if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))
9
            if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))
10
              break;
10
              break;
11
          }
11
          }
12
          if (pindex == 0)
12
          if (pindex == 0)
13
            return index;
13
            return index;
14
        }
14
        }
15
        while (pindex > 0);
15
        while (pindex > 0);
16
        index += this.shiftTable[ch % this.shiftTable.length] + 1;
16
        index += this.shiftTable[ch % this.shiftTable.length] + 1;
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.4
Clones locationClones are declared in the same class
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    18
    do while(pindex > 0)
    18
    do while(pindex > 0)
                                                                            
    9
    char ch1 = ch = text.charAt(--index);
    Preondition Violations
    Unmatched statement char ch1=ch=text.charAt(--index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    char ch1 = ch = text.charAt(--index);
    9
    char ch1 = ch = iterator.setIndex(--index);
    9
    char ch1 = ch = iterator.setIndex(--index);
    Preondition Violations
    Unmatched statement char ch1=ch=iterator.setIndex(--index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                        
    10
    char ch2 = this.pattern[--pindex];
    10
    char ch2 = this.pattern[--pindex];
    11
    if (ch1 != ch2)
    11
    if (ch1 != ch2)
    12
    ch1 = Character.toUpperCase(ch1);
    12
    ch1 = Character.toUpperCase(ch1);
    13
    ch2 = Character.toUpperCase(ch2);
    13
    ch2 = Character.toUpperCase(ch2);
    14
    if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))
    14
    if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))
    15
    break;
    15
    break;
    16
    if (pindex == 0)
    16
    if (pindex == 0)
    17
    return index;
    17
    return index;
    19
    index += this.shiftTable[ch % this.shiftTable.length] + 1;
    19
    index += this.shiftTable[ch % this.shiftTable.length] + 1;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement char ch1=ch=text.charAt(--index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement char ch1=ch=iterator.setIndex(--index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted