int ch = target .charAt( matchStart ) ; if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) { ch = REUtil.composeFromSurrogates(ch, target .charAt( matchStart+1 ) ); if (!range.match(ch)) continue; } else { if (!range.match(ch)) { char ch1 = Character.toUpperCase((char)ch); if (!range.match(ch1)) if (!range.match(Character.toLowerCase(ch1))) continue; } } if (0 <= (matchEnd = this. matchString (con, this.operations, matchStart, 1, this.options))) break;
int ch = target .setIndex( matchStart ) ; if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) { ch = REUtil.composeFromSurrogates(ch, target .setIndex( matchStart+1 ) ); if (!range.match(ch)) continue; } else { if (!range.match(ch)) { char ch1 = Character.toUpperCase((char)ch); if (!range.match(ch1)) if (!range.match(Character.toLowerCase(ch1))) continue; } } if (0 <= (matchEnd = this. matchCharacterIterator (con, this.operations, matchStart, 1, this.options))) break;
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 matches(String, int, int, Match) Method name: boolean matches(CharacterIterator, Match)
Number of AST nodes: 12 Number of AST nodes: 12
1
int ch =  target .charAt(  matchStart ) ;
1
int ch =  target .setIndex(  matchStart ) ;
2
                      if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) {
2
                      if (REUtil.isHighSurrogate(ch) && matchStart+1 < con.limit) {
3
                          ch = REUtil.composeFromSurrogates(ch,  target .charAt(  matchStart+1 ) );
3
                          ch = REUtil.composeFromSurrogates(ch,  target .setIndex(  matchStart+1 ) );
4
                          if (!range.match(ch))  continue;
4
                          if (!range.match(ch))  continue;
5
                      } else {
5
                      } else {
6
                          if (!range.match(ch)) {
6
                          if (!range.match(ch)) {
7
                              char ch1 = Character.toUpperCase((char)ch);
7
                              char ch1 = Character.toUpperCase((char)ch);
8
                              if (!range.match(ch1))
8
                              if (!range.match(ch1))
9
                                  if (!range.match(Character.toLowerCase(ch1)))
9
                                  if (!range.match(Character.toLowerCase(ch1)))
10
                                      continue;
10
                                      continue;
11
                          }
11
                          }
12
                      }
12
                      }
13
                      if (0 <= (matchEnd = this. matchString (con, this.operations,
13
                      if (0 <= (matchEnd = this. matchCharacterIterator (con, this.operations,
14
                                                              matchStart, 1, this.options)))
14
                                                                         matchStart, 1, this.options)))
15
                          break;
15
                          break;
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)1.5
Clones locationClones are declared in the same class
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    67
    int ch = target.charAt(matchStart);
    67
    int ch = target.charAt(matchStart);
    64
    int ch = target.setIndex(matchStart);
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.setIndex(matchStart) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    64
    int ch = target.setIndex(matchStart);
    68
    if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit)
    65
    if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit)
    69
    ch = REUtil.composeFromSurrogates(ch, target.charAt(matchStart + 1));
    69
    ch = REUtil.composeFromSurrogates(ch, target.charAt(matchStart + 1));
    66
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(matchStart + 1));
    Differences
    Expression1Expression2Difference
    charAtsetIndexMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Stringjava.text.CharacterIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression target.charAt(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target.setIndex(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    • Make classes java.lang.String and java.text.CharacterIterator extend a common superclass
    66
    ch = REUtil.composeFromSurrogates(ch, target.setIndex(matchStart + 1));
    70
    if (!range.match(ch))
    67
    if (!range.match(ch))
    71
    continue;
    71
    continue;
    68
    continue;
    Preondition Violations
    Statement continue; without innermost loop
    Statement continue; without innermost loop
    68
    continue;
    else
    else
    72
    if (!range.match(ch))
    69
    if (!range.match(ch))
    73
    char ch1 = Character.toUpperCase((char)ch);
    70
    char ch1 = Character.toUpperCase((char)ch);
    74
    if (!range.match(ch1))
    71
    if (!range.match(ch1))
    75
    if (!range.match(Character.toLowerCase(ch1)))
    72
    if (!range.match(Character.toLowerCase(ch1)))
    76
    continue;
    76
    continue;
    73
    continue;
    Preondition Violations
    Statement continue; without innermost loop
    Statement continue; without innermost loop
    73
    continue;
    77
    if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options)))
    77
    if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options)))
    74
    if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options)))
    Differences
    Expression1Expression2Difference
    matchStringmatchCharacterIteratorMETHOD_INVOCATION_NAME_MISMATCH
    74
    if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options)))
    78
    break;
    78
    break;
    75
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    75
    break;
    Precondition Violations (11)
    Row Violation
    1Expression target.setIndex(matchStart) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    3Expression target.charAt(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression target.setIndex(matchStart + 1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.lang.String of variable target does not match with type java.text.CharacterIterator of variable target
    6Statement continue; without innermost loop
    7Statement continue; without innermost loop
    8Statement continue; without innermost loop
    9Statement continue; without innermost loop
    10Statement break; without innermost loop
    11Statement break; without innermost loop