1057-4-10

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

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 (drawBack) {↵

1

    if (drawBack) {↵

2

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

2

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

3

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

3

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

4

                                        arc.getEndPoint().getX() ↵

4

                                        arc.getStartPoint().getX() ↵

5

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

5

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

6

                                        plotArea.getHeight()));↵

6

                                        plotArea.getHeight()));↵

7

                                side.intersect(back);↵

7

                                side.intersect(back);↵

8

                                g2.setPaint(paint);↵

8

                                g2.setPaint(paint);↵

9

                                g2.fill(side);↵

9

                                g2.fill(side);↵

10

                                g2.setPaint(outlinePaint);↵

10

                                g2.setPaint(outlinePaint);↵

11

                                g2.draw(side);↵

11

                                g2.draw(side);↵

12

                            }

12

                            }

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

1. {Refactorable}

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

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

   53

       if (drawBack)

   133

       if (drawBack)

   54

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getStartPoint | getEndPoint | METHOD_INVOCATION_NAME_MISMATCH
   getEndPoint | getStartPoint | METHOD_INVOCATION_NAME_MISMATCH
   getStartPoint | getEndPoint | METHOD_INVOCATION_NAME_MISMATCH

   134

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

   55

       side.intersect(back);

   135

       side.intersect(back);

   56

       g2.setPaint(paint);

   136

       g2.setPaint(paint);

   57

       g2.fill(side);

   137

       g2.fill(side);

   58

       g2.setPaint(outlinePaint);

   138

       g2.setPaint(outlinePaint);

   59

       g2.draw(side);

   139

       g2.draw(side);

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