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