if (!this.domainCrosshairLockedOnData && anchor != null) { double xx; if (orient == PlotOrientation.VERTICAL) { xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge); } else { xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge); } crosshairState.setCrosshairX(xx); }
if (!this.rangeCrosshairLockedOnData && anchor != null) { 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: 6 Number of AST nodes: 6
1
if (!this.domainCrosshairLockedOnData && anchor != null) {
1
if (!this.rangeCrosshairLockedOnData && anchor != null) {
2
            double xx;
2
            double yy;
3
            if (orient == PlotOrientation.VERTICAL) {
3
            if (orient == PlotOrientation.VERTICAL) {
4
                xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);
4
                yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);
5
            }
5
            }
6
            else {
6
 else {
7
                xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);
7
                yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);
8
            }
8
            }
9
            crosshairState.setCrosshairX(xx);
9
            crosshairState.setCrosshairY(yy);
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.4
Clones locationClones are in the same method
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)67.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    108
    if (!this.domainCrosshairLockedOnData && anchor != null)
    108
    if (!this.domainCrosshairLockedOnData && anchor != null)
    123
    if (!this.rangeCrosshairLockedOnData && anchor != null)
    Differences
    Expression1Expression2Difference
    domainCrosshairLockedOnDatarangeCrosshairLockedOnDataVARIABLE_NAME_MISMATCH
    123
    if (!this.rangeCrosshairLockedOnData && anchor != null)
    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
    Preondition Violations
    Expression anchor.getX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression anchor.getY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Preondition Violations
    Expression anchor.getY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression anchor.getX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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 (8)
    Row Violation
    1Expression anchor.getX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression anchor.getY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression anchor.getY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression anchor.getX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression crosshairState.setCrosshairX(xx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression crosshairState.setCrosshairY(yy) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression crosshairState.setCrosshairX(xx) is a void method call, and thus it cannot be parameterized
    8Expression crosshairState.setCrosshairY(yy) is a void method call, and thus it cannot be parameterized