1174-3-4

double xx; if (orient == PlotOrientation.VERTICAL) { xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge); } else { xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge); } crosshairState.setCrosshairX(xx);
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 xx;↵

1

    double yy;↵

2

                if (orient == PlotOrientation.VERTICAL) {↵

2

                if (orient == PlotOrientation.VERTICAL) {↵

3

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

3

                    yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);↵

4

                }↵

4

                }↵

5

                else {↵

5

     else {↵

6

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

6

                    yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);↵

7

                }↵

7

                }↵

8

                crosshairState.setCrosshairX(xx);

8

                crosshairState.setCrosshairY(yy);

See real code fragment |  | See real code fragment

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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) | 11.5
   Clone type | Type 2

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

   109

       double xx;

   109 | double xx;
   124 | double yy;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   xx | yy | VARIABLE_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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   xx | yy | VARIABLE_NAME_MISMATCH
   getX | getY | METHOD_INVOCATION_NAME_MISMATCH
   xAxisEdge | yAxisEdge | VARIABLE_NAME_MISMATCH
   xAxis | yAxis | VARIABLE_NAME_MISMATCH

   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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   xx | yy | VARIABLE_NAME_MISMATCH
   getY | getX | METHOD_INVOCATION_NAME_MISMATCH
   xAxisEdge | yAxisEdge | VARIABLE_NAME_MISMATCH
   xAxis | yAxis | VARIABLE_NAME_MISMATCH

   127

       yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);

   113

       crosshairState.setCrosshairX(xx);

   113 | crosshairState.setCrosshairX(xx);
   128 | crosshairState.setCrosshairY(yy);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setCrosshairX | setCrosshairY | METHOD_INVOCATION_NAME_MISMATCH
   xx | yy | VARIABLE_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 (4)
   Row | Violation
   --- | ---
   1 | Expression crosshairState.setCrosshairX(xx) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression crosshairState.setCrosshairY(yy) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression crosshairState.setCrosshairX(xx) is a void method call, and thus it cannot be parameterized
   4 | Expression crosshairState.setCrosshairY(yy) is a void method call, and thus it cannot be parameterized