1515-3-4

if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(y0, x0, y1, x1); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(x0, y0, x1, y1); }
if (PlotOrientation.HORIZONTAL == l_orientation) { l_line = new Line2D.Double(l_y1, l_x1, l_y2, l_x2); } else if (PlotOrientation.VERTICAL == l_orientation) { l_line = new Line2D.Double(l_x1, l_y1, l_x2, l_y2); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.java
Method name: `void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int)` |  | Method name: `void drawItemPass1(Graphics2D, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (PlotOrientation↵

2

            ↵

2

    .HORIZONTAL == l_orientation) {↵

3

                    line = new Line2D.Double(y0, x0, y1, x1);↵

3

                l_line = new Line2D.Double(↵

4

                        }↵

5

                ↵

4

    l_y1, l_x1, l_y2, l_x2);↵

5

            }↵

6

            else if (orientation == PlotOrientation.VERTICAL) {↵

6

            else if (PlotOrientation.VERTICAL == l_orientation) {↵

7

                            line = new Line2D.Double(x0, y0, x1, y1);↵

7

                l_line = new Line2D.Double(↵

8

                ↵

8

    l_x1, l_y1, l_x2, l_y2);↵

9

            }

9

            }

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.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 13

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

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

   42

       if (orientation == PlotOrientation.HORIZONTAL)

   42 | if (orientation == PlotOrientation.HORIZONTAL)
   48 | if (PlotOrientation.HORIZONTAL == l_orientation)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   orientation | PlotOrientation.HORIZONTAL | TYPE_COMPATIBLE_REPLACEMENT
   PlotOrientation.HORIZONTAL | l_orientation | TYPE_COMPATIBLE_REPLACEMENT

   48

       if (PlotOrientation.HORIZONTAL == l_orientation)

   43

       line = new Line2D.Double(y0, x0, y1, x1);

   43 | line = new Line2D.Double(y0, x0, y1, x1);
   49 | l_line = new Line2D.Double(l_y1, l_x1, l_y2, l_x2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   line | l_line | VARIABLE_NAME_MISMATCH
   y0 | l_y1 | VARIABLE_NAME_MISMATCH
   x0 | l_x1 | VARIABLE_NAME_MISMATCH
   y1 | l_y2 | VARIABLE_NAME_MISMATCH
   x1 | l_x2 | VARIABLE_NAME_MISMATCH

   49

       l_line = new Line2D.Double(l_y1, l_x1, l_y2, l_x2);

   44

       else if (orientation == PlotOrientation.VERTICAL)

   44 | else if (orientation == PlotOrientation.VERTICAL)
   50 | else if (PlotOrientation.VERTICAL == l_orientation)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   orientation | PlotOrientation.VERTICAL | TYPE_COMPATIBLE_REPLACEMENT
   PlotOrientation.VERTICAL | l_orientation | TYPE_COMPATIBLE_REPLACEMENT

   50

       else if (PlotOrientation.VERTICAL == l_orientation)

   45

       line = new Line2D.Double(x0, y0, x1, y1);

   45 | line = new Line2D.Double(x0, y0, x1, y1);
   51 | l_line = new Line2D.Double(l_x1, l_y1, l_x2, l_y2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   line | l_line | VARIABLE_NAME_MISMATCH
   x0 | l_x1 | VARIABLE_NAME_MISMATCH
   y0 | l_y1 | VARIABLE_NAME_MISMATCH
   x1 | l_x2 | VARIABLE_NAME_MISMATCH
   y1 | l_y2 | VARIABLE_NAME_MISMATCH

   51

       l_line = new Line2D.Double(l_x1, l_y1, l_x2, l_y2);

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