switch(view.getInputHandler().getLastActionCount()) { case 1: if(recorder != null) recorder.record("textArea.goToEndOfWhiteSpace(" + select + ");"); goToEndOfWhiteSpace(select); break; case 2: if(recorder != null) recorder.record("textArea.goToEndOfLine(" + select + ");"); goToEndOfLine(select); break; default: //case 3: if(recorder != null) recorder.record("textArea.goToLastVisibleLine(" + select + ");"); goToLastVisibleLine(select); break; }
switch(view.getInputHandler().getLastActionCount()) { case 1: if(recorder != null) recorder.record("textArea.goToStartOfWhiteSpace(" + select + ");"); goToStartOfWhiteSpace(select); break; case 2: if(recorder != null) recorder.record("textArea.goToStartOfLine(" + select + ");"); goToStartOfLine(select); break; default: //case 3: if(recorder != null) recorder.record("textArea.goToFirstVisibleLine(" + select + ");"); goToFirstVisibleLine(select); break; }
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 smartEnd(boolean) Method name: void smartHome(boolean)
Number of AST nodes: 16 Number of AST nodes: 16
1
switch(view.getInputHandler().getLastActionCount())
1
switch(view.getInputHandler().getLastActionCount())
2
		{
2
		{
3
		case 1:
3
		case 1:
4
			if(recorder != null)
4
			if(recorder != null)
5
				recorder.record("textArea.goToEndOfWhiteSpace(" + select + ");");
5
				recorder.record("textArea.goToStartOfWhiteSpace(" + select + ");");
6
			goToEndOfWhiteSpace(select);
6
			goToStartOfWhiteSpace(select);
7
			break;
7
			break;
8
		case 2:
8
		case 2:
9
			if(recorder != null)
9
			if(recorder != null)
10
				recorder.record("textArea.goToEndOfLine(" + select + ");");
10
				recorder.record("textArea.goToStartOfLine(" + select + ");");
11
			goToEndOfLine(select);
11
			goToStartOfLine(select);
12
			break;
12
			break;
13
		default: //case 3:
13
		default: //case 3:
14
			if(recorder != null)
14
			if(recorder != null)
15
				recorder.record("textArea.goToLastVisibleLine(" + select + ");");
15
				recorder.record("textArea.goToFirstVisibleLine(" + select + ");");
16
			goToLastVisibleLine(select);
16
			goToFirstVisibleLine(select);
17
			break;
17
			break;
18
		}
18
		}
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.0
Clones locationClones are declared in the same class
Number of node comparisons82
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    switch (view.getInputHandler().getLastActionCount())
    2
    switch (view.getInputHandler().getLastActionCount())
    3
    case 1:
    3
    case 1:
    4
    if (recorder != null)
    4
    if (recorder != null)
    5
    recorder.record("textArea.goToEndOfWhiteSpace(" + select + ");");
    5
    recorder.record("textArea.goToEndOfWhiteSpace(" + select + ");");
    5
    recorder.record("textArea.goToStartOfWhiteSpace(" + select + ");");
    Differences
    Expression1Expression2Difference
    "textArea.goToEndOfWhiteSpace(""textArea.goToStartOfWhiteSpace("LITERAL_VALUE_MISMATCH
    5
    recorder.record("textArea.goToStartOfWhiteSpace(" + select + ");");
    6
    goToEndOfWhiteSpace(select);
    6
    goToEndOfWhiteSpace(select);
    6
    goToStartOfWhiteSpace(select);
    Differences
    Expression1Expression2Difference
    goToEndOfWhiteSpacegoToStartOfWhiteSpaceMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression goToEndOfWhiteSpace(select) is a void method call, and thus it cannot be parameterized
    Expression goToStartOfWhiteSpace(select) is a void method call, and thus it cannot be parameterized
    6
    goToStartOfWhiteSpace(select);
    7
    break;
    7
    break;
    8
    case 2:
    8
    case 2:
    9
    if (recorder != null)
    9
    if (recorder != null)
    10
    recorder.record("textArea.goToEndOfLine(" + select + ");");
    10
    recorder.record("textArea.goToEndOfLine(" + select + ");");
    10
    recorder.record("textArea.goToStartOfLine(" + select + ");");
    Differences
    Expression1Expression2Difference
    "textArea.goToEndOfLine(""textArea.goToStartOfLine("LITERAL_VALUE_MISMATCH
    10
    recorder.record("textArea.goToStartOfLine(" + select + ");");
    11
    goToEndOfLine(select);
    11
    goToEndOfLine(select);
    11
    goToStartOfLine(select);
    Differences
    Expression1Expression2Difference
    goToEndOfLinegoToStartOfLineMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression goToEndOfLine(select) is a void method call, and thus it cannot be parameterized
    Expression goToStartOfLine(select) is a void method call, and thus it cannot be parameterized
    11
    goToStartOfLine(select);
    12
    break;
    12
    break;
    13
    default:
    13
    default:
    14
    if (recorder != null)
    14
    if (recorder != null)
    15
    recorder.record("textArea.goToLastVisibleLine(" + select + ");");
    15
    recorder.record("textArea.goToLastVisibleLine(" + select + ");");
    15
    recorder.record("textArea.goToFirstVisibleLine(" + select + ");");
    Differences
    Expression1Expression2Difference
    "textArea.goToLastVisibleLine(""textArea.goToFirstVisibleLine("LITERAL_VALUE_MISMATCH
    15
    recorder.record("textArea.goToFirstVisibleLine(" + select + ");");
    16
    goToLastVisibleLine(select);
    16
    goToLastVisibleLine(select);
    16
    goToFirstVisibleLine(select);
    Differences
    Expression1Expression2Difference
    goToLastVisibleLinegoToFirstVisibleLineMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression goToLastVisibleLine(select) is a void method call, and thus it cannot be parameterized
    Expression goToFirstVisibleLine(select) is a void method call, and thus it cannot be parameterized
    16
    goToFirstVisibleLine(select);
    17
    break;
    17
    break;
    Precondition Violations (6)
    Row Violation
    1Expression goToEndOfWhiteSpace(select) is a void method call, and thus it cannot be parameterized
    2Expression goToStartOfWhiteSpace(select) is a void method call, and thus it cannot be parameterized
    3Expression goToEndOfLine(select) is a void method call, and thus it cannot be parameterized
    4Expression goToStartOfLine(select) is a void method call, and thus it cannot be parameterized
    5Expression goToLastVisibleLine(select) is a void method call, and thus it cannot be parameterized
    6Expression goToFirstVisibleLine(select) is a void method call, and thus it cannot be parameterized