307-3-5

if (axis.getRange().contains(value)) { Line2D line = null; 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); } g2.setStroke(stroke); g2.setPaint(paint); g2.draw(line); }
Range range = axis.getRange(); if (!range.contains(value)) { return; } PlotOrientation orientation = plot.getOrientation(); Line2D line = null; double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge()); if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); } g2.setPaint(paint); g2.setStroke(stroke); g2.draw(line);

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/renderer/xy/AbstractXYItemRenderer.java
Method name: `void drawRangeCrosshair(Graphics2D, Rectangle2D, PlotOrientation, double, ValueAxis, Stroke, Paint)` |  | Method name: `void drawRangeLine(Graphics2D, XYPlot, ValueAxis, Rectangle2D, double, Paint, Stroke)`
Number of AST nodes: 10 |  | Number of AST nodes: 13

1

    if (axis.getRange()↵

1

    Range range = axis.getRange();↵

2

    .contains(value)) {↵

2

            if (!range.contains(value)) {↵

3

                Line2D line = null;↵

3

                ↵

4

                if (↵

4

    return;↵

5

            }↵

5

    orientation == PlotOrientation.HORIZONTAL) {↵

6

            PlotOrientation orientation = plot.getOrientation↵

6

            ↵

7

    ();↵

8

            Line2D line = null;↵

7

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

9

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

8

                            RectangleEdge.BOTTOM);↵

9

       ↵

10

     plot.getRangeAxisEdge());↵

11

            if (orientation == PlotOrientation.HORIZONTAL) {↵

10

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

12

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

11

                            dataArea.getMaxY());↵

13

                        dataArea.getMaxY());↵

12

                }↵

14

            }↵

13

                else {↵

15

            else ↵

14

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

15

                            RectangleEdge.LEFT);↵

16

        ↵

16

    if (orientation == PlotOrientation.VERTICAL) {↵

17

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

17

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

18

                            dataArea.getMaxX(), yy);↵

18

                        dataArea.getMaxX(), v);↵

19

                }↵

19

            }↵

20

        ↵

21

            g2.setStroke(stroke);↵

20

            g2.setPaint(paint);↵

22

                g2.setPaint(paint);↵

21

            g2.setStroke(stroke);↵

23

                g2.draw(line);↵

22

            g2.draw(line);

24

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
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
Number of node comparisons | 3