Size2D s = arrangeFN(container, g2, constraint);
if (constraint.getHeightRange().contains(s.height)) {
return s;
}
else {
RectangleConstraint c = constraint.toFixedHeight(
constraint.getHeightRange().constrain(s.getHeight()));
return arrangeFF(container, g2, c);
}
Size2D s = arrangeFN(container, g2, constraint);
if (constraint.getHeightRange().contains(s.height)) {
return s;
}
else {
RectangleConstraint c = constraint.toFixedHeight(
constraint.getHeightRange().constrain(s.getHeight())
);
return arrangeFF(container, g2, c);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/CenterArrangement.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/FlowArrangement.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 | Size2D s = arrangeFN(container, g2, constraint);↵ | | 1 | Size2D s = arrangeFN(container, g2, constraint);↵
|
2 | if (constraint.getHeightRange().contains(s.height)) {↵ | | 2 | if (constraint.getHeightRange().contains(s.height)) {↵
|
3 | return s; ↵ | | 3 | return s; ↵
|
4 | }↵ | | 4 | }↵
|
5 | else {↵ | | 5 | else {↵
|
6 | RectangleConstraint c = constraint.toFixedHeight(↵ | | 6 | RectangleConstraint c = constraint.toFixedHeight(↵
|
7 | constraint.getHeightRange().constrain(s.getHeight())↵ | | 7 | constraint.getHeightRange().constrain(s.getHeight())↵
|
8 | );↵ | | 8 | );↵
|
9 | return arrangeFF(container, g2, c);↵ | | 9 | return arrangeFF(container, g2, c);↵
|
10 | } | | 10 | }
|
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 | 17 |
-
{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) | 1.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Size2D s = arrangeFN(container, g2, constraint); | | 1 | Size2D s = arrangeFN(container, g2, constraint); |
2 | if (constraint.getHeightRange().contains(s.height)) | | 2 | if (constraint.getHeightRange().contains(s.height)) |
3 | | | 3 | |
| | | | |
4 | RectangleConstraint c = constraint.toFixedHeight(constraint.getHeightRange().constrain(s.getHeight())); | | 4 | RectangleConstraint c = constraint.toFixedHeight(constraint.getHeightRange().constrain(s.getHeight())); |
5 | return arrangeFF(container, g2, c); | | 5 | return arrangeFF(container, g2, c); |
Precondition Violations (0)
Row |
Violation |