for (int i = 2; i < this.polygon.length; i += 2) {
x = domainAxis.valueToJava2D(this.polygon[i], dataArea,
domainEdge);
y = rangeAxis.valueToJava2D(this.polygon[i + 1], dataArea,
rangeEdge);
area.lineTo((float) y, (float) x);
}
for (int i = 2; i < this.polygon.length; i += 2) {
x = domainAxis.valueToJava2D(this.polygon[i], dataArea,
domainEdge);
y = rangeAxis.valueToJava2D(this.polygon[i + 1], dataArea,
rangeEdge);
area.lineTo((float) x, (float) y);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPolygonAnnotation.java
|
Method name: void draw(Graphics2D, XYPlot, Rectangle2D, ValueAxis, ValueAxis, int, PlotRenderingInfo)
|
|
Method name: void draw(Graphics2D, XYPlot, Rectangle2D, ValueAxis, ValueAxis, int, PlotRenderingInfo)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (int i = 2; i < this.polygon.length; i += 2) {↵ | | 1 | for (int i = 2; i < this.polygon.length; i += 2) {↵
|
2 | x = domainAxis.valueToJava2D(this.polygon[i], dataArea, ↵ | | 2 | x = domainAxis.valueToJava2D(this.polygon[i], dataArea, ↵
|
3 | domainEdge);↵ | | 3 | domainEdge);↵
|
4 | y = rangeAxis.valueToJava2D(this.polygon[i + 1], dataArea, ↵ | | 4 | y = rangeAxis.valueToJava2D(this.polygon[i + 1], dataArea, ↵
|
5 | rangeEdge);↵ | | 5 | rangeEdge);↵
|
6 | area.lineTo((float) y, (float) x);↵ | | 6 | area.lineTo((float) x, (float) y);↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 17 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 28.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | for (int i = 2; i < this.polygon.length; i += 2) | | 18 | for (int i = 2; i < this.polygon.length; i += 2) |
12 | x = domainAxis.valueToJava2D(this.polygon[i], dataArea, domainEdge); | | 19 | x = domainAxis.valueToJava2D(this.polygon[i], dataArea, domainEdge); |
13 | y = rangeAxis.valueToJava2D(this.polygon[i + 1], dataArea, rangeEdge); | | 20 | y = rangeAxis.valueToJava2D(this.polygon[i + 1], dataArea, rangeEdge); |
14 | area.lineTo((float)y, (float)x); | | 21 | area.lineTo((float)x, (float)y); |
Precondition Violations (4)
Row |
Violation |
1 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |