123-1-4

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) { // and finishes at back 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); } } else { // starts at back and wraps right around to the // back again Area side1 = new Area(new Rectangle2D.Double( arc.getStartPoint().getX(), plotArea.getY(), plotArea.getX() - arc.getStartPoint().getX(), plotArea.getHeight())); side1.intersect(back); 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); 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);

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 &gt; -180.0) {  // the segment is entirely at the ↵

1

    if (extent &lt; 180.0) {  // ↵

2

                                                // front of the chart↵

2

    and finishes at back↵

3

                            if (drawFront) {↵

3

                            if (drawBack) {↵

4

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

4

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

5

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

5

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

6

                                        arc.getStartPoint().getX() ↵

6

                                        arc.getStartPoint().getX() ↵

7

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

7

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

8

                                        plotArea.getHeight()));↵

8

                                        plotArea.getHeight()));↵

9

                                side.intersect(front);↵

9

                                side.intersect(back);↵

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 {  // ↵

17

                                // the way around↵

17

    starts at back and wraps right around to the ↵

18

                                // the back and finishes at the front again↵

18

                                // back again↵

19

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

19

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

20

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

20

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

21

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

21

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

22

                                    plotArea.getHeight()));↵

22

                                    plotArea.getHeight()));↵

23

                            side1.intersect(front);↵

23

                            side1.intersect(back);↵

24

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

24

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

25

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

25

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

26

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

26

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

27

                                    plotArea.getHeight()));↵

27

                                    plotArea.getHeight()));↵

28

                            side2.intersect(front);↵

28

                            side2.intersect(back);↵

29

                            g2.setPaint(paint);↵

29

                            g2.setPaint(paint);↵

30

                            if (drawFront) {↵

30

                            if (drawBack) {↵

31

                                g2.fill(side1);↵

31

                                g2.fill(side1);↵

32

                                g2.fill(side2);↵

32

                                g2.fill(side2);↵

33

                            }↵

33

                            }↵

34

                            if (drawBack) {↵

34

                            if (drawFront) {↵

35

                                g2.fill(back);↵

35

                                g2.fill(front);↵

36

                            }↵

36

                            }↵

37

                            g2.setPaint(outlinePaint);↵

37

                            g2.setPaint(outlinePaint);↵

38

                            if (drawFront) {↵

38

                            if (drawBack) {↵

39

                                g2.draw(side1);↵

39

                                g2.draw(side1);↵

40

                                g2.draw(side2);↵

40

                                g2.draw(side2);↵

41

                            }↵

41

                            }↵

42

                            if (drawBack) {↵

42

                            if (drawFront) {↵

43

                                g2.draw(back);↵

43

                                g2.draw(front);↵

44

44

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location |
Number of node comparisons | 0