for (int i = 0; i < maxSize; i++) { if (i != 0) retval += " "; if (tok.kind == 0) { retval += tokenImage[0]; break; } retval += add_escapes(tok.image); tok = tok.next; }
Token tok = currentToken.next; for (int i = 0; i < maxSize; i++) { if (i != 0) retval += " "; if (tok.kind == 0) { retval += tokenImage[0]; break; } retval += add_escapes(tok.image); tok = tok.next; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/ParseException.java File path: /jEdit-4.2/src/bsh/ParseException.java
Method name: String getErrorText() Method name: String getMessage(boolean)
Number of AST nodes: 8 Number of AST nodes: 9
1
Token tok = currentToken.next;
1
for	(int i = 0; i <	maxSize; i++) 
2
    for (int i = 0; i < maxSize; i++) 
2
		{
3
		
3
{
4
  if (i != 0) retval += " ";
4
      if (i != 0) retval += " ";
5
		  if (tok.kind == 0) {
5
      if (tok.kind == 0) {
6
			retval += tokenImage[0];
6
        retval += tokenImage[0];
7
			break;
7
        break;
8
		  }
8
      }
9
		  retval +=	add_escapes(tok.image);
9
      retval += add_escapes(tok.image);
10
		  tok = tok.next;
10
      tok = tok.next; 
11
		}
11
    }
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.5
Clones locationClones are declared in the same class
Number of node comparisons32
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                    
    14
    Token tok = currentToken.next;
    7
    for (int i = 0; i < maxSize; i++)
    15
    for (int i = 0; i < maxSize; i++)
    8
    if (i != 0)
    16
    if (i != 0)
    9
    retval += " ";
    17
    retval += " ";
    10
    if (tok.kind == 0)
    18
    if (tok.kind == 0)
    11
    retval += tokenImage[0];
    19
    retval += tokenImage[0];
    12
    break;
    20
    break;
    13
    retval += add_escapes(tok.image);
    21
    retval += add_escapes(tok.image);
    14
    tok = tok.next;
    22
    tok = tok.next;
    Precondition Violations (0)
    Row Violation