if(historyModel == null) return; if(getSelectionEnd() != getDocument().getLength()) { setCaretPosition(getDocument().getLength()); } String text = getText().substring(0,getSelectionStart()); if(text == null) { historyPrevious(); return; }
if(historyModel == null) return; if(getSelectionEnd() != getDocument().getLength()) { setCaretPosition(getDocument().getLength()); } String text = getText().substring(0,getSelectionStart()); if(text == null) { historyNext(); return; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java
Method name: void doBackwardSearch() Method name: void doForwardSearch()
Number of AST nodes: 8 Number of AST nodes: 8
1
if(historyModel == null)
1
if(historyModel == null)
2
			return;
2
			return;
3
		if(getSelectionEnd() != getDocument().getLength())
3
		if(getSelectionEnd() != getDocument().getLength())
4
		{
4
		{
5
			setCaretPosition(getDocument().getLength());
5
			setCaretPosition(getDocument().getLength());
6
		}
6
		}
7
		String text = getText().substring(0,getSelectionStart());
7
		String text = getText().substring(0,getSelectionStart());
8
		if(text == null)
8
		if(text == null)
9
		{
9
		{
10
			historyPrevious();
10
			historyNext();
11
			return;
11
			return;
12
		}
12
		}
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.2
Clones locationClones are declared in the same class
Number of node comparisons38
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (historyModel == null)
    1
    if (historyModel == null)
    2
    return;
    2
    return;
    2
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    2
    return;
    3
    if (getSelectionEnd() != getDocument().getLength())
    3
    if (getSelectionEnd() != getDocument().getLength())
    4
    setCaretPosition(getDocument().getLength());
    4
    setCaretPosition(getDocument().getLength());
    5
    String text = getText().substring(0, getSelectionStart());
    5
    String text = getText().substring(0, getSelectionStart());
    6
    if (text == null)
    6
    if (text == null)
    7
    historyPrevious();
    7
    historyPrevious();
    7
    historyNext();
    Differences
    Expression1Expression2Difference
    historyPrevioushistoryNextMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression historyPrevious() is a void method call, and thus it cannot be parameterized
    Expression historyNext() is a void method call, and thus it cannot be parameterized
    7
    historyNext();
    8
    return;
    8
    return;
    8
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    8
    return;
    Precondition Violations (6)
    Row Violation
    1Conditional return;
    2Conditional return;
    3Expression historyPrevious() is a void method call, and thus it cannot be parameterized
    4Expression historyNext() is a void method call, and thus it cannot be parameterized
    5Conditional return;
    6Conditional return;