1515-2-3

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 (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(y0, x0, y1, x1); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(x0, y0, x1, y1); }

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

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

2

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

2

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

3

                        }↵

3

                        }↵

4

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

4

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

5

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

5

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

6

                        }

6

                        }

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

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) | 0.9
   Clone type | Type 1

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

   26

       if (orientation == PlotOrientation.HORIZONTAL)

   42

       if (orientation == PlotOrientation.HORIZONTAL)

   27

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

   43

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

   28

       else if (orientation == PlotOrientation.VERTICAL)

   44

       else if (orientation == PlotOrientation.VERTICAL)

   29

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

   45

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

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