int line = displayManager.getNextVisibleLine(caretLine); if(line == -1) { getToolkit().beep(); return; } else newCaret = getLineStartOffset(line);
int line = displayManager.getPrevVisibleLine(caretLine); if(line == -1) { getToolkit().beep(); return; } newCaret = getLineEndOffset(line) - 1;
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 goToNextCharacter(boolean) Method name: void goToPrevCharacter(boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
int line = displayManager.getNextVisibleLine(caretLine);
1
int line = displayManager.getPrevVisibleLine(caretLine);
2
				if(line == -1)
2
			if(line == -1)
3
				{
3
			{
4
					getToolkit().beep();
4
				getToolkit().beep();
5
					return;
5
				return;
6
				}
6
			}
7
				else
7
			
8
					newCaret = getLineStartOffset(line);
8
newCaret = getLineEndOffset(line) - 1;
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.2
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    28
    int line = displayManager.getNextVisibleLine(caretLine);
    28
    int line = displayManager.getNextVisibleLine(caretLine);
    25
    int line = displayManager.getPrevVisibleLine(caretLine);
    Differences
    Expression1Expression2Difference
    getNextVisibleLinegetPrevVisibleLineMETHOD_INVOCATION_NAME_MISMATCH
    25
    int line = displayManager.getPrevVisibleLine(caretLine);
    29
    if (line == -1)
    26
    if (line == -1)
    30
    getToolkit().beep();
    27
    getToolkit().beep();
    31
    return;
    31
    return;
    28
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    28
    return;
    else
            
    32
    newCaret = getLineStartOffset(line);
    32
    newCaret = getLineStartOffset(line);
    Preondition Violations
    Unmatched statement newCaret=getLineStartOffset(line); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                
                                                                                    
    29
    newCaret = getLineEndOffset(line) - 1;
    Precondition Violations (3)
    Row Violation
    1Conditional return;
    2Conditional return;
    3Unmatched statement newCaret=getLineStartOffset(line); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted