1212-6-8

Area side1 = new Area(new Rectangle2D.Double( arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); side1.intersect(front); g2.setPaint(paint); g2.fill(side1); g2.setPaint(outlinePaint); g2.draw(side1);
if (drawFront) { Area side2 = new Area(new Rectangle2D.Double( plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); side2.intersect(front); 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: 6 |  | Number of AST nodes: 7

1

    if (drawFront) {↵

1

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

2

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

2

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

3

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

3

                                    plotArea.getMaxX() - arc.getStartPoint().getX(),↵

4

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

4

                                    plotArea.getHeight()));↵

5

                                    plotArea.getHeight()));↵

5

                            side1.intersect(front);↵

6

                            side2.intersect(front);↵

6

                            g2.setPaint(paint);↵

7

                            g2.setPaint(paint);↵

7

                            g2.fill(side1);↵

8

                            g2.fill(side2);↵

8

                            g2.setPaint(outlinePaint);↵

9

                            g2.setPaint(outlinePaint);↵

9

                            g2.draw(side1);

10

                            g2.draw(side2);↵

11

                        }

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

1. {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 | 1
   Time elapsed for statement mapping (ms) | 0.0
   Clone type | Type 2

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

   125

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

   164

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

   126

       side1.intersect(front);

   126 | side1.intersect(front);
   165 | side2.intersect(front);

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

   165

       side2.intersect(front);

   127

       g2.setPaint(paint);

   166

       g2.setPaint(paint);

   128

       g2.fill(side1);

   128 | g2.fill(side1);
   167 | g2.fill(side2);

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

   167

       g2.fill(side2);

   129

       g2.setPaint(outlinePaint);

   168

       g2.setPaint(outlinePaint);

   130

       g2.draw(side1);

   130 | g2.draw(side1);
   169 | g2.draw(side2);

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

   169

       g2.draw(side2);

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