425-2-3

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 (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 (!this.domainCrosshairLockedOnData && anchor != null) {↵

1

    if (rangeAxis != null) {↵

2

                double xx;↵

2

                    double y;↵

3

                if (orient == PlotOrientation.VERTICAL) {↵

3

                    if (orient == PlotOrientation.VERTICAL) {↵

4

                    xx = xAxis.java2DToValue(anchor.getX(), dataArea, x↵

4

                        y = rangeAxis.java2DToValue(anchor.getY(), dataArea,↵

5

    AxisEdge);↵

5

                                getRangeAxisEdge());↵

6

                }↵

6

                    }↵

7

                else {↵

7

                    else {↵

8

                    xx = xAxis.java2DToValue(anchor.getY(), dataArea, x↵

8

                        y = rangeAxis.java2DToValue(anchor.getX(), dataArea,↵

9

    AxisEdge);↵

9

                                getRangeAxisEdge());↵

10

                }↵

10

                    }↵

11

                crosshairState.setCrosshairX(xx);↵

11

                    crosshairState.set↵

12

    AnchorY(y);↵

12

            }

13

                }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are in the same method
Number of node comparisons | 11

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 4
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 3.2
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   109

       double xx;

   109 | double xx;
   34 | double y;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   xx | y | VARIABLE_NAME_MISMATCH

   34

       double y;

   110

       if (orient == PlotOrientation.VERTICAL)

   35

       if (orient == PlotOrientation.VERTICAL)

   111

       xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);

   111 | xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);
   36 | y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   xx | y | VARIABLE_NAME_MISMATCH
   getX | getY | METHOD_INVOCATION_NAME_MISMATCH
   xAxisEdge | getRangeAxisEdge() | TYPE_COMPATIBLE_REPLACEMENT
   xAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   36

       y = rangeAxis.java2DToValue(anchor.getY(), dataArea, getRangeAxisEdge());

       else

       else

   112

       xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);

   112 | xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);
   37 | y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   xx | y | VARIABLE_NAME_MISMATCH
   getY | getX | METHOD_INVOCATION_NAME_MISMATCH
   xAxisEdge | getRangeAxisEdge() | TYPE_COMPATIBLE_REPLACEMENT
   xAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   37

       y = rangeAxis.java2DToValue(anchor.getX(), dataArea, getRangeAxisEdge());

   Precondition Violations (0)
   Row | Violation
   --- | ---