while (it.hasMoreChildren()) { IMailFolder next = it.nextChild(); if (!(next instanceof VirtualFolder) && (next instanceof IMailbox)) { next.releaseLock(locker); } }
while (success && it.hasMoreChildren()) { IMailFolder next = it.nextChild(); if (!(next instanceof VirtualFolder) && (next instanceof IMailbox)) { success &= next.tryToGetLock(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 releaseLock(Object) Method name: boolean tryToGetLock(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
while (it.hasMoreChildren()) {
1
while (success && it.hasMoreChildren()) {
2
				IMailFolder next = it.nextChild();
2
				IMailFolder next = it.nextChild();
3
				if (!(next instanceof VirtualFolder)
3
				if (!(next instanceof VirtualFolder)
4
						&& (next instanceof IMailbox)) {
4
						&& (next instanceof IMailbox)) {
5
					next.releaseLock(locker);
5
					success &= next.tryToGetLock(locker);
6
				}
6
				}
7
			}
7
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    IMailFolder next = it.nextChild();
    9
    IMailFolder next = it.nextChild();
    8
    if (!(next instanceof VirtualFolder) && (next instanceof IMailbox))
    10
    if (!(next instanceof VirtualFolder) && (next instanceof IMailbox))
    9
    next.releaseLock(locker);
    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
                                                            
                                                                                  
    11
    success &= next.tryToGetLock(locker);
    Preondition Violations
    Unmatched statement success&=next.tryToGetLock(locker); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    success &= next.tryToGetLock(locker);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement next.releaseLock(locker); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement success&=next.tryToGetLock(locker); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted