if(!displayManager.isLineVisible(i)) continue; getLineText(i,lineSegment); for(int j = 0; j < lineSegment.count; j++) { switch(lineSegment.array[lineSegment.offset + j]) { case ' ': case '\t': break; default: if(foundBlank) { newCaret = getLineEndOffset(i) - 1; break loop; } else continue loop; } } foundBlank = true;
if(!displayManager.isLineVisible(i)) continue; getLineText(i,lineSegment); for(int j = 0; j < lineSegment.count; j++) { switch(lineSegment.array[lineSegment.offset + j]) { case ' ': case '\t': break; default: if(foundBlank) { newCaret = getLineStartOffset(i); break loop; } else continue loop; } } foundBlank = true;
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 goToPrevParagraph(boolean) Method name: void goToNextParagraph(boolean)
Number of AST nodes: 14 Number of AST nodes: 14
1
if(!displayManager.isLineVisible(i))
1
if(!displayManager.isLineVisible(i))
2
				continue;
2
				continue;
3
			getLineText(i,lineSegment);
3
			getLineText(i,lineSegment);
4
			for(int j = 0; j < lineSegment.count; j++)
4
			for(int j = 0; j < lineSegment.count; j++)
5
			{
5
			{
6
				switch(lineSegment.array[lineSegment.offset + j])
6
				switch(lineSegment.array[lineSegment.offset + j])
7
				{
7
				{
8
				case ' ':
8
				case ' ':
9
				case '\t':
9
				case '\t':
10
					break;
10
					break;
11
				default:
11
				default:
12
					if(foundBlank)
12
					if(foundBlank)
13
					{
13
					{
14
						newCaret = getLineEndOffset(i) - 1;
14
						newCaret = getLineStartOffset(i);
15
						break loop;
15
						break loop;
16
					}
16
					}
17
					else
17
					else
18
						continue loop;
18
						continue loop;
19
				}
19
				}
20
			}
20
			}
21
			foundBlank = true;
21
			foundBlank = true;
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.8
Clones locationClones are declared in the same class
Number of node comparisons40
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)45.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (!displayManager.isLineVisible(i))
    5
    if (!displayManager.isLineVisible(i))
    6
    continue;
    6
    continue;
    6
    continue;
    Preondition Violations
    Statement continue; without innermost loop
    Statement continue; without innermost loop
    6
    continue;
    7
    getLineText(i, lineSegment);
    7
    getLineText(i, lineSegment);
    8
    for (int j = 0; j < lineSegment.count; j++)
    8
    for (int j = 0; j < lineSegment.count; j++)
    9
    switch (lineSegment.array[lineSegment.offset + j])
    9
    switch (lineSegment.array[lineSegment.offset + j])
    10
    case ' ':
    10
    case ' ':
    11
    case '\t':
    11
    case '\t':
    12
    break;
    12
    break;
    13
    default:
    13
    default:
    14
    if (foundBlank)
    14
    if (foundBlank)
    15
    newCaret = getLineEndOffset(i) - 1;
    15
    newCaret = getLineEndOffset(i) - 1;
    15
    newCaret = getLineStartOffset(i);
    Differences
    Expression1Expression2Difference
    getLineEndOffset(i) - 1getLineStartOffset(i)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression getLineEndOffset(i) - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getLineStartOffset(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15
    newCaret = getLineStartOffset(i);
    16
    break loop;
    16
    break loop;
    16
    break loop;
    Preondition Violations
    Statement break loop; without innermost loop
    Statement break loop; without innermost loop
    16
    break loop;
    else
    else
    17
    continue loop;
    17
    continue loop;
    17
    continue loop;
    Preondition Violations
    Statement continue loop; without innermost loop
    Statement continue loop; without innermost loop
    17
    continue loop;
    18
    foundBlank = true;
    18
    foundBlank = true;
    Precondition Violations (9)
    Row Violation
    1Statement continue; without innermost loop
    2Statement continue; without innermost loop
    3Expression getLineEndOffset(i) - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression getLineStartOffset(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Statement break loop; without innermost loop
    6Statement break loop; without innermost loop
    7Statement continue loop; without innermost loop
    8Statement continue loop; without innermost loop
    9Clone fragment #1 returns variables newCaret, foundBlank , while Clone fragment #2 returns variables newCaret, foundBlank