if (isRecursive()) { FolderChildrenIterator it = new FolderChildrenIterator(folder); while (it.hasMoreChildren()) { IMailFolder next = it.nextChild(); if (!(next instanceof VirtualFolder) && (next instanceof IMailbox)) { next.addFolderListener(this); } } }
if (isRecursive()) { FolderChildrenIterator it = new FolderChildrenIterator(folder); while (it.hasMoreChildren()) { IMailFolder next = it.nextChild(); if (!(next instanceof VirtualFolder) && (next instanceof IMailbox)) { next.releaseLock(locker); } } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/virtual/VirtualFolder.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/virtual/VirtualFolder.java
Method name: void registerWithSource() Method name: void releaseLock(Object)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (isRecursive()) {
1
if (isRecursive()) {
2
			FolderChildrenIterator it = new FolderChildrenIterator(folder);
2
			FolderChildrenIterator it = new FolderChildrenIterator(folder);
3
			while (it.hasMoreChildren()) {
3
			while (it.hasMoreChildren()) {
4
				IMailFolder next = it.nextChild();
4
				IMailFolder next = it.nextChild();
5
				if (!(next instanceof VirtualFolder)
5
				if (!(next instanceof VirtualFolder)
6
						&& (next instanceof IMailbox)) {
6
						&& (next instanceof IMailbox)) {
7
					next.addFolderListener(this);
7
					next.releaseLock(locker);
8
				}
8
				}
9
			}
9
			}
10
		}
10
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)26.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (isRecursive())
    4
    if (isRecursive())
    4
    FolderChildrenIterator it = new FolderChildrenIterator(folder);
    5
    FolderChildrenIterator it = new FolderChildrenIterator(folder);
    5
    while (it.hasMoreChildren())
    6
    while (it.hasMoreChildren())
    6
    IMailFolder next = it.nextChild();
    7
    IMailFolder next = it.nextChild();
    7
    if (!(next instanceof VirtualFolder) && (next instanceof IMailbox))
    8
    if (!(next instanceof VirtualFolder) && (next instanceof IMailbox))
    8
    next.addFolderListener(this);
    8
    next.addFolderListener(this);
    Preondition Violations
    Unmatched statement next.addFolderListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                    
                                                            
    9
    next.releaseLock(locker);
    Preondition Violations
    Unmatched statement next.releaseLock(locker); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    next.releaseLock(locker);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement next.addFolderListener(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement next.releaseLock(locker); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted