while (it.hasNext()) {
IFolder folder = it.next();
if (!showRootFolders) {
//if (folder instanceof IContactFolder)
addItem(folder);
}
}
while (it.hasNext()) {
IFolder folder = it.next();
if (!showRootFolders) {
if (folder instanceof IContactFolder)
addItem(folder);
}
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/contact/FolderComboBox.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/base/FolderComboBox.java
|
Method name: void FolderComboBox(boolean)
|
|
Method name: void FolderComboBox(boolean)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 5
|
|
1 | while (it.hasNext()) {↵ | | 1 | while (it.hasNext()) {↵
|
2 | IFolder folder = it.next();↵ | | 2 | IFolder folder = it.next();↵
|
3 | if (!showRootFolders) {↵ | | 3 | if (!showRootFolders) {↵
|
4 | //if (folder instanceof IContactFolder)↵ | | 4 | if (folder instanceof IContactFolder)↵
|
5 | addItem(folder);↵ | | 5 | addItem(folder);↵
|
6 | }↵ | | 6 | }↵
|
7 | } | | 7 | }
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | IFolder folder = it.next(); | | | |
8 | if (!showRootFolders) | | 10 | if (folder instanceof IContactFolder) |
9 | | | 11 | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement IFolder folder=it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression folder cannot be unified with expression folder , because common superclass type org.columba.addressbook.facade.IFolder cannot be passed as an argument to public void addItem(java.lang.Object) |