1659-3-6

Stroke stroke = getItemOutlineStroke(row, column); Paint paint = getItemOutlinePaint(row, column); if (stroke != null && paint != null) { g2.setStroke(stroke); g2.setPaint(paint); g2.draw(bar); }
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/IntervalBarRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalBarRenderer.java
Method name: `void drawInterval(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, IntervalCategoryDataset, int, int)` |  | Method name: `void drawHorizontalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, StatisticalCategoryDataset, int, int)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    Stroke stroke = getItemOutlineStroke(row, column);↵

1

    Stroke stroke = getItemOutlineStroke(row, column);↵

2

                Paint paint = getItemOutlinePaint(row, column);↵

2

                Paint paint = getItemOutlinePaint(row, column);↵

3

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

3

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

4

                    g2.setStroke(stroke);↵

4

                    g2.setStroke(stroke);↵

5

                    g2.setPaint(paint);↵

5

                    g2.setPaint(paint);↵

6

                    g2.draw(bar);↵

6

                    g2.draw(bar);↵

7

                }

7

                }

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 | 21

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 6
   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
   --- | --- | --- | --- | ---

   46

       Stroke stroke = getItemOutlineStroke(row, column);

   46

       Stroke stroke = getItemOutlineStroke(row, column);

   47

       Paint paint = getItemOutlinePaint(row, column);

   47

       Paint paint = getItemOutlinePaint(row, column);

   48

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

   48

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

   49

       g2.setStroke(stroke);

   49

       g2.setStroke(stroke);

   50

       g2.setPaint(paint);

   50

       g2.setPaint(paint);

   51

       g2.draw(bar);

   51

       g2.draw(bar);

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