getLineText(i,lineSegment); for(int j = 0; j < lineSegment.count; j++) { switch(lineSegment.array[lineSegment.offset + j]) { case ' ': case '\t': break; default: continue loop; } } start = getLineEndOffset(i);
getLineText(i,lineSegment); for(int j = 0; j < lineSegment.count; j++) { switch(lineSegment.array[lineSegment.offset + j]) { case ' ': case '\t': break; default: continue loop; } }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
Method name: void formatParagraph() Method name: void formatParagraph()
Number of AST nodes: 9 Number of AST nodes: 8
1
getLineText(i,lineSegment);
1
getLineText(i,lineSegment);
2
				for(int j = 0; j < lineSegment.count; j++)
2
				for(int j = 0; j < lineSegment.count; j++)
3
				{
3
				{
4
					switch(lineSegment.array[lineSegment.offset + j])
4
					switch(lineSegment.array[lineSegment.offset + j])
5
					{
5
					{
6
					case ' ':
6
					case ' ':
7
					case '\t':
7
					case '\t':
8
						break;
8
						break;
9
					default:
9
					default:
10
						continue loop;
10
						continue loop;
11
					}
11
					}
12
				}
12
				}
13
				start = getLineEndOffset(i);
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 in the same method
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    17
    getLineText(i, lineSegment);
    28
    getLineText(i, lineSegment);
    18
    for (int j = 0; j < lineSegment.count; j++)
    29
    for (int j = 0; j < lineSegment.count; j++)
    19
    switch (lineSegment.array[lineSegment.offset + j])
    30
    switch (lineSegment.array[lineSegment.offset + j])
    20
    case ' ':
    31
    case ' ':
    21
    case '\t':
    32
    case '\t':
    22
    break;
    33
    break;
    23
    default:
    34
    default:
    24
    continue loop;
    24
    continue loop;
    35
    continue loop;
    Preondition Violations
    Statement continue loop; without innermost loop
    Statement continue loop; without innermost loop
    35
    continue loop;
    25
    start = getLineEndOffset(i);
    25
    start = getLineEndOffset(i);
    Preondition Violations
    Unmatched statement start=getLineEndOffset(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
    Precondition Violations (3)
    Row Violation
    1Statement continue loop; without innermost loop
    2Statement continue loop; without innermost loop
    3Unmatched statement start=getLineEndOffset(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted