1549-1-3

if (orientation == PlotOrientation.HORIZONTAL) { bar = new Rectangle2D.Double(barL0, barW0, barLength, state.getBarWidth()); } else { bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(), barLength); }
if (orientation == PlotOrientation.HORIZONTAL) { bar = new Rectangle2D.Double(barL0, barW0, barLength, state.getBarWidth()); } else { bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(), barLength); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer3D.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedBarRenderer.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: 3 |  | Number of AST nodes: 3

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

1

    if (orientation == PlotOrientation.HORIZONTAL) {↵

2

                bar = new Rectangle2D.Double(barL0, barW0, barLength,↵

2

                bar = new Rectangle2D.Double(barL0, barW0, barLength,↵

3

                        state.getBarWidth());↵

3

                        state.getBarWidth());↵

4

            }↵

4

            }↵

5

            else {↵

5

            else {↵

6

                bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(),↵

6

                bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(),↵

7

                        barLength);↵

7

                        barLength);↵

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 3
   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.2
   Clone type | Type 1

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

   17

       if (orientation == PlotOrientation.HORIZONTAL)

   33

       if (orientation == PlotOrientation.HORIZONTAL)

   18

       bar = new Rectangle2D.Double(barL0, barW0, barLength, state.getBarWidth());

   34

       bar = new Rectangle2D.Double(barL0, barW0, barLength, state.getBarWidth());

       else

       else

   19

       bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(), barLength);

   35

       bar = new Rectangle2D.Double(barW0, barL0, state.getBarWidth(), barLength);

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