double y; if (orient == PlotOrientation.VERTICAL) { y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge()); } else { y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge()); } crosshairState.setAnchorY(y);
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 y;
1
double yy;
2
                if (orient == PlotOrientation.VERTICAL) {
2
            if (orient == PlotOrientation.VERTICAL) {
3
                    y = rangeAxis.java2DToValue(anchor.getY(), dataArea,
3
                yy = yAxis.java2DToValue(anchor.getY(), dataArea,
4
                            getRangeAxisEdge());
4
 yAxisEdge);
5
                }
5
            
6
                else {
6
} else {
7
                    y = rangeAxis.java2DToValue(anchor.getX(), dataArea,
7
                yy = yAxis.java2DToValue(anchor.getX(), dataArea,
8
                            getRangeAxisEdge());
8
 yAxisEdge);
9
                }
9
            }
10
                crosshairState.setAnchorY(y);
10
            crosshairState.setCrosshairY(yy);
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.4
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)32.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    34
    double y;
    34
    double y;
    124
    double yy;
    Differences
    Expression1Expression2Difference
    yyyVARIABLE_NAME_MISMATCH
    124
    double yy;
    35
    if (orient == PlotOrientation.VERTICAL)
    125
    if (orient == PlotOrientation.VERTICAL)
    36
    y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());
    36
    y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());
    126
    yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);
    Differences
    Expression1Expression2Difference
    yyyVARIABLE_NAME_MISMATCH
    getRangeAxisEdge()yAxisEdgeTYPE_COMPATIBLE_REPLACEMENT
    rangeAxisyAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    126
    yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);
    else
    else
    37
    y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());
    37
    y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());
    127
    yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);
    Differences
    Expression1Expression2Difference
    yyyVARIABLE_NAME_MISMATCH
    getRangeAxisEdge()yAxisEdgeTYPE_COMPATIBLE_REPLACEMENT
    rangeAxisyAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    127
    yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);
    38
    crosshairState.setAnchorY(y);
    38
    crosshairState.setAnchorY(y);
    128
    crosshairState.setCrosshairY(yy);
    Differences
    Expression1Expression2Difference
    yyyVARIABLE_NAME_MISMATCH
    setAnchorYsetCrosshairYMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression crosshairState.setAnchorY(y) 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.setAnchorY(y) 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 (6)
    Row Violation
    1Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression crosshairState.setAnchorY(y) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression crosshairState.setCrosshairY(yy) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression crosshairState.setAnchorY(y) is a void method call, and thus it cannot be parameterized
    6Expression crosshairState.setCrosshairY(yy) is a void method call, and thus it cannot be parameterized