1174-2-4

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);

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) | 3.3
   Clone type | Type 2

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

   34

       double y;

   34 | double y;
   124 | double yy;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   y | yy | VARIABLE_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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   y | yy | VARIABLE_NAME_MISMATCH
   getRangeAxisEdge() | yAxisEdge | TYPE_COMPATIBLE_REPLACEMENT
   rangeAxis | yAxis | VARIABLE_NAME_MISMATCH

   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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   y | yy | VARIABLE_NAME_MISMATCH
   getRangeAxisEdge() | yAxisEdge | TYPE_COMPATIBLE_REPLACEMENT
   rangeAxis | yAxis | VARIABLE_NAME_MISMATCH

   127

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

   38

       crosshairState.setAnchorY(y);

   38 | crosshairState.setAnchorY(y);
   128 | crosshairState.setCrosshairY(yy);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   setAnchorY | setCrosshairY | METHOD_INVOCATION_NAME_MISMATCH
   y | yy | VARIABLE_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 (4)
   Row | Violation
   --- | ---
   1 | Expression crosshairState.setAnchorY(y) 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.setAnchorY(y) 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