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: 11 | Number of AST nodes: 11 | |||
1 | int width = dimension - insets.right;↵ | 1 | int width = parent.getWidth() - insets.right;↵ | |
2 | int rowHeight = Math.max(dim.height,closeBox.getPreferredSize().width);↵ | 2 | int rowHeight = Math.max(dim.height,closeBox.getPreferredSize().width);↵ | |
3 | int x = rowHeight * 2 + insets.left;↵ | 3 | int x = rowHeight * 2 + insets.left;↵ | |
4 | Dimension returnValue = new Dimension(0,rowHeight↵ | 4 | Dimension returnValue = new Dimension(0,rowHeight↵ | |
5 | + insets.top + insets.bottom);↵ | 5 | + insets.top + insets.bottom);↵ | |
6 | for(int i = 2; i < comp.length; i++)↵ | 6 | for(int i = 2; i < comp.length; i++)↵ | |
7 | {↵ | 7 | {↵ | |
8 | int btnWidth = comp[i].getPreferredSize().width;↵ | 8 | int btnWidth = comp[i].getPreferredSize().width;↵ | |
9 | if(btnWidth + x > width)↵ | 9 | if(btnWidth + x > width)↵ | |
10 | {↵ | 10 | {↵ | |
11 | returnValue.height += rowHeight;↵ | 11 | returnValue.height += rowHeight;↵ | |
12 | x = insets.left;↵ | 12 | x = insets.left;↵ | |
13 | }↵ | 13 | }↵ | |
14 | x += btnWidth;↵ | 14 | x += btnWidth;↵ | |
15 | }↵ | 15 | }↵ | |
16 | return returnValue.height; | 16 | return returnValue; | |
See real code fragment | See real code fragment |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 36 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 3.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | int width = dimension - insets.right; |
| 7 | int width = parent.getWidth() - insets.right; | ||||||||||
8 | int rowHeight = Math.max(dim.height, closeBox.getPreferredSize().width); | 8 | int rowHeight = Math.max(dim.height, closeBox.getPreferredSize().width); | |||||||||||
9 | int x = rowHeight * 2 + insets.left; | 9 | int x = rowHeight * 2 + insets.left; | |||||||||||
10 | Dimension returnValue = new Dimension(0, rowHeight + insets.top + insets.bottom); | 10 | Dimension returnValue = new Dimension(0, rowHeight + insets.top + insets.bottom); | |||||||||||
11 | for (int i = 2; i < comp.length; i++) | 11 | for (int i = 2; i < comp.length; i++) | |||||||||||
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 | x = insets.left; | 15 | x = insets.left; | |||||||||||
16 | x += btnWidth; | 16 | x += btnWidth; | |||||||||||
| 17 | return returnValue; | ||||||||||||
17 | return returnValue.height; | |
Row | Violation |
---|