1057-1-8

if (drawFront) { Area side = new Area(new Rectangle2D.Double( arc.getEndPoint().getX(), plotArea.getY(), arc.getStartPoint().getX() - arc.getEndPoint().getX(), plotArea.getHeight())); side.intersect(front); g2.setPaint(paint); g2.fill(side); g2.setPaint(outlinePaint); g2.draw(side); }
if (drawBack) { Area side2 = new Area(new Rectangle2D.Double( arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight())); side2.intersect(back); g2.setPaint(paint); g2.fill(side2); g2.setPaint(outlinePaint); g2.draw(side2); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java
Method name: `void drawSide(Graphics2D, Rectangle2D, Arc2D, Area, Area, Paint, Paint, Stroke, boolean, boolean)` |  | Method name: `void drawSide(Graphics2D, Rectangle2D, Arc2D, Area, Area, Paint, Paint, Stroke, boolean, boolean)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (drawFront) {↵

1

    if (drawBack) {↵

2

                                Area side = new Area(new Rectangle2D.Double(↵

2

                            Area side2 = new Area(new Rectangle2D.Double(↵

3

                                        arc.getEndPoint().getX(), plotArea.getY(), ↵

3

                                    arc.getEndPoint().getX(), plotArea.getY(),↵

4

                                        arc.getStartPoint().getX() ↵

4

                                    plotArea.getMaxX() ↵

5

                                        - arc.getEndPoint().getX(),↵

5

    - arc.getEndPoint().getX(),↵

6

                                        plotArea.getHeight()));↵

6

                                    plotArea.getHeight()));↵

7

                                side.intersect(front);↵

7

                            side2.intersect(↵

8

        ↵

8

    back);↵

9

                            g2.setPaint(paint);↵

9

                            g2.setPaint(paint);↵

10

                                g2.fill(side);↵

10

                            g2.fill(side2);↵

11

                                g2.setPaint(outlinePaint);↵

11

                            g2.setPaint(outlinePaint);↵

12

                                g2.draw(side);↵

12

                            g2.draw(side2);↵

13

                            }

13

                        }

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.0
Clones location | Clones are in the same method
Number of node comparisons | 49

1. {Refactorable}

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

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

   14

       if (drawFront)

   14 | if (drawFront)
   117 | if (drawBack)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   drawFront | drawBack | VARIABLE_NAME_MISMATCH

   117

       if (drawBack)

   15

       Area side = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), arc.getStartPoint().getX() - arc.getEndPoint().getX(), plotArea.getHeight()));

   118

       Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight()));

   16

       side.intersect(front);

   16 | side.intersect(front);
   119 | side2.intersect(back);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   front | back | VARIABLE_NAME_MISMATCH
   side | side2 | VARIABLE_NAME_MISMATCH

   119

       side2.intersect(back);

   17

       g2.setPaint(paint);

   120

       g2.setPaint(paint);

   18

       g2.fill(side);

   18 | g2.fill(side);
   121 | g2.fill(side2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   side | side2 | VARIABLE_NAME_MISMATCH

   121

       g2.fill(side2);

   19

       g2.setPaint(outlinePaint);

   122

       g2.setPaint(outlinePaint);

   20

       g2.draw(side);

   20 | g2.draw(side);
   123 | g2.draw(side2);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   side | side2 | VARIABLE_NAME_MISMATCH

   123

       g2.draw(side2);

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