if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {
x = dataArea.getMaxX();
y = cursor;
arrow = this.rightArrow;
}
else if (edge == RectangleEdge.LEFT
|| edge == RectangleEdge.RIGHT) {
x = cursor;
y = dataArea.getMinY();
arrow = this.upArrow;
}
if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {
x = dataArea.getMinX();
y = cursor;
arrow = this.leftArrow;
}
else if (edge == RectangleEdge.LEFT
|| edge == RectangleEdge.RIGHT) {
x = cursor;
y = dataArea.getMaxY();
arrow = this.downArrow;
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java
|
Method name: void drawAxisLine(Graphics2D, double, Rectangle2D, RectangleEdge)
|
|
Method name: void drawAxisLine(Graphics2D, double, Rectangle2D, RectangleEdge)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {↵ | | 1 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) {↵
|
2 | x = dataArea.getMaxX();↵ | | 2 | x = dataArea.getMinX();↵
|
3 | y = cursor;↵ | | 3 | y = cursor;↵
|
4 | arrow = this.rightArrow;↵ | | 4 | arrow = this.leftArrow;↵
|
5 | }↵ | | 5 | }↵
|
6 | else if (edge == RectangleEdge.LEFT↵ | | 6 | else if (edge == RectangleEdge.LEFT↵
|
7 | || edge == RectangleEdge.RIGHT) {↵ | | 7 | || edge == RectangleEdge.RIGHT) {↵
|
8 | x = cursor;↵ | | 8 | x = cursor;↵
|
9 | y = dataArea.getMinY();↵ | | 9 | y = dataArea.getMaxY();↵
|
10 | arrow = this.upArrow;↵ | | 10 | arrow = this.downArrow;↵
|
11 | } | | 11 | }
|
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.8 |
Clones location | Clones are in the same method |
Number of node comparisons | 50 |
-
{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) | 7.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
27 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) | | 44 | if (edge == RectangleEdge.TOP || edge == RectangleEdge.BOTTOM) |
28 | | | 45 | |
29 | | | 46 | |
30 | | | 47 | |
31 | else if (edge == RectangleEdge.LEFT || edge == RectangleEdge.RIGHT) | | 48 | else if (edge == RectangleEdge.LEFT || edge == RectangleEdge.RIGHT) |
32 | | | 49 | |
33 | | | 50 | |
34 | | | 51 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables x, y, arrow , while Clone fragment #2 returns variables x, y, arrow |