int btnWidth = comp[i].getPreferredSize().width;
if(btnWidth + x > width)
{
returnValue.height += rowHeight;
x = insets.left;
}
x += btnWidth;
int btnWidth = comp[i].getPreferredSize().width;
if(btnWidth + x > width)
{
returnValue.height += rowHeight;
x = insets.left;
}
x += btnWidth;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java
|
Method name: int getWrappedDimension(JComponent, int)
|
|
Method name: Dimension preferredLayoutSize(Container)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | int btnWidth = comp[i].getPreferredSize().width;↵ | | 1 | int btnWidth = comp[i].getPreferredSize().width;↵
|
2 | if(btnWidth + x > width)↵ | | 2 | if(btnWidth + x > width)↵
|
3 | {↵ | | 3 | {↵
|
4 | returnValue.height += rowHeight;↵ | | 4 | returnValue.height += rowHeight;↵
|
5 | x = insets.left;↵ | | 5 | x = insets.left;↵
|
6 | }↵ | | 6 | }↵
|
|
7 | x += btnWidth; | | 7 | x += btnWidth;
|
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 declared in the same class |
Number of node comparisons | 14 |
-
{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) | 3.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | int btnWidth = comp[i].getPreferredSize().width; | | 12 | int btnWidth = comp[i].getPreferredSize().width; |
13 | if (btnWidth + x > width) | | 13 | if (btnWidth + x > width) |
14 | returnValue.height += rowHeight; | | 14 | returnValue.height += rowHeight; |
15 | | | 15 | |
16 | x += btnWidth; | | 16 | x += btnWidth; |
Precondition Violations (0)
Row |
Violation |