277-1-4

rectY = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, domainAxisLocation); if (seriesCount > 1) { double seriesGap = dataArea.getHeight() * getItemMargin() / (categoryCount * (seriesCount - 1)); rectY = rectY + row * (state.getBarWidth() + seriesGap); } else { rectY = rectY + row * state.getBarWidth(); } rectX = j2dy0; rectHeight = state.getBarWidth(); rectWidth = Math.max(getMinimumBarLength(), Math.abs(j2dy1 - j2dy0));
if (orientation == PlotOrientation.VERTICAL) { // BAR X rectX = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, domainAxisLocation); if (seriesCount > 1) { double seriesGap = dataArea.getWidth() * getItemMargin() / (categoryCount * (seriesCount - 1)); rectX = rectX + row * (state.getBarWidth() + seriesGap); } else { rectX = rectX + row * state.getBarWidth(); } rectY = j2dy0; }

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

1

    if (orientation == PlotOrientation.VERTICAL) {↵

2

                // BAR X↵

1

    rectY = domainAxis.getCategoryStart(column, getColumnCount(),↵

3

                rectX = domainAxis.getCategoryStart(column, getColumnCount(),↵

2

                        dataArea, domainAxisLocation);↵

4

                        dataArea, domainAxisLocation);↵

3

                if (seriesCount > 1) {↵

5

                if (seriesCount > 1) {↵

4

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

6

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

5

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

7

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

6

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

8

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

7

                }↵

9

                }↵

8

                else {↵

10

                else {↵

9

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

11

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

10

                }↵

12

                }↵

11

                rectX = j2dy0;↵

13

                rectY = j2dy0;↵

12

                rectHeight = state.getBarWidth();↵

14

            ↵

13

                rectWidth = Math.max(getMinimumBarLength(),↵

14

                        Math.abs(j2dy1 - j2dy0));

15

    }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are in the same method
Number of node comparisons | 25

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 2.9
   Clone type | Type 3

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

   26

       rectY = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, domainAxisLocation);

   26 | rectY = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, domainAxisLocation);
   35 | rectX = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, domainAxisLocation);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rectY | rectX | VARIABLE_NAME_MISMATCH

   35

       rectX = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, domainAxisLocation);

   27

       if (seriesCount > 1)

   36

       if (seriesCount > 1)

   28

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getHeight | getWidth | METHOD_INVOCATION_NAME_MISMATCH

   37

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

   29

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

   29 | rectY = rectY + row * (state.getBarWidth() + seriesGap);
   38 | rectX = rectX + row * (state.getBarWidth() + seriesGap);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rectY | rectX | VARIABLE_NAME_MISMATCH
   rectY | rectX | VARIABLE_NAME_MISMATCH

   38

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

       else

       else

   30

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

   30 | rectY = rectY + row * state.getBarWidth();
   39 | rectX = rectX + row * state.getBarWidth();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rectY | rectX | VARIABLE_NAME_MISMATCH
   rectY | rectX | VARIABLE_NAME_MISMATCH

   39

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

   31

       rectX = j2dy0;

   31 | rectX = j2dy0;
   40 | rectY = j2dy0;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rectX | rectY | VARIABLE_NAME_MISMATCH

   40

       rectY = j2dy0;

   32

       rectHeight = state.getBarWidth();

   33

       rectWidth = Math.max(getMinimumBarLength(), Math.abs(j2dy1 - j2dy0));

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables rectY, rectX , while Clone fragment #2 returns variables rectX, rectY