426-1-3

if (this.drawOutlines) { 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/ScatterRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LineAndShapeRenderer.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: 6 |  | Number of AST nodes: 5

1

    if (this.drawOutlines) {↵

1

    if (getItemShapeFilled(row, column)) {↵

2

                    if (this.useOutlinePaint) {↵

2

                        if (this.useFillPaint) {↵

3

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

3

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

4

                    }↵

4

                        }↵

5

                    else {↵

5

                        else {↵

6

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

6

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

7

                    }↵

7

                    ↵

8

        ↵

8

        }↵

9

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

9

                ↵

10

                    g2.draw(shape);↵

10

            g2.fill(shape);↵

11

                }

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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) | 18.1
   Clone type | Type 3

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

   27

       if (this.drawOutlines)

   27 | if (this.drawOutlines)
   40 | if (getItemShapeFilled(row, column))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.drawOutlines | getItemShapeFilled(row,column) | TYPE_COMPATIBLE_REPLACEMENT

   40

       if (getItemShapeFilled(row, column))

   28

       if (this.useOutlinePaint)

   28 | if (this.useOutlinePaint)
   41 | if (this.useFillPaint)

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

   41

       if (this.useFillPaint)

   29

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

   29 | g2.setPaint(getItemOutlinePaint(row, column));
   42 | g2.setPaint(getItemFillPaint(row, column));

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

   42

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

       else

       else

   30

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

   43

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

   31

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

   32

       g2.draw(shape);

   32 | g2.draw(shape);
   44 | 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

   44

       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