1550-2-6

if (seriesCount > 1) { double seriesGap = dataArea.getWidth() * getItemMargin() / (categoryCount * (seriesCount - 1)); rectX = rectX + row * (state.getBarWidth() + seriesGap); } else { rectX = rectX + row * state.getBarWidth(); }
if (seriesCount > 1) { double seriesGap = dataArea.getWidth() * getItemMargin() / (categoryCount * (seriesCount - 1)); rectX = rectX + row * (state.getBarWidth() + seriesGap); } else { rectX = rectX + row * state.getBarWidth(); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/IntervalBarRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/WaterfallBarRenderer.java
Method name: `void drawInterval(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, IntervalCategoryDataset, 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 (seriesCount > 1) {↵

1

    if (seriesCount > 1) {↵

2

                    double seriesGap = dataArea.getWidth() * getItemMargin()↵

2

                    double seriesGap = dataArea.getWidth() * getItemMargin()↵

3

                                       / (categoryCount * (seriesCount - 1));↵

3

                                       / (categoryCount * (seriesCount - 1));↵

4

                    rectX = rectX + row * (state.getBarWidth() + seriesGap);↵

4

                    rectX = rectX + row * (state.getBarWidth() + seriesGap);↵

5

                }↵

5

                }↵

6

                else {↵

6

                else {↵

7

                    rectX = rectX + row * state.getBarWidth();↵

7

                    rectX = rectX + row * state.getBarWidth();↵

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

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

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

   36

       if (seriesCount > 1)

   36

       if (seriesCount > 1)

   37

       double seriesGap = dataArea.getWidth() * getItemMargin() / (categoryCount * (seriesCount - 1));

   37

       double seriesGap = dataArea.getWidth() * getItemMargin() / (categoryCount * (seriesCount - 1));

   38

       rectX = rectX + row * (state.getBarWidth() + seriesGap);

   38

       rectX = rectX + row * (state.getBarWidth() + seriesGap);

       else

       else

   39

       rectX = rectX + row * state.getBarWidth();

   39

       rectX = rectX + row * state.getBarWidth();

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