if (path != null) {
treeNode = (AddressbookTreeNode) path.getLastPathComponent();
}
// enable, if more than zero treenodes selected
if ((path != null) && (treeNode instanceof IGroupFolder)) {
setEnabled(true);
} else
setEnabled(false);
if (path != null) {
treeNode = (AddressbookTreeNode) path.getLastPathComponent();
}
// enable, if more than zero treenodes selected
if ( (path != null) && ( treeNode instanceof AddressbookFolder ) ){
setEnabled(true);
} else {
setEnabled(false);
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/action/RemoveCardAction.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/action/DefaultTreeAction.java
|
Method name: void valueChanged(TreeSelectionEvent)
|
|
Method name: void valueChanged(TreeSelectionEvent)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (path != null) {↵ | | 1 | if (path != null) {↵
|
2 | treeNode = (AddressbookTreeNode) path.getLastPathComponent();↵ | | 2 | treeNode = (AddressbookTreeNode) path.getLastPathComponent();↵
|
3 | }↵ | | 3 | }↵
|
|
4 | // enable, if more than zero treenodes selected↵ | | 4 | // enable, if more than zero treenodes selected↵
|
5 | if ((path != null) && (treeNode instanceof IGroupFolder)) {↵ | | 5 | if ( (path != null) && ( treeNode instanceof AddressbookFolder ) ){↵
|
6 | setEnabled(true);↵ | | 6 | setEnabled(true);↵
|
7 | } else↵ | | 7 | } else {↵
|
8 | setEnabled(false); | | 8 | setEnabled(false);↵
|
| | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 in different classes having the same super class |
Number of node comparisons | 20 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | if (path != null) | | 2 | if (path != null) |
7 | treeNode = (AddressbookTreeNode)path.getLastPathComponent(); | | 3 | treeNode = (AddressbookTreeNode)path.getLastPathComponent(); |
8 | if ((path != null) && (treeNode instanceof IGroupFolder)) | | 4 | if ((path != null) && (treeNode instanceof AddressbookFolder)) |
9 | | | 5 | |
| | | | |
10 | | | 6 | |
Precondition Violations (3)
Row |
Violation |
1 | Expression treeNode instanceof IGroupFolder cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression treeNode instanceof AddressbookFolder cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type boolean of variable treeNode instanceof IGroupFolder does not match with type boolean of variable treeNode instanceof AddressbookFolder |