if (constraint.getHeightRange().contains(size1.getHeight())) {
return size1;
}
else {
double h = constraint.getHeightRange().constrain(size1.getHeight());
RectangleConstraint c2 = constraint.toFixedHeight(h);
return arrange(container, g2, c2);
}
if (constraint.getHeightRange().contains(size1.getHeight())) {
return size1;
}
else {
double h = constraint.getHeightRange().constrain(size1.getHeight());
RectangleConstraint c2 = constraint.toFixedHeight(h);
return arrange(container, g2, c2);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BorderArrangement.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/GridArrangement.java
|
Method name: Size2D arrangeFR(BlockContainer, Graphics2D, RectangleConstraint)
|
|
Method name: Size2D arrangeFR(BlockContainer, Graphics2D, RectangleConstraint)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (constraint.getHeightRange().contains(size1.getHeight())) {↵ | | 1 | if (constraint.getHeightRange().contains(size1.getHeight())) {↵
|
2 | return size1;↵ | | 2 | return size1; ↵
|
3 | }↵ | | 3 | }↵
|
4 | else {↵ | | 4 | else {↵
|
5 | double h = constraint.getHeightRange().constrain(size1.getHeight());↵ | | 5 | double h = constraint.getHeightRange().constrain(size1.getHeight());↵
|
6 | RectangleConstraint c2 = constraint.toFixedHeight(h);↵ | | 6 | RectangleConstraint c2 = constraint.toFixedHeight(h);↵
|
7 | return arrange(container, g2, c2);↵ | | 7 | return arrange(container, g2, c2);↵
|
8 | } | | 8 | }
|
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.2 |
Clones location | Clones are in different classes |
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) | 2.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | if (constraint.getHeightRange().contains(size1.getHeight())) | | 3 | if (constraint.getHeightRange().contains(size1.getHeight())) |
3 | | | 4 | |
| | | | |
4 | double h = constraint.getHeightRange().constrain(size1.getHeight()); | | 5 | double h = constraint.getHeightRange().constrain(size1.getHeight()); |
5 | RectangleConstraint c2 = constraint.toFixedHeight(h); | | 6 | RectangleConstraint c2 = constraint.toFixedHeight(h); |
6 | return arrange(container, g2, c2); | | 7 | return arrange(container, g2, c2); |
Precondition Violations (0)
Row |
Violation |