File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/columns/ColumnConfigDialog.java | File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/command/PopulateRoasterCommand.java | |||
Method name: XmlElement findColumn(XmlElement, String)
|
Method name: DefaultMutableTreeNode findGroup(DefaultMutableTreeNode, RosterGroup)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | for (int i = 0; i < parent.count(); i++) {↵ | 1 | for (int i = 0; i < parent.getChildCount(); i++) {↵ | |
2 | XmlElement child = parent.getElemen↵ | 2 | DefaultMutableTreeNode child = (DefaultMutableTreeNode) parent↵ | |
3 | t(i);↵ | 3 | .getChildAt(i);↵ | |
4 | if (child.getAttribute("name").equals(name)) {↵ | 4 | if (group.equals(child.getUserObject()))↵ | |
5 | return child;↵ | 5 | return child;↵ | |
6 | }↵ | |||
7 | }↵ | 6 | }↵ | |
8 | return null; | 7 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
Number of mapped statements | 2 |
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) | 8.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | for (int i = 0; i < parent.count(); i++) |
| 1 | for (int i = 0; i < parent.getChildCount(); i++) | ||||||||||||||
|
| 2 | DefaultMutableTreeNode child = (DefaultMutableTreeNode)parent.getChildAt(i); | |||||||||||||||
2 | XmlElement child = parent.getElement(i); |
| | |||||||||||||||
| 3 | if (group.equals(child.getUserObject())) | ||||||||||||||||
|
| 4 | return child; | |||||||||||||||
3 | if (child.getAttribute("name").equals(name)) | | ||||||||||||||||
4 | return child; |
| | |||||||||||||||
5 | return null; | 5 | return null; |
Row | Violation |
---|---|
1 | Type org.columba.core.xml.XmlElement of variable parent does not match with type javax.swing.tree.DefaultMutableTreeNode of variable parent |
2 | Unmatched statement DefaultMutableTreeNode child=(DefaultMutableTreeNode)parent.getChildAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement XmlElement child=parent.getElement(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return child; |
5 | Unmatched return child; |
6 | The refactoring of the clones is infeasible, because classes org.columba.mail.gui.config.columns.ColumnConfigDialog and org.columba.chat.command.PopulateRoasterCommand do not have a common superclass |