while (partlen-- > 0) { char ch1 = target .setIndex( offset++ ) ; char ch2 = part.charAt(i++); if (ch1 == ch2) continue; char uch1 = Character.toUpperCase(ch1); char uch2 = Character.toUpperCase(ch2); if (uch1 == uch2) continue; if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2)) return false; }
while (partlen-- > 0) { char ch1 = target .setIndex( offset++ ) ; char ch2 = target .setIndex( i++ ) ; if (ch1 == ch2) continue; char uch1 = Character.toUpperCase(ch1); char uch2 = Character.toUpperCase(ch2); if (uch1 == uch2) continue; if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2)) return false; }
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: boolean regionMatchesIgnoreCase(CharacterIterator, int, int, String, int) Method name: boolean regionMatchesIgnoreCase(CharacterIterator, int, int, int, int)
Number of AST nodes: 11 Number of AST nodes: 11
1
while (partlen-- > 0) {
1
while (partlen-- > 0) {
2
              char ch1 =  target .setIndex(  offset++ ) ;
2
              char ch1 =  target .setIndex(  offset++ ) ;
3
              char ch2 = part.charAt(i++);
3
              char ch2 =  target .setIndex(  i++ ) ;
4
              if (ch1 == ch2)
4
              if (ch1 == ch2)
5
                  continue;
5
                  continue;
6
              char uch1 = Character.toUpperCase(ch1);
6
              char uch1 = Character.toUpperCase(ch1);
7
              char uch2 = Character.toUpperCase(ch2);
7
              char uch2 = Character.toUpperCase(ch2);
8
              if (uch1 == uch2)
8
              if (uch1 == uch2)
9
                  continue;
9
                  continue;
10
              if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2))
10
              if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2))
11
                  return false;
11
                  return false;
12
          }
12
          }
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.6
Clones locationClones are declared in the same class
Number of node comparisons52
  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)2.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    while (partlen-- > 0)
    6
    while (partlen-- > 0)
    7
    char ch1 = target.setIndex(offset++);
    7
    char ch1 = target.setIndex(offset++);
                                                                      
    8
    char ch2 = target.setIndex(i++);
    Preondition Violations
    Unmatched statement char ch2=target.setIndex(i++); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    char ch2 = target.setIndex(i++);
    8
    char ch2 = part.charAt(i++);
    8
    char ch2 = part.charAt(i++);
    Preondition Violations
    Unmatched statement char ch2=part.charAt(i++); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    9
    if (ch1 == ch2)
    9
    if (ch1 == ch2)
    10
    continue;
    10
    continue;
    11
    char uch1 = Character.toUpperCase(ch1);
    11
    char uch1 = Character.toUpperCase(ch1);
    12
    char uch2 = Character.toUpperCase(ch2);
    12
    char uch2 = Character.toUpperCase(ch2);
    13
    if (uch1 == uch2)
    13
    if (uch1 == uch2)
    14
    continue;
    14
    continue;
    15
    if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2))
    15
    if (Character.toLowerCase(uch1) != Character.toLowerCase(uch2))
    16
    return false;
    16
    return false;
    16
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    16
    return false;
    Precondition Violations (4)
    Row Violation
    1Unmatched statement char ch2=target.setIndex(i++); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement char ch2=part.charAt(i++); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Conditional return false;
    4Conditional return false;