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: 39 | Number of AST nodes: 39 | |||
1 | if (!isAngleAtBack(end)) {↵ | 1 | if (!isAngleAtBack(end)) { // and finishes at the front↵ | |
2 | if (extent > -180.0) { // the segment is entirely at the ↵ | 2 | if (extent < 180.0) { // segment ↵ | |
3 | // front of the chart↵ | 3 | only occupies the front↵ | |
4 | if (drawFront) {↵ | 4 | if (drawFront) {↵ | |
5 | Area side = new Area(new Rectangle2D.Double(↵ | 5 | Area side = new Area(new Rectangle2D.Double(↵ | |
6 | arc.getEndPoint().getX(), plotArea.getY(), ↵ | 6 | arc.getStartPoint().getX(), plotArea.getY(),↵ | |
7 | arc.getStartPoint().getX() ↵ | 7 | arc.getEndPoint().getX() ↵ | |
8 | - arc.getEndPoint().getX(),↵ | 8 | - arc.getStartPoint().getX(),↵ | |
9 | plotArea.getHeight()));↵ | 9 | plotArea.getHeight()));↵ | |
10 | side.intersect(front);↵ | 10 | side.intersect(front);↵ | |
11 | g2.setPaint(paint);↵ | 11 | g2.setPaint(paint);↵ | |
12 | g2.fill(side);↵ | 12 | g2.fill(side);↵ | |
13 | g2.setPaint(outlinePaint);↵ | 13 | g2.setPaint(outlinePaint);↵ | |
14 | g2.draw(side);↵ | 14 | g2.draw(side);↵ | |
15 | }↵ | 15 | }↵ | |
16 | }↵ | 16 | }↵ | |
17 | else { // the segment starts at the front, and wraps all ↵ | 17 | else { // segment↵ | |
18 | // the way around↵ | |||
19 | // the back and finishes at the front again↵ | 18 | s wraps right around the back...↵ | |
20 | Area side1 = new Area(new Rectangle2D.Double(↵ | 19 | Area side1 = new Area(new Rectangle2D.Double(↵ | |
21 | plotArea.getX(), plotArea.getY(),↵ | 20 | arc.getStartPoint().getX(), plotArea.getY(),↵ | |
22 | arc.getStartPoint().getX() - plotArea.getX(), ↵ | 21 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵ | |
23 | plotArea.getHeight()));↵ | 22 | plotArea.getHeight()));↵ | |
24 | side1.intersect(front);↵ | 23 | side1.intersect(front);↵ | |
25 | Area side2 = new Area(new Rectangle2D.Double(↵ | 24 | Area side2 = new Area(new Rectangle2D.Double(↵ | |
26 | arc.getEndPoint().getX(), plotArea.getY(),↵ | 25 | plotArea.getX(), plotArea.getY(),↵ | |
27 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵ | 26 | arc.getEndPoint().getX() - plotArea.getX(),↵ | |
28 | plotArea.getHeight()));↵ | 27 | plotArea.getHeight()));↵ | |
29 | side2.intersect(front);↵ | 28 | side2.intersect(front);↵ | |
30 | g2.setPaint(paint);↵ | 29 | g2.setPaint(paint);↵ | |
31 | if (drawFront) {↵ | 30 | if (drawFront) {↵ | |
32 | g2.fill(side1);↵ | 31 | g2.fill(side1);↵ | |
33 | g2.fill(side2);↵ | 32 | g2.fill(side2);↵ | |
34 | }↵ | 33 | }↵ | |
35 | if (drawBack) {↵ | 34 | if (drawBack) {↵ | |
36 | g2.fill(back);↵ | 35 | g2.fill(back);↵ | |
37 | }↵ | 36 | }↵ | |
38 | g2.setPaint(outlinePaint);↵ | 37 | g2.setPaint(outlinePaint);↵ | |
39 | if (drawFront) {↵ | 38 | if (drawFront) {↵ | |
40 | g2.draw(side1);↵ | 39 | g2.draw(side1);↵ | |
41 | g2.draw(side2);↵ | 40 | g2.draw(side2);↵ | |
42 | }↵ | 41 | }↵ | |
43 | if (drawBack) {↵ | 42 | if (drawBack) {↵ | |
44 | g2.draw(back);↵ | 43 | g2.draw(back);↵ | |
45 | }↵ | 44 | }↵ | |
46 | }↵ | 45 | }↵ | |
47 | }↵ | 46 | }↵ | |
48 | else { // starts at the front, finishes at the back (going ↵ | 47 | else { // segments starts at front and finishes at ↵ | |
49 | // around the left side)↵ | |||
48 | back...↵ | |||
50 | if (drawBack) {↵ | 49 | if (drawBack) {↵ | |
51 | Area side2 = new Area(new Rectangle2D.Double(↵ | 50 | Area side2 = new Area(new Rectangle2D.Double(↵ | |
52 | plotArea.getX(), plotArea.getY(),↵ | 51 | arc.getEndPoint().getX(), plotArea.getY(),↵ | |
53 | arc.getEndPoint().getX() - plotArea.getX(), ↵ | 52 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵ | |
54 | plotArea.getHeight()));↵ | 53 | plotArea.getHeight()));↵ | |
55 | side2.intersect(back);↵ | 54 | side2.intersect(back);↵ | |
56 | g2.setPaint(paint);↵ | 55 | g2.setPaint(paint);↵ | |
57 | g2.fill(side2);↵ | 56 | g2.fill(side2);↵ | |
58 | g2.setPaint(outlinePaint);↵ | 57 | g2.setPaint(outlinePaint);↵ | |
59 | g2.draw(side2);↵ | 58 | g2.draw(side2);↵ | |
60 | }↵ | 59 | }↵ | |
61 | if (drawFront) {↵ | 60 | if (drawFront) {↵ | |
62 | Area side1 = new Area(new Rectangle2D.Double(↵ | 61 | Area side1 = new Area(new Rectangle2D.Double(↵ | |
63 | plotArea.getX(), plotArea.getY(),↵ | 62 | arc.getStartPoint().getX(), plotArea.getY(),↵ | |
64 | arc.getStartPoint().getX() - plotArea.getX(),↵ | 63 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵ | |
65 | plotArea.getHeight()));↵ | 64 | plotArea.getHeight()));↵ | |
66 | side1.intersect(front);↵ | 65 | side1.intersect(front);↵ | |
67 | g2.setPaint(paint);↵ | 66 | g2.setPaint(paint);↵ | |
68 | g2.fill(side1);↵ | 67 | g2.fill(side1);↵ | |
69 | g2.setPaint(outlinePaint);↵ | 68 | g2.setPaint(outlinePaint);↵ | |
70 | g2.draw(side1);↵ | 69 | g2.draw(side1);↵ | |
71 | }↵ | 70 | }↵ | |
72 | } | 71 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 5 |
Number of refactorable cases | 2 |
Number of non-refactorable cases | 3 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.6 |
Clones location | Clones are in the same method |
Number of node comparisons | 242 |
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) | 4.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | if (drawFront) | 94 | if (drawFront) | |||||||||||||||||
15 | Area side = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), arc.getStartPoint().getX() - arc.getEndPoint().getX(), plotArea.getHeight())); |
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||||||
16 | side.intersect(front); | 96 | side.intersect(front); | |||||||||||||||||
17 | g2.setPaint(paint); | 97 | g2.setPaint(paint); | |||||||||||||||||
18 | g2.fill(side); | 98 | g2.fill(side); | |||||||||||||||||
19 | g2.setPaint(outlinePaint); | 99 | g2.setPaint(outlinePaint); | |||||||||||||||||
20 | g2.draw(side); | 100 | g2.draw(side); |
Row | Violation |
---|
Number of mapped statements | 6 |
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) | 4.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
44 | if (drawFront) | 94 | if (drawFront) | |||||||||||
45 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | ||||||||||||
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||
46 | side1.intersect(front); |
| 96 | side.intersect(front); | ||||||||||
47 | g2.setPaint(paint); | 97 | g2.setPaint(paint); | |||||||||||
48 | g2.fill(side1); |
| 98 | g2.fill(side); | ||||||||||
49 | g2.setPaint(outlinePaint); | 99 | g2.setPaint(outlinePaint); | |||||||||||
50 | g2.draw(side1); |
| 100 | g2.draw(side); |
Row | Violation |
---|
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | |||||||||||||||||
22 | side1.intersect(front); | | |||||||||||||||||
23 | Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight())); | | |||||||||||||||||
24 | side2.intersect(front); | | |||||||||||||||||
25 | g2.setPaint(paint); | | |||||||||||||||||
26 | if (drawFront) | 94 | if (drawFront) | ||||||||||||||||
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | |||||||||||||||||
| 96 | side.intersect(front); | |||||||||||||||||
| 97 | g2.setPaint(paint); | |||||||||||||||||
| 99 | g2.setPaint(outlinePaint); | |||||||||||||||||
27 | g2.fill(side1); |
| 100 | g2.draw(side); | |||||||||||||||
28 | g2.fill(side2); |
| 98 | g2.fill(side); |
Row | Violation |
---|---|
1 | Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized |
2 | Expression g2.draw(side) is a void method call, and thus it cannot be parameterized |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 6.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); |
| 103 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | ||||||||||||||||
22 | side1.intersect(front); |
| 104 | side2.intersect(front); | ||||||||||||||||
23 | Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight())); |
| 101 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||||||
24 | side2.intersect(front); |
| 102 | side1.intersect(front); | ||||||||||||||||
25 | g2.setPaint(paint); | 105 | g2.setPaint(paint); | |||||||||||||||||
26 | if (drawFront) | 106 | if (drawFront) | |||||||||||||||||
27 | g2.fill(side1); | 107 | g2.fill(side1); | |||||||||||||||||
28 | g2.fill(side2); | 108 | g2.fill(side2); | |||||||||||||||||
29 | if (drawBack) | | ||||||||||||||||||
30 | g2.fill(back); | | ||||||||||||||||||
| 109 | if (drawBack) | ||||||||||||||||||
| 110 | g2.fill(back); | ||||||||||||||||||
31 | g2.setPaint(outlinePaint); | 111 | g2.setPaint(outlinePaint); | |||||||||||||||||
32 | if (drawFront) | | ||||||||||||||||||
33 | g2.draw(side1); | | ||||||||||||||||||
34 | g2.draw(side2); | | ||||||||||||||||||
35 | if (drawBack) | | ||||||||||||||||||
36 | g2.draw(back); | | ||||||||||||||||||
| 112 | if (drawFront) | ||||||||||||||||||
| 113 | g2.draw(side1); | ||||||||||||||||||
| 114 | g2.draw(side2); | ||||||||||||||||||
| 115 | if (drawBack) | ||||||||||||||||||
| 116 | g2.draw(back); |
Row | Violation |
---|---|
1 | Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables side1, side2 , while Clone fragment #2 returns variables side1, side2 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 11 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 101 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | |||||||||||||||||
| 102 | side1.intersect(front); | |||||||||||||||||
| 103 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | |||||||||||||||||
| 104 | side2.intersect(front); | |||||||||||||||||
| 105 | g2.setPaint(paint); | |||||||||||||||||
37 | if (drawBack) |
| 106 | if (drawFront) | |||||||||||||||
38 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | |||||||||||||||||
39 | side2.intersect(back); | | |||||||||||||||||
40 | g2.setPaint(paint); | | |||||||||||||||||
41 | g2.fill(side2); | 108 | g2.fill(side2); | ||||||||||||||||
42 | g2.setPaint(outlinePaint); | | |||||||||||||||||
43 | g2.draw(side2); |
| 107 | g2.fill(side1); | |||||||||||||||
44 | if (drawFront) | | |||||||||||||||||
45 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | |||||||||||||||||
46 | side1.intersect(front); | | |||||||||||||||||
47 | g2.setPaint(paint); | | |||||||||||||||||
48 | g2.fill(side1); | | |||||||||||||||||
49 | g2.setPaint(outlinePaint); | | |||||||||||||||||
50 | g2.draw(side1); | | |||||||||||||||||
| 109 | if (drawBack) | |||||||||||||||||
| 110 | g2.fill(back); |
Row | Violation |
---|---|
1 | Expression g2.draw(side2) is a void method call, and thus it cannot be parameterized |
2 | Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized |