1400-2-7

if (isDrawBarOutline() && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) { Stroke stroke = getItemOutlineStroke(row, column); Paint paint = getItemOutlinePaint(row, column); if (stroke != null && paint != null) { g2.setStroke(stroke); g2.setPaint(paint); g2.draw(bar); } }
if (isDrawBarOutline() && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) { Stroke stroke = getItemOutlineStroke(row, column); Paint paint = getItemOutlinePaint(row, column); if (stroke != null && paint != null) { g2.setStroke(stroke); g2.setPaint(paint); g2.draw(bar); } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GanttRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/WaterfallBarRenderer.java
Method name: `void drawTask(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, GanttCategoryDataset, int, int)` |  | Method name: `void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (isDrawBarOutline()↵

1

    if (isDrawBarOutline()↵

2

                    && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {↵

2

                    && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {↵

3

                Stroke stroke = getItemOutlineStroke(row, column);↵

3

                Stroke stroke = getItemOutlineStroke(row, column);↵

4

                Paint paint = getItemOutlinePaint(row, column);↵

4

                Paint paint = getItemOutlinePaint(row, column);↵

5

                if (stroke != null && paint != null) {↵

5

                if (stroke != null && paint != null) {↵

6

                    g2.setStroke(stroke);↵

6

                    g2.setStroke(stroke);↵

7

                    g2.setPaint(paint);↵

7

                    g2.setPaint(paint);↵

8

                    g2.draw(bar);↵

8

                    g2.draw(bar);↵

9

                }↵

9

                }↵

10

            }

10

            }

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 in different classes having the same super class
Number of node comparisons | 25

1. {Refactorable}

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

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

   48

       if (isDrawBarOutline() && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD)

   57

       if (isDrawBarOutline() && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD)

   49

       Stroke stroke = getItemOutlineStroke(row, column);

   58

       Stroke stroke = getItemOutlineStroke(row, column);

   50

       Paint paint = getItemOutlinePaint(row, column);

   59

       Paint paint = getItemOutlinePaint(row, column);

   51

       if (stroke != null && paint != null)

   60

       if (stroke != null && paint != null)

   52

       g2.setStroke(stroke);

   61

       g2.setStroke(stroke);

   53

       g2.setPaint(paint);

   62

       g2.setPaint(paint);

   54

       g2.draw(bar);

   63

       g2.draw(bar);

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