if (domainAxis != null) { double x; if (orient == PlotOrientation.VERTICAL) { x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge()); } else { x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge()); } crosshairState.setAnchorX(x); }
if (rangeAxis != null) { double y; if (orient == PlotOrientation.VERTICAL) { y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge()); } else { y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge()); } crosshairState.setAnchorY(y); }
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 (domainAxis != null) {
1
if (rangeAxis != null) {
2
                double x;
2
                double y;
3
                if (orient == PlotOrientation.VERTICAL) {
3
                if (orient == PlotOrientation.VERTICAL) {
4
                    x = domainAxis.java2DToValue(anchor.getX(), dataArea,
4
                    y = rangeAxis.java2DToValue(anchor.getY(), dataArea,
5
                            getDomainAxisEdge());
5
                            getRangeAxisEdge());
6
                }
6
                }
7
                else {
7
                else {
8
                    x = domainAxis.java2DToValue(anchor.getY(), dataArea,
8
                    y = rangeAxis.java2DToValue(anchor.getX(), dataArea,
9
                            getDomainAxisEdge());
9
                            getRangeAxisEdge());
10
                }
10
                }
11
                crosshairState.setAnchorX(x);
11
                crosshairState.setAnchorY(y);
12
            }
12
            }
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.3
Clones locationClones are in the same method
Number of node comparisons19
  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)47.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    26
    if (domainAxis != null)
    26
    if (domainAxis != null)
    33
    if (rangeAxis != null)
    Differences
    Expression1Expression2Difference
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    33
    if (rangeAxis != null)
    27
    double x;
    27
    double x;
    34
    double y;
    Differences
    Expression1Expression2Difference
    xyVARIABLE_NAME_MISMATCH
    34
    double y;
    28
    if (orient == PlotOrientation.VERTICAL)
    35
    if (orient == PlotOrientation.VERTICAL)
    29
    x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge());
    29
    x = domainAxis.java2DToValue(anchor.getX(), dataArea, getDomainAxisEdge());
    36
    y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    xyVARIABLE_NAME_MISMATCH
    getXgetYMETHOD_INVOCATION_NAME_MISMATCH
    getDomainAxisEdgegetRangeAxisEdgeMETHOD_INVOCATION_NAME_MISMATCH
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    36
    y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());
    else
    else
    30
    x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge());
    30
    x = domainAxis.java2DToValue(anchor.getY(), dataArea, getDomainAxisEdge());
    37
    y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    xyVARIABLE_NAME_MISMATCH
    getYgetXMETHOD_INVOCATION_NAME_MISMATCH
    getDomainAxisEdgegetRangeAxisEdgeMETHOD_INVOCATION_NAME_MISMATCH
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    37
    y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());
    31
    crosshairState.setAnchorX(x);
    31
    crosshairState.setAnchorX(x);
    38
    crosshairState.setAnchorY(y);
    Differences
    Expression1Expression2Difference
    xyVARIABLE_NAME_MISMATCH
    setAnchorXsetAnchorYMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression crosshairState.setAnchorX(x) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression crosshairState.setAnchorY(y) 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.setAnchorY(y) is a void method call, and thus it cannot be parameterized
    38
    crosshairState.setAnchorY(y);
    Precondition Violations (8)
    Row Violation
    1Expression getDomainAxisEdge() 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 getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5Expression crosshairState.setAnchorX(x) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression crosshairState.setAnchorY(y) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression crosshairState.setAnchorX(x) is a void method call, and thus it cannot be parameterized
    8Expression crosshairState.setAnchorY(y) is a void method call, and thus it cannot be parameterized