1035-1-3

if (orientation == PlotOrientation.HORIZONTAL) { double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM); line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY()); } else { double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy); }
if (orientation == PlotOrientation.HORIZONTAL) { double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM); line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY()); } else { double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: `void drawRangeCrosshair(Graphics2D, Rectangle2D, PlotOrientation, double, ValueAxis, Stroke, Paint)` |  | Method name: `void drawRangeCrosshair(Graphics2D, Rectangle2D, PlotOrientation, double, ValueAxis, Stroke, Paint)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

2

                double xx = axis.valueToJava2D(value, dataArea,↵

2

                    double xx = axis.valueToJava2D(value, dataArea,↵

3

                        RectangleEdge.BOTTOM);↵

3

                            RectangleEdge.BOTTOM);↵

4

                line = new Line2D.Double(xx, dataArea.getMinY(), xx,↵

4

                    line = new Line2D.Double(xx, dataArea.getMinY(), xx,↵

5

                        dataArea.getMaxY());↵

5

                            dataArea.getMaxY());↵

6

            }↵

6

                }↵

7

            else {↵

7

                else {↵

8

                double yy = axis.valueToJava2D(value, dataArea,↵

8

                    double yy = axis.valueToJava2D(value, dataArea,↵

9

                        RectangleEdge.LEFT);↵

9

                            RectangleEdge.LEFT);↵

10

                line = new Line2D.Double(dataArea.getMinX(), yy,↵

10

                    line = new Line2D.Double(dataArea.getMinX(), yy,↵

11

                        dataArea.getMaxX(), yy);↵

11

                            dataArea.getMaxX(), yy);↵

12

            }

12

                }

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 different classes having the same super class
Number of node comparisons | 25

1. {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) | 2.1
   Clone type | Type 1

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

   4

       if (orientation == PlotOrientation.HORIZONTAL)

   3

       if (orientation == PlotOrientation.HORIZONTAL)

   5

       double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM);

   4

       double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM);

   6

       line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY());

   5

       line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY());

       else

       else

   7

       double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT);

   6

       double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT);

   8

       line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy);

   7

       line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy);

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