int btnHeight = comp[i].getPreferredSize().height; if(btnHeight + y > height) { returnValue.width += colWidth; y = insets.top; } y += btnHeight;
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: Dimension preferredLayoutSize(Container) Method name: int getWrappedDimension(JComponent, int)
Number of AST nodes: 5 Number of AST nodes: 5
1
int btnHeight = comp[i].getPreferredSize().height;
1
int btnHeight = comp[i].getPreferredSize().height;
2
					if(btnHeight + y > height)
2
					if(btnHeight + y > height)
3
					{
3
					{
4
						returnValue.width += colWidth;
4
						returnValue.width += colWidth;
5
						y = insets.top;
5
						y = insets.top;
6
					}
6
					}
7
					y += btnHeight;
7
					y += btnHeight;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.3
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    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
    y = insets.top;
    26
    y = insets.top;
    27
    y += btnHeight;
    27
    y += btnHeight;
    Precondition Violations (0)
    Row Violation