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 (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);
}
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: 14
|
|
Number of AST nodes: 14
|
|
1 | if (drawBack) {↵ | | 1 | if (drawBack) {↵
|
2 | Area side1 = new Area(new Rectangle2D.Double(↵ | | 2 | Area side2 = new Area(new Rectangle2D.Double(↵
|
3 | arc.getStartPoint().getX(), plotArea.getY(),↵ | | 3 | arc.getEndPoint().getX(), plotArea.getY(),↵
|
4 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵ | | 4 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵
|
5 | plotArea.getHeight()));↵ | | 5 | plotArea.getHeight()));↵
|
6 | side1.intersect(back);↵ | | 6 | side2.intersect(back);↵
|
7 | g2.setPaint(paint);↵ | | 7 | g2.setPaint(paint);↵
|
8 | g2.fill(side1);↵ | | 8 | g2.fill(side2);↵
|
9 | g2.setPaint(outlinePaint);↵ | | 9 | g2.setPaint(outlinePaint);↵
|
10 | g2.draw(side1);↵ | | 10 | g2.draw(side2);↵
|
11 | }↵ | | 11 | }↵
|
|
12 | if (drawFront) {↵ | | 12 | if (drawFront) {↵
|
13 | Area side2 = new Area(new Rectangle2D.Double(↵ | | 13 | Area side1 = new Area(new Rectangle2D.Double(↵
|
14 | arc.getEndPoint().getX(), plotArea.getY(),↵ | | 14 | arc.getStartPoint().getX(), plotArea.getY(),↵
|
15 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵ | | 15 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵
|
16 | plotArea.getHeight()));↵ | | 16 | plotArea.getHeight()));↵
|
17 | side2.intersect(front);↵ | | 17 | side1.intersect(front);↵
|
18 | g2.setPaint(paint);↵ | | 18 | g2.setPaint(paint);↵
|
19 | g2.fill(side2);↵ | | 19 | g2.fill(side1);↵
|
20 | g2.setPaint(outlinePaint);↵ | | 20 | g2.setPaint(outlinePaint);↵
|
21 | g2.draw(side2);↵ | | 21 | g2.draw(side1);↵
|
22 | } | | 22 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 155 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 14 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 22.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
76 | if (drawBack) | | 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 | | | 126 | |
79 | | | 127 | |
80 | | | 128 | |
81 | g2.setPaint(outlinePaint); | | 129 | g2.setPaint(outlinePaint); |
82 | | | 130 | |
83 | if (drawFront) | | 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 | | | 119 | |
86 | | | 120 | |
87 | | | 121 | |
88 | g2.setPaint(outlinePaint); | | 122 | g2.setPaint(outlinePaint); |
89 | | | 123 | |
Precondition Violations (0)
Row |
Violation |