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 > -180.0) {  // the segment is entirely at the 
4
                    if (extent < 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 > -180.0) {  // whole segment stays at the back
78
                    if (extent < 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 subtrees10
Number of refactorable cases5
Number of non-refactorable cases5
Time elapsed for finding largest common nesting structure subtrees (ms)21.5
Clones locationClones are in the same method
Number of node comparisons540
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)29.2
    Clone typeType 2
    Mapped Statements
    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()));
    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()));
    Differences
    Expression1Expression2Difference
    getEndPointgetStartPointMETHOD_INVOCATION_NAME_MISMATCH
    getStartPointgetEndPointMETHOD_INVOCATION_NAME_MISMATCH
    getEndPointgetStartPointMETHOD_INVOCATION_NAME_MISMATCH
    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);
    Precondition Violations (0)
    Row Violation
  2. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)10.5
    Clone typeType 2
    Mapped Statements
    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);
    46
    side1.intersect(front);
    96
    side.intersect(front);
    Differences
    Expression1Expression2Difference
    side1sideVARIABLE_NAME_MISMATCH
    96
    side.intersect(front);
    47
    g2.setPaint(paint);
    97
    g2.setPaint(paint);
    48
    g2.fill(side1);
    48
    g2.fill(side1);
    98
    g2.fill(side);
    Differences
    Expression1Expression2Difference
    side1sideVARIABLE_NAME_MISMATCH
    98
    g2.fill(side);
    49
    g2.setPaint(outlinePaint);
    99
    g2.setPaint(outlinePaint);
    50
    g2.draw(side1);
    50
    g2.draw(side1);
    100
    g2.draw(side);
    Differences
    Expression1Expression2Difference
    side1sideVARIABLE_NAME_MISMATCH
    100
    g2.draw(side);
    Precondition Violations (0)
    Row Violation
  3. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment8
    Time elapsed for statement mapping (ms)4.2
    Clone typeType 3
    Mapped Statements
    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);
                                        
    106
    if (drawFront)
                                            
    107
    g2.fill(side1);
                                            
    108
    g2.fill(side2);
    53
    if (drawBack)
    109
    if (drawBack)
    54
    Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight()));
                                                                                                                                                                                                                                                                                                                                                
    55
    side.intersect(back);
                                                      
    56
    g2.setPaint(paint);
                                                  
    57
    g2.fill(side);
    57
    g2.fill(side);
    110
    g2.fill(back);
    Differences
    Expression1Expression2Difference
    sidebackVARIABLE_NAME_MISMATCH
    110
    g2.fill(back);
    58
    g2.setPaint(outlinePaint);
                                                                
    59
    g2.draw(side);
                                        
    Precondition Violations (0)
    Row Violation
  4. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment8
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    60
    Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight()));
                                                                                                                                                                                                                                                                                                                                      
    61
    side1.intersect(back);
                                                        
    62
    Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight()));
                                                                                                                                                                                                                                                                                                      
    63
    side2.intersect(back);
                                                        
    64
    g2.setPaint(paint);
                                                  
    65
    if (drawBack)
                                    
    66
    g2.fill(side1);
                                          
    67
    g2.fill(side2);
                                          
    68
    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);
    69
    g2.fill(front);
    69
    g2.fill(front);
    98
    g2.fill(side);
    Differences
    Expression1Expression2Difference
    frontsideVARIABLE_NAME_MISMATCH
    98
    g2.fill(side);
                                                                
    99
    g2.setPaint(outlinePaint);
                                          
    100
    g2.draw(side);
    Precondition Violations (0)
    Row Violation
  5. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)8.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    83
    if (drawFront)
    94
    if (drawFront)
    84
    Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - 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()));
    85
    side2.intersect(front);
    85
    side2.intersect(front);
    96
    side.intersect(front);
    Differences
    Expression1Expression2Difference
    side2sideVARIABLE_NAME_MISMATCH
    96
    side.intersect(front);
    86
    g2.setPaint(paint);
    97
    g2.setPaint(paint);
    87
    g2.fill(side2);
    87
    g2.fill(side2);
    98
    g2.fill(side);
    Differences
    Expression1Expression2Difference
    side2sideVARIABLE_NAME_MISMATCH
    98
    g2.fill(side);
    88
    g2.setPaint(outlinePaint);
    99
    g2.setPaint(outlinePaint);
    89
    g2.draw(side2);
    89
    g2.draw(side2);
    100
    g2.draw(side);
    Differences
    Expression1Expression2Difference
    side2sideVARIABLE_NAME_MISMATCH
    100
    g2.draw(side);
    Precondition Violations (0)
    Row Violation
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)38.0
    Clone typeType 3
    Mapped Statements
    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);
    27
    g2.fill(side1);
    100
    g2.draw(side);
    Differences
    Expression1Expression2Difference
    filldrawMETHOD_INVOCATION_NAME_MISMATCH
    side1sideVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized
    Expression g2.draw(side) is a void method call, and thus it cannot be parameterized
    100
    g2.draw(side);
    28
    g2.fill(side2);
    28
    g2.fill(side2);
    98
    g2.fill(side);
    Differences
    Expression1Expression2Difference
    side2sideVARIABLE_NAME_MISMATCH
    98
    g2.fill(side);
    Precondition Violations (2)
    Row Violation
    1Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized
    2Expression g2.draw(side) is a void method call, and thus it cannot be parameterized
  2. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment7
    Number of unmapped statements in the second code fragment7
    Time elapsed for statement mapping (ms)16.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    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()));
    103
    Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    Differences
    Expression1Expression2Difference
    side1side2VARIABLE_NAME_MISMATCH
    getStartPointgetEndPointMETHOD_INVOCATION_NAME_MISMATCH
    103
    Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight()));
    22
    side1.intersect(front);
    22
    side1.intersect(front);
    104
    side2.intersect(front);
    Differences
    Expression1Expression2Difference
    side1side2VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    104
    side2.intersect(front);
    23
    Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight()));
    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()));
    Differences
    Expression1Expression2Difference
    side2side1VARIABLE_NAME_MISMATCH
    getEndPointgetStartPointMETHOD_INVOCATION_NAME_MISMATCH
    getEndPointgetStartPointMETHOD_INVOCATION_NAME_MISMATCH
    101
    Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight()));
    24
    side2.intersect(front);
    24
    side2.intersect(front);
    102
    side1.intersect(front);
    Differences
    Expression1Expression2Difference
    side2side1VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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);
    Precondition Violations (5)
    Row Violation
    1Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variables side1, side2 , while Clone fragment #2 returns variables side1, side2
  3. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment11
    Number of unmapped statements in the second code fragment7
    Time elapsed for statement mapping (ms)8.0
    Clone typeType 3
    Mapped Statements
    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)
    37
    if (drawBack)
    106
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_NAME_MISMATCH
    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);
    43
    g2.draw(side2);
    107
    g2.fill(side1);
    Differences
    Expression1Expression2Difference
    drawfillMETHOD_INVOCATION_NAME_MISMATCH
    side2side1VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression g2.draw(side2) is a void method call, and thus it cannot be parameterized
    Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized
    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);
    Precondition Violations (2)
    Row Violation
    1Expression g2.draw(side2) is a void method call, and thus it cannot be parameterized
    2Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized
  4. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment7
    Number of unmapped statements in the second code fragment7
    Time elapsed for statement mapping (ms)13.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    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)
                                      
    69
    g2.fill(front);
                                          
                                      
    109
    if (drawBack)
                                          
    110
    g2.fill(back);
    70
    g2.setPaint(outlinePaint);
    111
    g2.setPaint(outlinePaint);
    71
    if (drawBack)
                                    
    72
    g2.draw(side1);
                                          
    73
    g2.draw(side2);
                                          
    74
    if (drawFront)
                                      
    75
    g2.draw(front);
                                          
                                        
    112
    if (drawFront)
                                            
    113
    g2.draw(side1);
                                            
    114
    g2.draw(side2);
                                      
    115
    if (drawBack)
                                          
    116
    g2.draw(back);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables side1, side2 , while Clone fragment #2 returns variables side1, side2
  5. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment11
    Number of unmapped statements in the second code fragment7
    Time elapsed for statement mapping (ms)8.5
    Clone typeType 3
    Mapped Statements
    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);
    76
    if (drawBack)
    76
    if (drawBack)
    106
    if (drawFront)
    Differences
    Expression1Expression2Difference
    drawBackdrawFrontVARIABLE_NAME_MISMATCH
    106
    if (drawFront)
    77
    Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight()));
                                                                                                                                                                                                                                                                                                                                      
    78
    side1.intersect(back);
                                                        
    79
    g2.setPaint(paint);
                                                  
    80
    g2.fill(side1);
    107
    g2.fill(side1);
    81
    g2.setPaint(outlinePaint);
                                                                
    82
    g2.draw(side1);
    82
    g2.draw(side1);
    108
    g2.fill(side2);
    Differences
    Expression1Expression2Difference
    drawfillMETHOD_INVOCATION_NAME_MISMATCH
    side1side2VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression g2.draw(side1) is a void method call, and thus it cannot be parameterized
    Expression g2.fill(side2) is a void method call, and thus it cannot be parameterized
    108
    g2.fill(side2);
    83
    if (drawFront)
                                      
    84
    Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight()));
                                                                                                                                                                                                                                                                                                                              
    85
    side2.intersect(front);
                                                          
    86
    g2.setPaint(paint);
                                                  
    87
    g2.fill(side2);
                                          
    88
    g2.setPaint(outlinePaint);
                                                                
    89
    g2.draw(side2);
                                          
                                      
    109
    if (drawBack)
                                          
    110
    g2.fill(back);
    Precondition Violations (2)
    Row Violation
    1Expression g2.draw(side1) is a void method call, and thus it cannot be parameterized
    2Expression g2.fill(side2) is a void method call, and thus it cannot be parameterized