double xx; if (orient == PlotOrientation.VERTICAL) { xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge); } else { xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge); } crosshairState.setCrosshairX(xx);
double yy; if (orient == PlotOrientation.VERTICAL) { yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge); } else { yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge); } crosshairState.setCrosshairY(yy);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo) Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)
Number of AST nodes: 5 Number of AST nodes: 5
1
double xx;
1
double yy;
2
            if (orient == PlotOrientation.VERTICAL) {
2
            if (orient == PlotOrientation.VERTICAL) {
3
                xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);
3
                yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);
4
            }
4
            }
5
            else {
5
 else {
6
                xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);
6
                yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);
7
            }
7
            }
8
            crosshairState.setCrosshairX(xx);
8
            crosshairState.setCrosshairY(yy);
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.4
Clones locationClones are in the same method
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)70.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    109
    double xx;
    109
    double xx;
    124
    double yy;
    Differences
    Expression1Expression2Difference
    xxyyVARIABLE_NAME_MISMATCH
    124
    double yy;
    110
    if (orient == PlotOrientation.VERTICAL)
    125
    if (orient == PlotOrientation.VERTICAL)
    111
    xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);
    111
    xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);
    126
    yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);
    Differences
    Expression1Expression2Difference
    xxyyVARIABLE_NAME_MISMATCH
    getXgetYMETHOD_INVOCATION_NAME_MISMATCH
    xAxisEdgeyAxisEdgeVARIABLE_NAME_MISMATCH
    xAxisyAxisVARIABLE_NAME_MISMATCH
    126
    yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);
    else
    else
    112
    xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);
    112
    xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);
    127
    yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);
    Differences
    Expression1Expression2Difference
    xxyyVARIABLE_NAME_MISMATCH
    getYgetXMETHOD_INVOCATION_NAME_MISMATCH
    xAxisEdgeyAxisEdgeVARIABLE_NAME_MISMATCH
    xAxisyAxisVARIABLE_NAME_MISMATCH
    127
    yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);
    113
    crosshairState.setCrosshairX(xx);
    113
    crosshairState.setCrosshairX(xx);
    128
    crosshairState.setCrosshairY(yy);
    Differences
    Expression1Expression2Difference
    xxyyVARIABLE_NAME_MISMATCH
    setCrosshairXsetCrosshairYMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression crosshairState.setCrosshairX(xx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression crosshairState.setCrosshairY(yy) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression crosshairState.setCrosshairX(xx) is a void method call, and thus it cannot be parameterized
    Expression crosshairState.setCrosshairY(yy) is a void method call, and thus it cannot be parameterized
    128
    crosshairState.setCrosshairY(yy);
    Precondition Violations (4)
    Row Violation
    1Expression crosshairState.setCrosshairX(xx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression crosshairState.setCrosshairY(yy) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression crosshairState.setCrosshairX(xx) is a void method call, and thus it cannot be parameterized
    4Expression crosshairState.setCrosshairY(yy) is a void method call, and thus it cannot be parameterized