double x; if (orient == PlotOrientation.VERTICAL) { x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge()); } else { x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge()); } crosshairState.setAnchorX(x);
double xx; if (orient == PlotOrientation.VERTICAL) { xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge); } else { xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge); } crosshairState.setCrosshairX(xx);
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 x;
1
double xx;
2
                if (orient == PlotOrientation.VERTICAL) {
2
            if (orient == PlotOrientation.VERTICAL) {
3
                    x = domainAxis.java2DToValue(anchor.getX(), dataArea,
3
                xx = xAxis.java2DToValue(anchor.getX(), dataArea,
4
                            getDomainAxisEdge());
4
 xAxisEdge);
5
                }
5
            }
6
                else {
6
            else {
7
                    x = domainAxis.java2DToValue(anchor.getY(), dataArea,
7
                xx = xAxis.java2DToValue(anchor.getY(), dataArea,
8
                            getDomainAxisEdge());
8
 xAxisEdge);
9
                }
9
            }
10
                crosshairState.setAnchorX(x);
10
            crosshairState.setCrosshairX(xx);
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)0.3
Clones locationClones are in the same method
Number of node comparisons14
  1. {Non-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)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    double x;
    27
    double x;
    109
    double xx;
    Differences
    Expression1Expression2Difference
    xxxVARIABLE_NAME_MISMATCH
    109
    double xx;
    28
    if (orient == PlotOrientation.VERTICAL)
    110
    if (orient == PlotOrientation.VERTICAL)
    29
    x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge());
    29
    x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge());
    111
    xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);
    Differences
    Expression1Expression2Difference
    xxxVARIABLE_NAME_MISMATCH
    getDomainAxisEdge()xAxisEdgeTYPE_COMPATIBLE_REPLACEMENT
    domainAxisxAxisVARIABLE_NAME_MISMATCH
    111
    xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);
    else
    else
    30
    x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge());
    30
    x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge());
    112
    xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);
    Differences
    Expression1Expression2Difference
    xxxVARIABLE_NAME_MISMATCH
    getDomainAxisEdge()xAxisEdgeTYPE_COMPATIBLE_REPLACEMENT
    domainAxisxAxisVARIABLE_NAME_MISMATCH
    112
    xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);
    31
    crosshairState.setAnchorX(x);
    31
    crosshairState.setAnchorX(x);
    113
    crosshairState.setCrosshairX(xx);
    Differences
    Expression1Expression2Difference
    setAnchorXsetCrosshairXMETHOD_INVOCATION_NAME_MISMATCH
    xxxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression crosshairState.setAnchorX(x) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression crosshairState.setCrosshairX(xx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression crosshairState.setAnchorX(x) is a void method call, and thus it cannot be parameterized
    Expression crosshairState.setCrosshairX(xx) is a void method call, and thus it cannot be parameterized
    113
    crosshairState.setCrosshairX(xx);
    Precondition Violations (4)
    Row Violation
    1Expression crosshairState.setAnchorX(x) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression crosshairState.setCrosshairX(xx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression crosshairState.setAnchorX(x) is a void method call, and thus it cannot be parameterized
    4Expression crosshairState.setCrosshairX(xx) is a void method call, and thus it cannot be parameterized