if (command.equals(ZOOM_OUT_RANGE_COMMAND)) { zoomOutRange(screenX, screenY); } else if (command.equals(ZOOM_RESET_BOTH_COMMAND)) { restoreAutoBounds(); } else if (command.equals(ZOOM_RESET_DOMAIN_COMMAND)) { restoreAutoDomainBounds(); } else if (command.equals(ZOOM_RESET_RANGE_COMMAND)) { restoreAutoRangeBounds(); }
if (command.equals(ZOOM_OUT_RANGE_COMMAND)) { zoomOutRange(e.x, e.y); } else if (command.equals(ZOOM_RESET_BOTH_COMMAND)) { restoreAutoBounds(); } else if (command.equals(ZOOM_RESET_DOMAIN_COMMAND)) { restoreAutoDomainBounds(); } else if (command.equals(ZOOM_RESET_RANGE_COMMAND)) { restoreAutoRangeBounds(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/ChartComposite.java
Method name: void actionPerformed(ActionEvent) Method name: void widgetSelected(SelectionEvent)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (command.equals(ZOOM_OUT_RANGE_COMMAND)) {
1
if (command.equals(ZOOM_OUT_RANGE_COMMAND)) {
2
            zoomOutRange(screenX, screenY);
2
            zoomOutRange(e.x, e.y);
3
        }
3
        }
4
        else if (command.equals(ZOOM_RESET_BOTH_COMMAND)) {
4
        else if (command.equals(ZOOM_RESET_BOTH_COMMAND)) {
5
            restoreAutoBounds();
5
            restoreAutoBounds();
6
        }
6
        }
7
        else if (command.equals(ZOOM_RESET_DOMAIN_COMMAND)) {
7
        else if (command.equals(ZOOM_RESET_DOMAIN_COMMAND)) {
8
            restoreAutoDomainBounds();
8
            restoreAutoDomainBounds();
9
        }
9
        }
10
        else if (command.equals(ZOOM_RESET_RANGE_COMMAND)) {
10
        else if (command.equals(ZOOM_RESET_RANGE_COMMAND)) {
11
            restoreAutoRangeBounds();
11
            restoreAutoRangeBounds();
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.3
Clones locationClones are in different classes
Number of node comparisons46
  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)7.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    24
    else if (command.equals(ZOOM_OUT_RANGE_COMMAND))
    24
    else if (command.equals(ZOOM_OUT_RANGE_COMMAND))
    21
    else if (command.equals(ZOOM_RESET_BOTH_COMMAND))
    Differences
    Expression1Expression2Difference
    ZOOM_OUT_RANGE_COMMANDZOOM_RESET_BOTH_COMMANDVARIABLE_NAME_MISMATCH
    21
    else if (command.equals(ZOOM_RESET_BOTH_COMMAND))
    25
    zoomOutRange(screenX, screenY);
    25
    zoomOutRange(screenX, screenY);
    22
    restoreAutoBounds();
    Differences
    Expression1Expression2Difference
    zoomOutRangerestoreAutoBoundsMETHOD_INVOCATION_NAME_MISMATCH
    zoomOutRange(screenX,screenY)restoreAutoBounds()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression zoomOutRange(screenX,screenY) is a void method call, and thus it cannot be parameterized
    Expression restoreAutoBounds() is a void method call, and thus it cannot be parameterized
    Expression zoomOutRange(screenX,screenY) is a void method call, and thus it cannot be parameterized
    Expression restoreAutoBounds() is a void method call, and thus it cannot be parameterized
    22
    restoreAutoBounds();
    26
    else if (command.equals(ZOOM_RESET_BOTH_COMMAND))
    26
    else if (command.equals(ZOOM_RESET_BOTH_COMMAND))
    25
    else if (command.equals(ZOOM_RESET_RANGE_COMMAND))
    Differences
    Expression1Expression2Difference
    ZOOM_RESET_BOTH_COMMANDZOOM_RESET_RANGE_COMMANDVARIABLE_NAME_MISMATCH
    25
    else if (command.equals(ZOOM_RESET_RANGE_COMMAND))
    27
    restoreAutoBounds();
    27
    restoreAutoBounds();
    26
    restoreAutoRangeBounds();
    Differences
    Expression1Expression2Difference
    restoreAutoBoundsrestoreAutoRangeBoundsMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression restoreAutoBounds() is a void method call, and thus it cannot be parameterized
    Expression restoreAutoRangeBounds() is a void method call, and thus it cannot be parameterized
    26
    restoreAutoRangeBounds();
    28
    else if (command.equals(ZOOM_RESET_DOMAIN_COMMAND))
    23
    else if (command.equals(ZOOM_RESET_DOMAIN_COMMAND))
    29
    restoreAutoDomainBounds();
    24
    restoreAutoDomainBounds();
    30
    else if (command.equals(ZOOM_RESET_RANGE_COMMAND))
    30
    else if (command.equals(ZOOM_RESET_RANGE_COMMAND))
    19
    else if (command.equals(ZOOM_OUT_RANGE_COMMAND))
    Differences
    Expression1Expression2Difference
    ZOOM_RESET_RANGE_COMMANDZOOM_OUT_RANGE_COMMANDVARIABLE_NAME_MISMATCH
    19
    else if (command.equals(ZOOM_OUT_RANGE_COMMAND))
    31
    restoreAutoRangeBounds();
    31
    restoreAutoRangeBounds();
    20
    zoomOutRange(e.x, e.y);
    Differences
    Expression1Expression2Difference
    restoreAutoRangeBoundszoomOutRangeMETHOD_INVOCATION_NAME_MISMATCH
    restoreAutoRangeBounds()zoomOutRange(e.x,e.y)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression restoreAutoRangeBounds() is a void method call, and thus it cannot be parameterized
    Expression zoomOutRange(e.x,e.y) is a void method call, and thus it cannot be parameterized
    Expression restoreAutoRangeBounds() is a void method call, and thus it cannot be parameterized
    Expression zoomOutRange(e.x,e.y) is a void method call, and thus it cannot be parameterized
    20
    zoomOutRange(e.x, e.y);
    Precondition Violations (11)
    Row Violation
    1Expression zoomOutRange(screenX,screenY) is a void method call, and thus it cannot be parameterized
    2Expression restoreAutoBounds() is a void method call, and thus it cannot be parameterized
    3Expression zoomOutRange(screenX,screenY) is a void method call, and thus it cannot be parameterized
    4Expression restoreAutoBounds() is a void method call, and thus it cannot be parameterized
    5Expression restoreAutoBounds() is a void method call, and thus it cannot be parameterized
    6Expression restoreAutoRangeBounds() is a void method call, and thus it cannot be parameterized
    7Expression restoreAutoRangeBounds() is a void method call, and thus it cannot be parameterized
    8Expression zoomOutRange(e.x,e.y) is a void method call, and thus it cannot be parameterized
    9Expression restoreAutoRangeBounds() is a void method call, and thus it cannot be parameterized
    10Expression zoomOutRange(e.x,e.y) is a void method call, and thus it cannot be parameterized
    11The refactoring of the clones is infeasible, because classes org.jfree.chart.ChartPanel and org.jfree.experimental.chart.swt.ChartComposite do not have a common superclass