File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java | |||
Method name: Dimension preferredLayoutSize(Container)
|
Method name: Dimension minimumLayoutSize(Container)
|
|||
Number of AST nodes: 21 | Number of AST nodes: 21 | |||
1 | Dimension dim = new Dimension();↵ | 1 | Dimension dim = new Dimension();↵ | |
2 | Border border = getBorder();↵ | 2 | Border border = getBorder();↵ | |
3 | Insets insets;↵ | 3 | Insets insets;↵ | |
4 | if(border == null)↵ | 4 | if(border == null)↵ | |
5 | insets = new Insets(0,0,0,0);↵ | 5 | insets = new Insets(0,0,0,0);↵ | |
6 | else↵ | 6 | else↵ | |
7 | {↵ | 7 | {↵ | |
8 | insets = getBorder().getBorderInsets(↵ | 8 | insets = getBorder().getBorderInsets(↵ | |
9 | JEditTextArea.this);↵ | 9 | JEditTextArea.this);↵ | |
10 | }↵ | 10 | }↵ | |
11 | dim.width = insets.left + insets.right;↵ | 11 | dim.width = insets.left + insets.right;↵ | |
12 | dim.height = insets.top + insets.bottom;↵ | 12 | dim.height = insets.top + insets.bottom;↵ | |
13 | Dimension leftPref = left.getPreferredSize();↵ | 13 | Dimension leftPref = left.getMinimumSize();↵ | |
14 | dim.width += leftPref.width;↵ | 14 | dim.width += leftPref.width;↵ | |
15 | Dimension centerPref = center.getPreferredSize();↵ | 15 | Dimension centerPref = center.getMinimumSize();↵ | |
16 | dim.width += centerPref.width;↵ | 16 | dim.width += centerPref.width; ↵ | |
17 | dim.height += centerPref.height;↵ | 17 | dim.height += centerPref.height;↵ | |
18 | Dimension rightPref = right.getPreferredSize();↵ | 18 | Dimension rightPref = right.getMinimumSize();↵ | |
19 | dim.width += rightPref.width;↵ | 19 | dim.width += rightPref.width;↵ | |
20 | Dimension bottomPref = bottom.getPreferredSize();↵ | 20 | Dimension bottomPref = bottom.getMinimumSize();↵ | |
21 | dim.height += bottomPref.height;↵ | 21 | dim.height += bottomPref.height;↵ | |
22 | if(top != null)↵ | 22 | if(top != null)↵ | |
23 | {↵ | 23 | {↵ | |
24 | Dimension topPref = top.getPreferredSize();↵ | 24 | Dimension topPref = top.getMinimumSize();↵ | |
25 | dim.height += topPref.height;↵ | 25 | dim.height += topPref.height;↵ | |
26 | }↵ | 26 | }↵ | |
27 | ↵ | |||
27 | return dim; | 28 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 141 |
Number of mapped statements | 21 |
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) | 17.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Dimension dim = new Dimension(); | 1 | Dimension dim = new Dimension(); | |||||||||||||
2 | Border border = getBorder(); | 2 | Border border = getBorder(); | |||||||||||||
3 | Insets insets; | 3 | Insets insets; | |||||||||||||
4 | if (border == null) | 4 | if (border == null) | |||||||||||||
5 | insets = new Insets(0, 0, 0, 0); | 5 | insets = new Insets(0, 0, 0, 0); | |||||||||||||
else | else | |||||||||||||||
6 | insets = getBorder().getBorderInsets(JEditTextArea.this); | 6 | insets = getBorder().getBorderInsets(JEditTextArea.this); | |||||||||||||
7 | dim.width = insets.left + insets.right; | 7 | dim.width = insets.left + insets.right; | |||||||||||||
8 | dim.height = insets.top + insets.bottom; | 8 | dim.height = insets.top + insets.bottom; | |||||||||||||
9 | Dimension leftPref = left.getPreferredSize(); |
| 9 | Dimension leftPref = left.getMinimumSize(); | ||||||||||||
10 | dim.width += leftPref.width; | 10 | dim.width += leftPref.width; | |||||||||||||
11 | Dimension centerPref = center.getPreferredSize(); |
| 11 | Dimension centerPref = center.getMinimumSize(); | ||||||||||||
12 | dim.width += centerPref.width; | 12 | dim.width += centerPref.width; | |||||||||||||
13 | dim.height += centerPref.height; | 13 | dim.height += centerPref.height; | |||||||||||||
14 | Dimension rightPref = right.getPreferredSize(); |
| 14 | Dimension rightPref = right.getMinimumSize(); | ||||||||||||
15 | dim.width += rightPref.width; | 15 | dim.width += rightPref.width; | |||||||||||||
16 | Dimension bottomPref = bottom.getPreferredSize(); |
| 16 | Dimension bottomPref = bottom.getMinimumSize(); | ||||||||||||
17 | dim.height += bottomPref.height; | 17 | dim.height += bottomPref.height; | |||||||||||||
18 | if (top != null) | 18 | if (top != null) | |||||||||||||
19 | Dimension topPref = top.getPreferredSize(); |
| 19 | Dimension topPref = top.getMinimumSize(); | ||||||||||||
20 | dim.height += topPref.height; | 20 | dim.height += topPref.height; | |||||||||||||
21 | return dim; | 21 | return dim; |
Row | Violation |
---|---|
1 | Expression top.getPreferredSize() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression top.getMinimumSize() cannot be parameterized, because it has dependencies to/from statements that will be extracted |