254-2-3

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

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: 16 |  | Number of AST nodes: 16

1

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

1

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

2

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

2

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

3

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

3

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

4

                                    plotArea.getHeight()));↵

4

                                    plotArea.getHeight()));↵

5

                            side1.intersect(back);↵

5

                            side1.intersect(front);↵

6

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

6

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

7

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

7

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

8

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

8

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

9

                                    plotArea.getHeight()));↵

9

                                    plotArea.getHeight()));↵

10

                            side2.intersect(back);↵

10

                            side2.intersect(front);↵

11

                            g2.setPaint(paint);↵

11

                            g2.setPaint(paint);↵

12

                            if (drawBack) {↵

12

                            if (drawFront) {↵

13

                                g2.fill(side1);↵

13

                                g2.fill(side1);↵

14

                                g2.fill(side2);↵

14

                                g2.fill(side2);↵

15

                            }↵

15

                            }↵

16

                            if (drawFront) {↵

16

                            if (drawBack) {↵

17

                                g2.fill(front);↵

17

                                g2.fill(back);↵

18

                            }↵

18

                            }↵

19

                            g2.setPaint(outlinePaint);↵

19

                            g2.setPaint(outlinePaint);↵

20

                            if (drawBack) {↵

20

                            if (drawFront) {↵

21

                                g2.draw(side1);↵

21

                                g2.draw(side1);↵

22

                                g2.draw(side2);↵

22

                                g2.draw(side2);↵

23

                            }↵

23

                            }↵

24

                            if (drawFront) {↵

24

                            if (drawBack) {↵

25

                                g2.draw(front);↵

25

                                g2.draw(back);↵

26

                            }

26

                            }

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 16
   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) | 4.2
   Clone type | Type 2

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

   60

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

   101

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

   61

       side1.intersect(back);

   61 | side1.intersect(back);
   102 | side1.intersect(front);

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

   102

       side1.intersect(front);

   62

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

   103

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

   63

       side2.intersect(back);

   63 | side2.intersect(back);
   104 | side2.intersect(front);

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

   104

       side2.intersect(front);

   64

       g2.setPaint(paint);

   105

       g2.setPaint(paint);

   65

       if (drawBack)

   65 | if (drawBack)
   106 | if (drawFront)

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

   106

       if (drawFront)

   66

       g2.fill(side1);

   107

       g2.fill(side1);

   67

       g2.fill(side2);

   108

       g2.fill(side2);

   68

       if (drawFront)

   68 | if (drawFront)
   109 | if (drawBack)

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

   109

       if (drawBack)

   69

       g2.fill(front);

   69 | g2.fill(front);
   110 | g2.fill(back);

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

   110

       g2.fill(back);

   70

       g2.setPaint(outlinePaint);

   111

       g2.setPaint(outlinePaint);

   71

       if (drawBack)

   71 | if (drawBack)
   112 | if (drawFront)

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

   112

       if (drawFront)

   72

       g2.draw(side1);

   113

       g2.draw(side1);

   73

       g2.draw(side2);

   114

       g2.draw(side2);

   74

       if (drawFront)

   74 | if (drawFront)
   115 | if (drawBack)

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

   115

       if (drawBack)

   75

       g2.draw(front);

   75 | g2.draw(front);
   116 | g2.draw(back);

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

   116

       g2.draw(back);

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