File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/themes/plugin/PlasticLookAndFeelConfigPlugin.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/template/HeaderCellRenderer.java | |||
Method name: ListCellRenderer createThemeRenderer()
|
Method name: Component getListCellRendererComponent(JList, Object, int, boolean, boolean)
|
|||
Number of AST nodes: 1 | Number of AST nodes: 5 | |||
1 | return new DefaultListCellRenderer() {↵ | |||
2 | public Component getListCellRendererComponent(JList list,↵ | |||
3 | Object value, int index, boolean isSelected,↵ | |||
4 | boolean cellHasFocus) {↵ | |||
5 | JLabel label = (JLabel) super.getListCellRendererComponent(list,↵ | |||
6 | value, index, isSelected, cellHasFocus);↵ | |||
7 | PlasticTheme theme = (PlasticTheme) value;↵ | |||
8 | ↵ | 1 | super.getListCellRendererComponent(arg0, arg1, arg2, arg3, arg4);↵ | |
2 | ColumbaHeader header = (ColumbaHeader) list.get(arg1);↵ | |||
3 | String subject = (String) header.get("columba.subject");↵ | |||
9 | label.setText(theme.getName());↵ | 4 | setText(↵ | |
10 | ↵ | 5 | subject);↵ | |
11 | return label;↵ | 6 | return ↵ | |
12 | }↵ | |||
13 | }; | 7 | this; | |
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | super.getListCellRendererComponent(arg0, arg1, arg2, arg3, arg4); | |||||||||||||||||
| 2 | ColumbaHeader header = (ColumbaHeader)list.get(arg1); | |||||||||||||||||
| 3 | String subject = (String)header.get("columba.subject"); | |||||||||||||||||
|
| 4 | setText(subject); | ||||||||||||||||
1 | return new DefaultListCellRenderer() {...}; |
| 5 | return this; |
Row | Violation |
---|---|
1 | Unmatched statement setText(subject); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Expression new DefaultListCellRenderer(){ public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus){ JLabel label=(JLabel)super.getListCellRendererComponent(list,value,index,isSelected,cellHasFocus); PlasticTheme theme=(PlasticTheme)value; label.setText(theme.getName()); return label; } } cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Super method call return new DefaultListCellRenderer(){ public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus){ JLabel label=(JLabel)super.getListCellRendererComponent(list,value,index,isSelected,cellHasFocus); PlasticTheme theme=(PlasticTheme)value; label.setText(theme.getName()); return label; } } ; cannot be extracted from method |
4 | The refactoring of the clones is infeasible, because classes org.columba.core.gui.themes.plugin.PlasticLookAndFeelConfigPlugin and org.columba.mail.gui.config.template.HeaderCellRenderer do not have a common superclass |