if (orientation == PlotOrientation.HORIZONTAL) {
double xx = axis.valueToJava2D(value, dataArea,
RectangleEdge.BOTTOM);
line = new Line2D.Double(xx, dataArea.getMinY(), xx,
dataArea.getMaxY());
}
else {
double yy = axis.valueToJava2D(value, dataArea,
RectangleEdge.LEFT);
line = new Line2D.Double(dataArea.getMinX(), yy,
dataArea.getMaxX(), yy);
}
if (orientation == PlotOrientation.VERTICAL) {
double xx = axis.valueToJava2D(value, dataArea,
RectangleEdge.BOTTOM);
line = new Line2D.Double(xx, dataArea.getMinY(), xx,
dataArea.getMaxY());
}
else {
double yy = axis.valueToJava2D(value, dataArea,
RectangleEdge.LEFT);
line = new Line2D.Double(dataArea.getMinX(), yy,
dataArea.getMaxX(), yy);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
|
Method name: void drawRangeCrosshair(Graphics2D, Rectangle2D, PlotOrientation, double, ValueAxis, Stroke, Paint)
|
|
Method name: void drawDomainCrosshair(Graphics2D, Rectangle2D, PlotOrientation, double, ValueAxis, Stroke, Paint)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | | 1 | if (orientation == PlotOrientation.VERTICAL) {↵
|
2 | double xx = axis.valueToJava2D(value, dataArea,↵ | | 2 | double xx = axis.valueToJava2D(value, dataArea,↵
|
3 | RectangleEdge.BOTTOM);↵ | | 3 | RectangleEdge.BOTTOM);↵
|
4 | line = new Line2D.Double(xx, dataArea.getMinY(), xx,↵ | | 4 | line = new Line2D.Double(xx, dataArea.getMinY(), xx,↵
|
5 | dataArea.getMaxY());↵ | | 5 | dataArea.getMaxY());↵
|
6 | }↵ | | 6 | ↵
|
| | | 7 | }↵
|
7 | else {↵ | | 8 | else {↵
|
8 | double yy = axis.valueToJava2D(value, dataArea,↵ | | 9 | double yy = axis.valueToJava2D(value, dataArea,↵
|
9 | RectangleEdge.LEFT);↵ | | 10 | RectangleEdge.LEFT);↵
|
10 | line = new Line2D.Double(dataArea.getMinX(), yy,↵ | | 11 | line = new Line2D.Double(dataArea.getMinX(), yy,↵
|
11 | dataArea.getMaxX(), yy);↵ | | 12 | dataArea.getMaxX(), yy);↵
|
12 | } | | 13 | }
|
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 8.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (orientation == PlotOrientation.HORIZONTAL) | | 3 | if (orientation == PlotOrientation.VERTICAL) |
5 | double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM); | | 4 | double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM); |
6 | line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY()); | | 5 | line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY()); |
| | | | |
7 | double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); | | 6 | double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); |
8 | line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy); | | 7 | line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy); |
Precondition Violations (0)
Row |
Violation |