if (orientation == PlotOrientation.VERTICAL) {
double x0 = value;
double x1 = value + getXOffset();
double y0 = dataArea.getMaxY();
double y1 = y0 - getYOffset();
double y2 = dataArea.getMinY();
line1 = new Line2D.Double(x0, y0, x1, y1);
line2 = new Line2D.Double(x1, y1, x1, y2);
}
if (orientation == PlotOrientation.VERTICAL) {
double x0 = value;
double x1 = value + getXOffset();
double y0 = dataArea.getMaxY();
double y1 = y0 - getYOffset();
double y2 = dataArea.getMinY();
line1 = new Line2D.Double(x0, y0, x1, y1);
line2 = new Line2D.Double(x1, y1, x1, y2);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer3D.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LineRenderer3D.java
|
Method name: void drawDomainGridline(Graphics2D, CategoryPlot, Rectangle2D, double)
|
|
Method name: void drawDomainGridline(Graphics2D, CategoryPlot, Rectangle2D, double)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if (orientation == PlotOrientation.VERTICAL) {↵ | | 1 | if (orientation == PlotOrientation.VERTICAL) {↵
|
2 | double x0 = value;↵ | | 2 | double x0 = value;↵
|
3 | double x1 = value + getXOffset();↵ | | 3 | double x1 = value + getXOffset();↵
|
4 | double y0 = dataArea.getMaxY();↵ | | 4 | double y0 = dataArea.getMaxY();↵
|
5 | double y1 = y0 - getYOffset();↵ | | 5 | double y1 = y0 - getYOffset();↵
|
6 | double y2 = dataArea.getMinY();↵ | | 6 | double y2 = dataArea.getMinY();↵
|
7 | line1 = new Line2D.Double(x0, y0, x1, y1);↵ | | 7 | line1 = new Line2D.Double(x0, y0, x1, y1);↵
|
8 | line2 = new Line2D.Double(x1, y1, x1, y2);↵ | | 8 | line2 = new Line2D.Double(x1, y1, x1, y2);↵
|
9 | } | | 9 | }
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 64 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 3.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | else if (orientation == PlotOrientation.VERTICAL) | | 12 | else if (orientation == PlotOrientation.VERTICAL) |
13 | | | 13 | |
14 | double x1 = value + getXOffset(); | | 14 | double x1 = value + getXOffset(); |
15 | double y0 = dataArea.getMaxY(); | | 15 | double y0 = dataArea.getMaxY(); |
16 | double y1 = y0 - getYOffset(); | | 16 | double y1 = y0 - getYOffset(); |
17 | double y2 = dataArea.getMinY(); | | 17 | double y2 = dataArea.getMinY(); |
18 | line1 = new Line2D.Double(x0, y0, x1, y1); | | 18 | line1 = new Line2D.Double(x0, y0, x1, y1); |
19 | line2 = new Line2D.Double(x1, y1, x1, y2); | | 19 | line2 = new Line2D.Double(x1, y1, x1, y2); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables line1, line2 , while Clone fragment #2 returns variables line1, line2 |