if (extent > -180.0) { // the segment is entirely at the // front of the chart 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); } } else { // the segment starts at the front, and wraps all // the way around // the back and finishes at the front again Area side1 = new Area(new Rectangle2D.Double( plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); side1.intersect(front); Area side2 = new Area(new Rectangle2D.Double( arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().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);
if (extent < 180.0) { // segment only occupies the front if (drawFront) { Area side = new Area(new Rectangle2D.Double( arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); side.intersect(front); g2.setPaint(paint); g2.fill(side); g2.setPaint(outlinePaint); g2.draw(side); } } else { // segments wraps right around the back... 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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (extent > -180.0) {  // the segment is entirely at the 
1
if (extent < 180.0) {  // segment 
2
                                            // front of the chart
2
only occupies the front
3
                        if (drawFront) {
3
                        if (drawFront) {
4
                            Area side = new Area(new Rectangle2D.Double(
4
                            Area side = new Area(new Rectangle2D.Double(
5
                                    arc.getEndPoint().getX(), plotArea.getY(), 
5
                                    arc.getStartPoint().getX(), plotArea.getY(),
6
                                    arc.getStartPoint().getX() 
6
                                    arc.getEndPoint().getX() 
7
                                    - arc.getEndPoint().getX(),
7
                                    - arc.getStartPoint().getX(),
8
                                    plotArea.getHeight()));
8
                                    plotArea.getHeight()));
9
                            side.intersect(front);
9
                            side.intersect(front);
10
                            g2.setPaint(paint);
10
                            g2.setPaint(paint);
11
                            g2.fill(side);
11
                            g2.fill(side);
12
                            g2.setPaint(outlinePaint);
12
                            g2.setPaint(outlinePaint);
13
                            g2.draw(side);
13
                            g2.draw(side);
14
                        }
14
                        }
15
                    }
15
                    }
16
                    else {  // the segment starts at the front, and wraps all 
16
                    else {  // segment
17
                            // the way around
18
                            // the back and finishes at the front again
17
s wraps right around the back...
19
                        Area side1 = new Area(new Rectangle2D.Double(
18
                        Area side1 = new Area(new Rectangle2D.Double(
20
                                plotArea.getX(), plotArea.getY(),
19
                                arc.getStartPoint().getX(), plotArea.getY(),
21
                                arc.getStartPoint().getX() - plotArea.getX(), 
20
                                plotArea.getMaxX() - arc.getStartPoint().getX(),
22
                                plotArea.getHeight()));
21
                                plotArea.getHeight()));
23
                        side1.intersect(front);
22
                        side1.intersect(front);
24
                        Area side2 = new Area(new Rectangle2D.Double(
23
                        Area side2 = new Area(new Rectangle2D.Double(
25
                                arc.getEndPoint().getX(), plotArea.getY(),
24
                                plotArea.getX(), plotArea.getY(),
26
                                plotArea.getMaxX() - arc.getEndPoint().getX(),
25
                                arc.getEndPoint().getX() - plotArea.getX(),
27
                                plotArea.getHeight()));
26
                                plotArea.getHeight()));
28
                        side2.intersect(front);
27
                        side2.intersect(front);
29
                        g2.setPaint(paint);
28
                        g2.setPaint(paint);
30
                        if (drawFront) {
29
                        if (drawFront) {
31
                            g2.fill(side1);
30
                            g2.fill(side1);
32
                            g2.fill(side2);
31
                            g2.fill(side2);
33
                        }
32
                        }
34
                        if (drawBack) {
33
                        if (drawBack) {
35
                            g2.fill(back);
34
                            g2.fill(back);
36
                        }
35
                        }
37
                        g2.setPaint(outlinePaint);
36
                        g2.setPaint(outlinePaint);
38
                        if (drawFront) {
37
                        if (drawFront) {
39
                            g2.draw(side1);
38
                            g2.draw(side1);
40
                            g2.draw(side2);
39
                            g2.draw(side2);
41
                        }
40
                        }
42
                        if (drawBack) {
41
                        if (drawBack) {
43
                            g2.draw(back);
42
                            g2.draw(back);
44
                        
43
                        
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0