String command = event.getActionCommand(); if (command.equals("SelectLabelFont")) { attemptLabelFontSelection(); } else if (command.equals("SelectLabelPaint")) { attemptModifyLabelPaint(); } else if (command.equals("SelectTickLabelFont")) { attemptTickLabelFontSelection(); }
String command = event.getActionCommand(); if (command.equals("SelectFont")) { attemptFontSelection(); } else if (command.equals("SelectPaint")) { attemptPaintSelection(); } else if (command.equals("ShowTitle")) { attemptModifyShowTitle(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultAxisEditor.java File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultTitleEditor.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 7 Number of AST nodes: 7
1
String command = event.getActionCommand();
1
String command = event.getActionCommand();
2
        if (command.equals("SelectLabelFont")) {
2
        if (command.equals("SelectFont")) {
3
            attemptLabelFontSelection();
3
            attemptFontSelection();
4
        }
4
        }
5
        else if (command.equals("SelectLabelPaint")) {
5
        else if (command.equals("SelectPaint")) {
6
            attemptModifyLabelPaint();
6
            attemptPaintSelection();
7
        }
7
        }
8
        else if (command.equals("SelectTickLabelFont")) {
8
        else if (command.equals("ShowTitle")) {
9
            attemptTickLabelFontSelection();
9
            attemptModifyShowTitle();
10
        }
10
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes having the same super class
Number of node comparisons28
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    String command = event.getActionCommand();
    1
    String command = event.getActionCommand();
    2
    if (command.equals("SelectLabelFont"))
    2
    if (command.equals("SelectLabelFont"))
    2
    if (command.equals("SelectFont"))
    Differences
    Expression1Expression2Difference
    "SelectLabelFont""SelectFont"LITERAL_VALUE_MISMATCH
    2
    if (command.equals("SelectFont"))
    3
    attemptLabelFontSelection();
    3
    attemptLabelFontSelection();
    3
    attemptFontSelection();
    Differences
    Expression1Expression2Difference
    attemptLabelFontSelectionattemptFontSelectionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression attemptLabelFontSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method attemptLabelFontSelection
    Expression attemptFontSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression attemptLabelFontSelection() is a void method call, and thus it cannot be parameterized
    Expression attemptFontSelection() is a void method call, and thus it cannot be parameterized
    3
    attemptFontSelection();
    4
    else if (command.equals("SelectLabelPaint"))
    4
    else if (command.equals("SelectLabelPaint"))
    6
    else if (command.equals("ShowTitle"))
    Differences
    Expression1Expression2Difference
    "SelectLabelPaint""ShowTitle"LITERAL_VALUE_MISMATCH
    6
    else if (command.equals("ShowTitle"))
    5
    attemptModifyLabelPaint();
    5
    attemptModifyLabelPaint();
    7
    attemptModifyShowTitle();
    Differences
    Expression1Expression2Difference
    attemptModifyLabelPaintattemptModifyShowTitleMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression attemptModifyLabelPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method attemptModifyLabelPaint
    Expression attemptModifyShowTitle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method attemptModifyShowTitle
    Expression attemptModifyLabelPaint() is a void method call, and thus it cannot be parameterized
    Expression attemptModifyShowTitle() is a void method call, and thus it cannot be parameterized
    7
    attemptModifyShowTitle();
    6
    else if (command.equals("SelectTickLabelFont"))
    6
    else if (command.equals("SelectTickLabelFont"))
    4
    else if (command.equals("SelectPaint"))
    Differences
    Expression1Expression2Difference
    "SelectTickLabelFont""SelectPaint"LITERAL_VALUE_MISMATCH
    4
    else if (command.equals("SelectPaint"))
    7
    attemptTickLabelFontSelection();
    7
    attemptTickLabelFontSelection();
    5
    attemptPaintSelection();
    Differences
    Expression1Expression2Difference
    attemptTickLabelFontSelectionattemptPaintSelectionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression attemptTickLabelFontSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression attemptPaintSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression attemptTickLabelFontSelection() is a void method call, and thus it cannot be parameterized
    Expression attemptPaintSelection() is a void method call, and thus it cannot be parameterized
    5
    attemptPaintSelection();
    Precondition Violations (12)
    Row Violation
    1Expression attemptLabelFontSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression attemptFontSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression attemptLabelFontSelection() is a void method call, and thus it cannot be parameterized
    4Expression attemptFontSelection() is a void method call, and thus it cannot be parameterized
    5Expression attemptModifyLabelPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression attemptModifyShowTitle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression attemptModifyLabelPaint() is a void method call, and thus it cannot be parameterized
    8Expression attemptModifyShowTitle() is a void method call, and thus it cannot be parameterized
    9Expression attemptTickLabelFontSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression attemptPaintSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression attemptTickLabelFontSelection() is a void method call, and thus it cannot be parameterized
    12Expression attemptPaintSelection() is a void method call, and thus it cannot be parameterized