1467-7-9

if (orientation == PlotOrientation.HORIZONTAL) { line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v); } else if (orientation == PlotOrientation.VERTICAL) { line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); }
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); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Method name: `void drawDomainGridLine(Graphics2D, XYPlot, ValueAxis, Rectangle2D, double)` |  | Method name: `void drawRangeLine(Graphics2D, XYPlot, ValueAxis, Rectangle2D, double, Paint, Stroke)`
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(dataArea.getMinX(), v,↵

2

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

3

                        dataArea.getMaxX(), v);↵

3

                        dataArea.getMaxY());↵

4

            }↵

4

            }↵

5

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

5

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

6

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

6

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

7

                        dataArea.getMaxY());↵

7

                        dataArea.getMaxX(), v);↵

8

            }

8

            }

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 declared in the same 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.0
   Clone type | Type 2

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

   7

       if (orientation == PlotOrientation.HORIZONTAL)

   7 | if (orientation == PlotOrientation.HORIZONTAL)
   9 | if (orientation == PlotOrientation.VERTICAL)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   HORIZONTAL | VERTICAL | VARIABLE_NAME_MISMATCH

   9

       if (orientation == PlotOrientation.VERTICAL)

   8

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

   10

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

   9

       else if (orientation == PlotOrientation.VERTICAL)

   9 | else if (orientation == PlotOrientation.VERTICAL)
   7 | else if (orientation == PlotOrientation.HORIZONTAL)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   VERTICAL | HORIZONTAL | VARIABLE_NAME_MISMATCH

   7

       else if (orientation == PlotOrientation.HORIZONTAL)

   10

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

   8

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

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