1415-2-3

if (this.useOutlinePaint) { g2.setPaint(getItemOutlinePaint(row, column)); } else { g2.setPaint(getItemPaint(row, column)); } g2.setStroke(getItemOutlineStroke(row, column)); g2.draw(shape);
if (getItemShapeFilled(row, column)) { if (this.useFillPaint) { g2.setPaint(getItemFillPaint(row, column)); } else { g2.setPaint(getItemPaint(row, column)); } g2.fill(shape); }

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

1

    if (getItemShapeFilled(row, column)) {↵

1

    if (this.useOutlinePaint) {↵

2

                    if (this.useFillPaint) {↵

2

                            g2.setPaint(getItemOutlinePaint(row, column));↵

3

                        g2.setPaint(getItemFillPaint(row, column));↵

3

                        }↵

4

                    ↵

4

        ↵

5

    }↵

5

                    else {↵

6

                    else {↵

6

                            g2.setPaint(getItemPaint(row, column));↵

7

                        g2.setPaint(getItemPaint(row, column));↵

7

                        }↵

8

                    ↵

8

        ↵

9

    }↵

9

                    g2.setStroke(getItemOutlineStroke(row, column));↵

10

                    g2.fill(shape);↵

10

                        g2.draw(shape);

11

                }

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

1. {Non-refactorable}

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

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

   46

       if (this.useOutlinePaint)

   46 | if (this.useOutlinePaint)
   23 | if (this.useFillPaint)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   useOutlinePaint | useFillPaint | VARIABLE_NAME_MISMATCH

   23

       if (this.useFillPaint)

   47

       g2.setPaint(getItemOutlinePaint(row, column));

   47 | g2.setPaint(getItemOutlinePaint(row, column));
   24 | g2.setPaint(getItemFillPaint(row, column));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getItemOutlinePaint | getItemFillPaint | METHOD_INVOCATION_NAME_MISMATCH

   24

       g2.setPaint(getItemFillPaint(row, column));

       else

       else

   48

       g2.setPaint(getItemPaint(row, column));

   25

       g2.setPaint(getItemPaint(row, column));

   49

       g2.setStroke(getItemOutlineStroke(row, column));

   50

       g2.draw(shape);

   50 | g2.draw(shape);
   26 | g2.fill(shape);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   draw | fill | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression g2.draw(shape) is a void method call, and thus it cannot be parameterized
   Expression g2.fill(shape) is a void method call, and thus it cannot be parameterized

   26

       g2.fill(shape);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression g2.draw(shape) is a void method call, and thus it cannot be parameterized
   2 | Expression g2.fill(shape) is a void method call, and thus it cannot be parameterized