1357-2-3

if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx)); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen)); }
if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yyClose, xx, yyClose, xx - delta)); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx, yyClose, xx + delta, yyClose)); }

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

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

2

                            g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen,↵

2

                            g2.draw(new Line2D.Double(yyClose, xx, yyClose,↵

3

                                    xx));↵

3

                                    xx - delta));↵

4

                        }↵

4

                        }↵

5

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

5

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

6

                            g2.draw(new Line2D.Double(xx - delta, yyOpen, xx,↵

6

                            g2.draw(new Line2D.Double(xx, yyClose, xx + delta,↵

7

                                    yyOpen));↵

7

                                    yyClose));↵

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.4
Clones location | Clones are in the same method
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) | 1.6
   Clone type | Type 2

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

   38

       if (orientation == PlotOrientation.HORIZONTAL)

   49

       if (orientation == PlotOrientation.HORIZONTAL)

   39

       g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx));

   39 | g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx));
   50 | g2.draw(new Line2D.Double(yyClose, xx, yyClose, xx - delta));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   yyOpen | yyClose | VARIABLE_NAME_MISMATCH
   xx + delta | xx | TYPE_COMPATIBLE_REPLACEMENT
   yyOpen | yyClose | VARIABLE_NAME_MISMATCH
   xx | xx - delta | TYPE_COMPATIBLE_REPLACEMENT

   50

       g2.draw(new Line2D.Double(yyClose, xx, yyClose, xx - delta));

   40

       else if (orientation == PlotOrientation.VERTICAL)

   51

       else if (orientation == PlotOrientation.VERTICAL)

   41

       g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen));

   41 | g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen));
   52 | g2.draw(new Line2D.Double(xx, yyClose, xx + delta, yyClose));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   xx - delta | xx | TYPE_COMPATIBLE_REPLACEMENT
   yyOpen | yyClose | VARIABLE_NAME_MISMATCH
   xx | xx + delta | TYPE_COMPATIBLE_REPLACEMENT
   yyOpen | yyClose | VARIABLE_NAME_MISMATCH

   52

       g2.draw(new Line2D.Double(xx, yyClose, xx + delta, yyClose));

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