if (orientation == PlotOrientation.VERTICAL) {
double y0 = axis.valueToJava2D(value, adjusted,
plot.getRangeAxisEdge());
double y1 = y0 - getYOffset();
double x0 = dataArea.getMinX();
double x1 = x0 + getXOffset();
double x2 = dataArea.getMaxX();
line1 = new Line2D.Double(x0, y0, x1, y1);
line2 = new Line2D.Double(x1, y1, x2, y1);
}
if (orientation == PlotOrientation.VERTICAL) {
double y0 = axis.valueToJava2D(value, adjusted,
plot.getRangeAxisEdge());
double y1 = y0 - getYOffset();
double x0 = dataArea.getMinX();
double x1 = x0 + getXOffset();
double x2 = dataArea.getMaxX();
line1 = new Line2D.Double(x0, y0, x1, y1);
line2 = new Line2D.Double(x1, y1, x2, y1);
}
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 drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis, Rectangle2D, double)
|
|
Method name: void drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis, Rectangle2D, double)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if (orientation == PlotOrientation.VERTICAL) {↵ | | 1 | if (orientation == PlotOrientation.VERTICAL) {↵
|
2 | double y0 = axis.valueToJava2D(value, adjusted,↵ | | 2 | double y0 = axis.valueToJava2D(value, adjusted,↵
|
3 | plot.getRangeAxisEdge());↵ | | 3 | plot.getRangeAxisEdge());↵
|
4 | double y1 = y0 - getYOffset();↵ | | 4 | double y1 = y0 - getYOffset();↵
|
5 | double x0 = dataArea.getMinX();↵ | | 5 | double x0 = dataArea.getMinX();↵
|
6 | double x1 = x0 + getXOffset();↵ | | 6 | double x1 = x0 + getXOffset();↵
|
7 | double x2 = dataArea.getMaxX();↵ | | 7 | double x2 = dataArea.getMaxX();↵
|
8 | line1 = new Line2D.Double(x0, y0, x1, y1);↵ | | 8 | line1 = new Line2D.Double(x0, y0, x1, y1);↵
|
9 | line2 = new Line2D.Double(x1, y1, x2, y1);↵ | | 9 | line2 = new Line2D.Double(x1, y1, x2, y1);↵
|
10 | } | | 10 | }
|
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) | 17.5 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
16 | else if (orientation == PlotOrientation.VERTICAL) | | 16 | else if (orientation == PlotOrientation.VERTICAL) |
17 | double y0 = axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()); | | 17 | double y0 = axis.valueToJava2D(value, adjusted, plot.getRangeAxisEdge()); |
18 | double y1 = y0 - getYOffset(); | | 18 | double y1 = y0 - getYOffset(); |
19 | double x0 = dataArea.getMinX(); | | 19 | double x0 = dataArea.getMinX(); |
20 | double x1 = x0 + getXOffset(); | | 20 | double x1 = x0 + getXOffset(); |
21 | double x2 = dataArea.getMaxX(); | | 21 | double x2 = dataArea.getMaxX(); |
22 | line1 = new Line2D.Double(x0, y0, x1, y1); | | 22 | line1 = new Line2D.Double(x0, y0, x1, y1); |
23 | line2 = new Line2D.Double(x1, y1, x2, y1); | | 23 | line2 = new Line2D.Double(x1, y1, x2, y1); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables line1, line2 , while Clone fragment #2 returns variables line1, line2 |