File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/GUIFactory.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/GUIFactory.java | |||
Method name: ImageIcon getIcon(Class, boolean)
|
Method name: JComponent getGUI(Class)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | String key = elementClass.getName();↵ | 1 | String key = elementClass.getName();↵ | |
2 | ImageIcon icon = (ImageIcon) (enabled ? ICON_MAP.get(key) : DISABLED_ICON_MAP.get(key));↵ | 2 | JComponent gui = (JComponent) GUI_MAP.get(key);↵ | |
3 | if (icon != null) {↵ | 3 | if (gui != null) {↵ | |
4 | return icon;↵ | 4 | return gui;↵ | |
5 | }↵ | 5 | }↵ | |
6 | if (elementClass.getSuperclass() != null) {↵ | 6 | if (elementClass.getSuperclass() != null) {↵ | |
7 | return getIcon(elementClass.getSuperclass(), enabled);↵ | 7 | return getGUI(elementClass.getSuperclass());↵ | |
8 | }↵ | 8 | }↵ | |
9 | return null; | 9 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String key = elementClass.getName(); | 1 | String key = elementClass.getName(); | |||||||||||||||
|
| 2 | JComponent gui = (JComponent)GUI_MAP.get(key); | |||||||||||||||
2 | ImageIcon icon = (ImageIcon)(enabled ? ICON_MAP.get(key) : DISABLED_ICON_MAP.get(key)); |
| | |||||||||||||||
3 | if (icon != null) |
| 3 | if (gui != null) | ||||||||||||||
|
| 4 | return gui; | |||||||||||||||
4 | return icon; |
| | |||||||||||||||
5 | if (elementClass.getSuperclass() != null) | 5 | if (elementClass.getSuperclass() != null) | |||||||||||||||
|
| 6 | return getGUI(elementClass.getSuperclass()); | |||||||||||||||
6 | return getIcon(elementClass.getSuperclass(), enabled); |
| | |||||||||||||||
7 | return null; | 7 | return null; |
Row | Violation |
---|---|
1 | Unmatched statement JComponent gui=(JComponent)GUI_MAP.get(key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement ImageIcon icon=(ImageIcon)(enabled ? ICON_MAP.get(key) : DISABLED_ICON_MAP.get(key)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type javax.swing.ImageIcon of variable icon does not match with type javax.swing.JComponent of variable gui |
4 | Unmatched return gui; |
5 | Unmatched return icon; |
6 | Unmatched statement return getGUI(elementClass.getSuperclass()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched return getGUI(elementClass.getSuperclass()); |
8 | Unmatched statement return getIcon(elementClass.getSuperclass(),enabled); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | Unmatched return getIcon(elementClass.getSuperclass(),enabled); |