for(int i = 2; i < comp.length; i++)
{
int btnHeight = comp[i].getPreferredSize().height;
if(btnHeight + y > height)
{
returnValue.width += colWidth;
y = insets.top;
}
y += btnHeight;
}
for(int i = 2; i < comp.length; i++)
{
int btnHeight = comp[i].getPreferredSize().height;
if(btnHeight + y > height)
{
returnValue.width += colWidth;
y = insets.top;
}
y += btnHeight;
}
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: 6
|
|
Number of AST nodes: 6
|
|
1 | for(int i = 2; i < comp.length; i++)↵ | | 1 | for(int i = 2; i < comp.length; i++)↵
|
2 | {↵ | | 2 | {↵
|
3 | int btnHeight = comp[i].getPreferredSize().height;↵ | | 3 | int btnHeight = comp[i].getPreferredSize().height;↵
|
4 | if(btnHeight + y > height)↵ | | 4 | if(btnHeight + y > height)↵
|
5 | {↵ | | 5 | {↵
|
6 | returnValue.width += colWidth;↵ | | 6 | returnValue.width += colWidth;↵
|
7 | y = insets.top;↵ | | 7 | y = insets.top;↵
|
8 | }↵ | | 8 | }↵
|
|
9 | y += btnHeight;↵ | | 9 | y += btnHeight;↵
|
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 21 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
22 | for (int i = 2; i < comp.length; i++) | | 22 | for (int i = 2; i < comp.length; i++) |
23 | int btnHeight = comp[i].getPreferredSize().height; | | 23 | int btnHeight = comp[i].getPreferredSize().height; |
24 | if (btnHeight + y > height) | | 24 | if (btnHeight + y > height) |
25 | returnValue.width += colWidth; | | 25 | returnValue.width += colWidth; |
26 | | | 26 | |
27 | | | 27 | |
Precondition Violations (0)
Row |
Violation |