if (isAngleAtFront(start)) { // start at front if (!isAngleAtBack(end)) { 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); } } } else { // starts at the front, finishes at the back (going // around the left side) if (drawBack) { Area side2 = new Area(new Rectangle2D.Double( plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); side2.intersect(back); g2.setPaint(paint); g2.fill(side2); g2.setPaint(outlinePaint); g2.draw(side2); } if (drawFront) { Area side1 = new Area(new Rectangle2D.Double( plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); side1.intersect(front); g2.setPaint(paint); g2.fill(side1); g2.setPaint(outlinePaint); g2.draw(side1); } } } else { // the segment starts at the back (still extending // CLOCKWISE) if (!isAngleAtFront(end)) { if (extent > -180.0) { // whole segment stays at the back 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); } } else { // starts at the back, wraps around front, and // finishes at back again 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); } } } else { // starts at back, finishes at front (CLOCKWISE) if (drawBack) { Area side1 = new Area(new Rectangle2D.Double( arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); side1.intersect(back); g2.setPaint(paint); g2.fill(side1); g2.setPaint(outlinePaint); g2.draw(side1); } if (drawFront) { 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); g2.fill(side2); g2.setPaint(outlinePaint); g2.draw(side2); } } }
if (extent > 0.0) { // the pie sections are arranged ANTICLOCKWISE if (isAngleAtFront(start)) { // segment starts at the front if (!isAngleAtBack(end)) { // and finishes at the front 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); } } } else { // segments starts at front and finishes at back... if (drawBack) { 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); g2.fill(side2); g2.setPaint(outlinePaint); g2.draw(side2); } if (drawFront) { Area side1 = new Area(new Rectangle2D.Double( arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); side1.intersect(front); g2.setPaint(paint); g2.fill(side1); g2.setPaint(outlinePaint); g2.draw(side1); } } } else { // segment starts at back if (!isAngleAtFront(end)) { 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); } } } else { // starts at the back and finishes at the front // (wrapping the left side) if (drawBack) { Area side1 = new Area(new Rectangle2D.Double( plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); side1.intersect(back); g2.setPaint(paint); g2.fill(side1); g2.setPaint(outlinePaint); g2.draw(side1); } if (drawFront) { Area side2 = new Area(new Rectangle2D.Double( plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); side2.intersect(front); g2.setPaint(paint); g2.fill(side2); g2.setPaint(outlinePaint); g2.draw(side2); } } } }
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: 79 Number of AST nodes: 80
1
if (extent > 0.0) {  // the pie sections are arranged ANTICLOCKWISE
1
if (isAngleAtFront(start)) {  // start at front
2
            if (isAngleAtFront(start)) {  // segment starts at the front
2
                if (!isAngleAtBack(end)) {
3
                if (!isAngleAtBack(end)) {  // and finishes at the front
3
                    if (extent &gt; -180.0) {  // the segment is entirely at the 
4
                    if (extent &lt; 180.0) {  // segment 
4
                                            // front of the chart
5
only occupies the front
5
                        if (drawFront) {
6
                        if (drawFront) {
6
                            Area side = new Area(new Rectangle2D.Double(
7
                            Area side = new Area(new Rectangle2D.Double(
7
                                    arc.getEndPoint().getX(), plotArea.getY(), 
8
                                    arc.getStartPoint().getX(), plotArea.getY(),
8
                                    arc.getStartPoint().getX() 
9
                                    arc.getEndPoint().getX() 
9
                                    - arc.getEndPoint().getX(),
10
                                    - arc.getStartPoint().getX(),
10
                                    plotArea.getHeight()));
11
                                    plotArea.getHeight()));
11
                            side.intersect(front);
12
                            side.intersect(front);
12
                            g2.setPaint(paint);
13
                            g2.setPaint(paint);
13
                            g2.fill(side);
14
                            g2.fill(side);
14
                            g2.setPaint(outlinePaint);
15
                            g2.setPaint(outlinePaint);
15
                            g2.draw(side);
16
                            g2.draw(side);
16
                        }
17
                        }
17
                    }
18
                    }
18
                    else {  // the segment starts at the front, and wraps all 
19
                    else {  // segment
19
                            // the way around
20
                            // the back and finishes at the front again
20
s wraps right around the back...
21
                        Area side1 = new Area(new Rectangle2D.Double(
21
                        Area side1 = new Area(new Rectangle2D.Double(
22
                                plotArea.getX(), plotArea.getY(),
22
                                arc.getStartPoint().getX(), plotArea.getY(),
23
                                arc.getStartPoint().getX() - plotArea.getX(), 
23
                                plotArea.getMaxX() - arc.getStartPoint().getX(),
24
                                plotArea.getHeight()));
24
                                plotArea.getHeight()));
25
                        side1.intersect(front);
25
                        side1.intersect(front);
26
                        Area side2 = new Area(new Rectangle2D.Double(
26
                        Area side2 = new Area(new Rectangle2D.Double(
27
                                arc.getEndPoint().getX(), plotArea.getY(),
27
                                plotArea.getX(), plotArea.getY(),
28
                                plotArea.getMaxX() - arc.getEndPoint().getX(),
28
                                arc.getEndPoint().getX() - plotArea.getX(),
29
                                plotArea.getHeight()));
29
                                plotArea.getHeight()));
30
                        side2.intersect(front);
30
                        side2.intersect(front);
31
                        g2.setPaint(paint);
31
                        g2.setPaint(paint);
32
                        if (drawFront) {
32
                        if (drawFront) {
33
                            g2.fill(side1);
33
                            g2.fill(side1);
34
                            g2.fill(side2);
34
                            g2.fill(side2);
35
                        }
35
                        }
36
                        if (drawBack) {
36
                        if (drawBack) {
37
                            g2.fill(back);
37
                            g2.fill(back);
38
                        }
38
                        }
39
                        g2.setPaint(outlinePaint);
39
                        g2.setPaint(outlinePaint);
40
                        if (drawFront) {
40
                        if (drawFront) {
41
                            g2.draw(side1);
41
                            g2.draw(side1);
42
                            g2.draw(side2);
42
                            g2.draw(side2);
43
                        }
43
                        }
44
                        if (drawBack) {
44
                        if (drawBack) {
45
                            g2.draw(back);
45
                            g2.draw(back);
46
                        }
46
                        }
47
                    }
47
                    }
48
                }
48
                }
49
                else {  // starts at the front, finishes at the back (going 
49
                else {  // segments starts at front and finishes at 
50
                        // around the left side)
50
back...
51
                    if (drawBack) {
51
                    if (drawBack) {
52
                        Area side2 = new Area(new Rectangle2D.Double(
52
                        Area side2 = new Area(new Rectangle2D.Double(
53
                                plotArea.getX(), plotArea.getY(),
53
                                arc.getEndPoint().getX(), plotArea.getY(),
54
                                arc.getEndPoint().getX() - plotArea.getX(), 
54
                                plotArea.getMaxX() - arc.getEndPoint().getX(),
55
                                plotArea.getHeight()));
55
                                plotArea.getHeight()));
56
                        side2.intersect(back);
56
                        side2.intersect(back);
57
                        g2.setPaint(paint);
57
                        g2.setPaint(paint);
58
                        g2.fill(side2);
58
                        g2.fill(side2);
59
                        g2.setPaint(outlinePaint);
59
                        g2.setPaint(outlinePaint);
60
                        g2.draw(side2);
60
                        g2.draw(side2);
61
                    }
61
                    }
62
                    if (drawFront) {
62
                    if (drawFront) {
63
                        Area side1 = new Area(new Rectangle2D.Double(
63
                        Area side1 = new Area(new Rectangle2D.Double(
64
                                plotArea.getX(), plotArea.getY(),
64
                                arc.getStartPoint().getX(), plotArea.getY(),
65
                                arc.getStartPoint().getX() - plotArea.getX(),
65
                                plotArea.getMaxX() - arc.getStartPoint().getX(),
66
                                plotArea.getHeight()));
66
                                plotArea.getHeight()));
67
                        side1.intersect(front);
67
                        side1.intersect(front);
68
                        g2.setPaint(paint);
68
                        g2.setPaint(paint);
69
                        g2.fill(side1);
69
                        g2.fill(side1);
70
                        g2.setPaint(outlinePaint);
70
                        g2.setPaint(outlinePaint);
71
                        g2.draw(side1);
71
                        g2.draw(side1);
72
                    }
72
                    }
73
                }
73
                }
74
            }
74
            }
75
            else {  // the segment starts at the back (still extending 
75
            else {  // segment starts at 
76
                    // CLOCKWISE)
76
back
77
                if (!isAngleAtFront(end)) {
77
                if (!isAngleAtFront(end)) {
78
                    if (extent &gt; -180.0) {  // whole segment stays at the back
78
                    if (extent &lt; 180.0) {  // and finishes at back
79
                        if (drawBack) {
79
                        if (drawBack) {
80
                            Area side = new Area(new Rectangle2D.Double(
80
                            Area side = new Area(new Rectangle2D.Double(
81
                                    arc.getStartPoint().getX(), plotArea.getY(),
81
                                    arc.getEndPoint().getX(), plotArea.getY(),
82
                                    arc.getEndPoint().getX() 
82
                                    arc.getStartPoint().getX() 
83
                                    - arc.getStartPoint().getX(),
83
                                    - arc.getEndPoint().getX(),
84
                                    plotArea.getHeight()));
84
                                    plotArea.getHeight()));
85
                            side.intersect(back);
85
                            side.intersect(back);
86
                            g2.setPaint(paint);
86
                            g2.setPaint(paint);
87
                            g2.fill(side);
87
                            g2.fill(side);
88
                            g2.setPaint(outlinePaint);
88
                            g2.setPaint(outlinePaint);
89
                            g2.draw(side);
89
                            g2.draw(side);
90
                        }
90
                        }
91
                    }
91
                    }
92
                    else {  // starts at the back, wraps around front, and 
92
                    else {  // starts at back and wraps right around to the 
93
                            // finishes at back again
93
                            // back again
94
                        Area side1 = new Area(new Rectangle2D.Double(
94
                        Area side1 = new Area(new Rectangle2D.Double(
95
                                arc.getStartPoint().getX(), plotArea.getY(),
95
                                arc.getStartPoint().getX(), plotArea.getY(),
96
                                plotArea.getMaxX() - arc.getStartPoint().getX(),
96
                                plotArea.getX() - arc.getStartPoint().getX(),
97
                                plotArea.getHeight()));
97
                                plotArea.getHeight()));
98
                        side1.intersect(back);
98
                        side1.intersect(back);
99
                        Area side2 = new Area(new Rectangle2D.Double(
99
                        Area side2 = new Area(new Rectangle2D.Double(
100
                                plotArea.getX(), plotArea.getY(),
100
                                arc.getEndPoint().getX(), plotArea.getY(),
101
                                arc.getEndPoint().getX() - plotArea.getX(),
101
                                plotArea.getMaxX() - arc.getEndPoint().getX(),
102
                                plotArea.getHeight()));
102
                                plotArea.getHeight()));
103
                        side2.intersect(back);
103
                        side2.intersect(back);
104
                        g2.setPaint(paint);
104
                        g2.setPaint(paint);
105
                        if (drawBack) {
105
                        if (drawBack) {
106
                            g2.fill(side1);
106
                            g2.fill(side1);
107
                            g2.fill(side2);
107
                            g2.fill(side2);
108
                        }
108
                        }
109
                        if (drawFront) {
109
                        if (drawFront) {
110
                            g2.fill(front);
110
                            g2.fill(front);
111
                        }
111
                        }
112
                        g2.setPaint(outlinePaint);
112
                        g2.setPaint(outlinePaint);
113
                        if (drawBack) {
113
                        if (drawBack) {
114
                            g2.draw(side1);
114
                            g2.draw(side1);
115
                            g2.draw(side2);
115
                            g2.draw(side2);
116
                        }
116
                        }
117
                        if (drawFront) {
117
                        if (drawFront) {
118
                            g2.draw(front);
118
                            g2.draw(front);
119
                        }
119
                        }
120
                    }
120
                    }
121
                }
121
                }
122
                else {  // starts at back, finishes at front (CLOCKWISE)
122
                else {  // starts at the back and finishes at the front 
123
                        // (wrapping the left side)
123
                    if (drawBack) {
124
                    if (drawBack) {
124
                        Area side1 = new Area(new Rectangle2D.Double(
125
                        Area side1 = new Area(new Rectangle2D.Double(
125
                                arc.getStartPoint().getX(), plotArea.getY(),
126
                                plotArea.getX(), plotArea.getY(),
126
                                plotArea.getMaxX() - arc.getStartPoint().getX(),
127
                                arc.getStartPoint().getX() - plotArea.getX(),
127
                                plotArea.getHeight()));
128
                                plotArea.getHeight()));
128
                        side1.intersect(back);
129
                        side1.intersect(back);
129
                        g2.setPaint(paint);
130
                        g2.setPaint(paint);
130
                        g2.fill(side1);
131
                        g2.fill(side1);
131
                        g2.setPaint(outlinePaint);
132
                        g2.setPaint(outlinePaint);
132
                        g2.draw(side1);
133
                        g2.draw(side1);
133
                    }
134
                    }
134
                    if (drawFront) {
135
                    if (drawFront) {
135
                        Area side2 = new Area(new Rectangle2D.Double(
136
                        Area side2 = new Area(new Rectangle2D.Double(
136
                                arc.getEndPoint().getX(), plotArea.getY(),
137
                                plotArea.getX(), plotArea.getY(),
137
                                plotArea.getMaxX() - arc.getEndPoint().getX(),
138
                                arc.getEndPoint().getX() - plotArea.getX(),
138
                                plotArea.getHeight()));
139
                                plotArea.getHeight()));
139
                        side2.intersect(front);
140
                        side2.intersect(front);
140
                        g2.setPaint(paint);
141
                        g2.setPaint(paint);
141
                        g2.fill(side2);
142
                        g2.fill(side2);
142
                        g2.setPaint(outlinePaint);
143
                        g2.setPaint(outlinePaint);
143
                        g2.draw(side2);
144
                        g2.draw(side2);
144
                    }
145
                    }
145
                }
146
                }
146
            }
147
            }
148
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)34.6
Clones locationClones are in the same method
Number of node comparisons1060
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements78
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)280.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    if (isAngleAtFront(start))
    11
    if (isAngleAtFront(start))
    91
    if (isAngleAtFront(start))
    Differences
    Expression1Expression2Difference
    isAngleAtFront(start)isAngleAtFront(start)IF_ELSE_SYMMETRICAL_MATCH
    91
    if (isAngleAtFront(start))
    12
    if (!isAngleAtBack(end))
    12
    if (!isAngleAtBack(end))
    131
    if (!isAngleAtFront(end))
    Differences
    Expression1Expression2Difference
    isAngleAtBackisAngleAtFrontMETHOD_INVOCATION_NAME_MISMATCH
    131
    if (!isAngleAtFront(end))
    13
    if (extent > -180.0)
    13
    if (extent > -180.0)
    132
    if (extent < 180.0)
    Differences
    Expression1Expression2Difference
    -180.0180.0TYPE_COMPATIBLE_REPLACEMENT
    ><OPERATOR_MISMATCH
    132
    if (extent < 180.0)
    14
    if (drawFront)
    14
    if (drawFront)
    133
    if (drawBack)
    Differences
    Expression1Expression2Difference
    drawFrontdrawBackVARIABLE_NAME_MISMATCH
    133
    if (drawBack)
    15
    Area side = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), arc.getStartPoint().getX() - arc.getEndPoint().getX(), plotArea.getHeight()));
    134
    Area side = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), arc.getStartPoint().getX() - arc.getEndPoint().getX(), plotArea.getHeight()));
    16
    side.intersect(front);
    16
    side.intersect(front);
    135
    side.intersect(back);
    Differences
    Expression1Expression2Difference
    frontbackVARIABLE_NAME_MISMATCH
    135
    side.intersect(back);
    17
    g2.setPaint(paint);
    136
    g2.setPaint(paint);
    18
    g2.fill(side);
    137
    g2.fill(side);
    19
    g2.setPaint(outlinePaint);
    138
    g2.setPaint(outlinePaint);
    20
    g2.draw(side);
    139
    g2.draw(side);
    else
    else
    21
    Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    21
    Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    Preondition Violations
    Unmatched statement Area side1=new Area(new Rectangle2D.Double(plotArea.getX(),plotArea.getY(),arc.getStartPoint().getX() - plotArea.getX(),plotArea.getHeight())); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                  
    140
    Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getX() - arc.getStartPoint().getX(), plotArea.getHeight()));
    Preondition Violations
    Unmatched statement Area side1=new Area(new Rectangle2D.Double(arc.getStartPoint().getX(),plotArea.getY(),plotArea.getX() - arc.getStartPoint().getX(),plotArea.getHeight())); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    140
    Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getX() - arc.getStartPoint().getX(), plotArea.getHeight()));
    22
    side1.intersect(front);
    22
    side1.intersect(front);
    141
    side1.intersect(back);
    Differences
    Expression1Expression2Difference
    frontbackVARIABLE_NAME_MISMATCH
    141
    side1.intersect(back);
    23
    Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight()));
    142
    Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight()));
    24
    side2.intersect(front);
    24
    side2.intersect(front);
    143
    side2.intersect(back);
    Differences
    Expression1Expression2Difference
    frontbackVARIABLE_NAME_MISMATCH
    143
    side2.intersect(back);
    25
    g2.setPaint(paint);
    144
    g2.setPaint(paint);
    26
    if (drawFront)
    26
    if (drawFront)
    145
    if (drawBack)
    Differences
    Expression1Expression2Difference
    drawFrontdrawBackVARIABLE_NAME_MISMATCH
    145
    if (drawBack)
    27
    g2.fill(side1);
    146
    g2.fill(side1);
    28
    g2.fill(side2);
    147
    g2.fill(side2);
    29
    if (drawBack)
    29
    if (drawBack)
    148
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_NAME_MISMATCH
    148
    if (drawFront)
    30
    g2.fill(back);
    30
    g2.fill(back);
    149
    g2.fill(front);
    Differences
    Expression1Expression2Difference
    backfrontVARIABLE_NAME_MISMATCH
    149
    g2.fill(front);
    31
    g2.setPaint(outlinePaint);
    150
    g2.setPaint(outlinePaint);
    32
    if (drawFront)
    32
    if (drawFront)
    151
    if (drawBack)
    Differences
    Expression1Expression2Difference
    drawFrontdrawBackVARIABLE_NAME_MISMATCH
    151
    if (drawBack)
    33
    g2.draw(side1);
    152
    g2.draw(side1);
    34
    g2.draw(side2);
    153
    g2.draw(side2);
    35
    if (drawBack)
    35
    if (drawBack)
    154
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_NAME_MISMATCH
    154
    if (drawFront)
    36
    g2.draw(back);
    36
    g2.draw(back);
    155
    g2.draw(front);
    Differences
    Expression1Expression2Difference
    backfrontVARIABLE_NAME_MISMATCH
    155
    g2.draw(front);
    else
    else
    37
    if (drawBack)
    37
    if (drawBack)
    163
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_NAME_MISMATCH
    163
    if (drawFront)
    38
    Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    164
    Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    39
    side2.intersect(back);
    39
    side2.intersect(back);
    165
    side2.intersect(front);
    Differences
    Expression1Expression2Difference
    backfrontVARIABLE_NAME_MISMATCH
    165
    side2.intersect(front);
    40
    g2.setPaint(paint);
    166
    g2.setPaint(paint);
    41
    g2.fill(side2);
    167
    g2.fill(side2);
    42
    g2.setPaint(outlinePaint);
    168
    g2.setPaint(outlinePaint);
    43
    g2.draw(side2);
    169
    g2.draw(side2);
    44
    if (drawFront)
    44
    if (drawFront)
    156
    if (drawBack)
    Differences
    Expression1Expression2Difference
    drawFrontdrawBackVARIABLE_NAME_MISMATCH
    156
    if (drawBack)
    45
    Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    157
    Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    46
    side1.intersect(front);
    46
    side1.intersect(front);
    158
    side1.intersect(back);
    Differences
    Expression1Expression2Difference
    frontbackVARIABLE_NAME_MISMATCH
    158
    side1.intersect(back);
    47
    g2.setPaint(paint);
    159
    g2.setPaint(paint);
    48
    g2.fill(side1);
    160
    g2.fill(side1);
    49
    g2.setPaint(outlinePaint);
    161
    g2.setPaint(outlinePaint);
    50
    g2.draw(side1);
    162
    g2.draw(side1);
    else
    else
    51
    if (!isAngleAtFront(end))
    51
    if (!isAngleAtFront(end))
    92
    if (!isAngleAtBack(end))
    Differences
    Expression1Expression2Difference
    isAngleAtFrontisAngleAtBackMETHOD_INVOCATION_NAME_MISMATCH
    92
    if (!isAngleAtBack(end))
    52
    if (extent > -180.0)
    52
    if (extent > -180.0)
    93
    if (extent < 180.0)
    Differences
    Expression1Expression2Difference
    -180.0180.0TYPE_COMPATIBLE_REPLACEMENT
    ><OPERATOR_MISMATCH
    93
    if (extent < 180.0)
    53
    if (drawBack)
    53
    if (drawBack)
    94
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_NAME_MISMATCH
    94
    if (drawFront)
    54
    Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight()));
    95
    Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight()));
    55
    side.intersect(back);
    55
    side.intersect(back);
    96
    side.intersect(front);
    Differences
    Expression1Expression2Difference
    backfrontVARIABLE_NAME_MISMATCH
    96
    side.intersect(front);
    56
    g2.setPaint(paint);
    97
    g2.setPaint(paint);
    57
    g2.fill(side);
    98
    g2.fill(side);
    58
    g2.setPaint(outlinePaint);
    99
    g2.setPaint(outlinePaint);
    59
    g2.draw(side);
    100
    g2.draw(side);
    else
    else
    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
    Expression1Expression2Difference
    backfrontVARIABLE_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
    Expression1Expression2Difference
    backfrontVARIABLE_NAME_MISMATCH
    104
    side2.intersect(front);
    64
    g2.setPaint(paint);
    105
    g2.setPaint(paint);
    65
    if (drawBack)
    65
    if (drawBack)
    106
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_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
    Expression1Expression2Difference
    drawFrontdrawBackVARIABLE_NAME_MISMATCH
    109
    if (drawBack)
    69
    g2.fill(front);
    69
    g2.fill(front);
    110
    g2.fill(back);
    Differences
    Expression1Expression2Difference
    frontbackVARIABLE_NAME_MISMATCH
    110
    g2.fill(back);
    70
    g2.setPaint(outlinePaint);
    111
    g2.setPaint(outlinePaint);
    71
    if (drawBack)
    71
    if (drawBack)
    112
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_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
    Expression1Expression2Difference
    drawFrontdrawBackVARIABLE_NAME_MISMATCH
    115
    if (drawBack)
    75
    g2.draw(front);
    75
    g2.draw(front);
    116
    g2.draw(back);
    Differences
    Expression1Expression2Difference
    frontbackVARIABLE_NAME_MISMATCH
    116
    g2.draw(back);
    else
    else
    76
    if (drawBack)
    76
    if (drawBack)
    124
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_NAME_MISMATCH
    124
    if (drawFront)
    77
    Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight()));
    125
    Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight()));
    78
    side1.intersect(back);
    78
    side1.intersect(back);
    126
    side1.intersect(front);
    Differences
    Expression1Expression2Difference
    backfrontVARIABLE_NAME_MISMATCH
    126
    side1.intersect(front);
    79
    g2.setPaint(paint);
    127
    g2.setPaint(paint);
    80
    g2.fill(side1);
    128
    g2.fill(side1);
    81
    g2.setPaint(outlinePaint);
    129
    g2.setPaint(outlinePaint);
    82
    g2.draw(side1);
    130
    g2.draw(side1);
    83
    if (drawFront)
    83
    if (drawFront)
    117
    if (drawBack)
    Differences
    Expression1Expression2Difference
    drawFrontdrawBackVARIABLE_NAME_MISMATCH
    117
    if (drawBack)
    84
    Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight()));
    118
    Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight()));
    85
    side2.intersect(front);
    85
    side2.intersect(front);
    119
    side2.intersect(back);
    Differences
    Expression1Expression2Difference
    frontbackVARIABLE_NAME_MISMATCH
    119
    side2.intersect(back);
    86
    g2.setPaint(paint);
    120
    g2.setPaint(paint);
    87
    g2.fill(side2);
    121
    g2.fill(side2);
    88
    g2.setPaint(outlinePaint);
    122
    g2.setPaint(outlinePaint);
    89
    g2.draw(side2);
    123
    g2.draw(side2);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement Area side1=new Area(new Rectangle2D.Double(plotArea.getX(),plotArea.getY(),arc.getStartPoint().getX() - plotArea.getX(),plotArea.getHeight())); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement Area side1=new Area(new Rectangle2D.Double(arc.getStartPoint().getX(),plotArea.getY(),plotArea.getX() - arc.getStartPoint().getX(),plotArea.getHeight())); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted