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.5
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)38.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    while (it.hasMoreChildren())
    6
    while (it.hasMoreChildren())
    8
    while (success && it.hasMoreChildren())
    Differences
    Expression1Expression2Difference
    it.hasMoreChildren()success && it.hasMoreChildren()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression it.hasMoreChildren() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression success && it.hasMoreChildren() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    while (success && it.hasMoreChildren())
    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 (4)
    Row Violation
    1Expression it.hasMoreChildren() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression success && it.hasMoreChildren() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement next.releaseLock(locker); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched 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