while (it.hasNext()) { b = true; uid = it.next(); for (int i = 0; (i < rule.count()) && b; i++) { IFilterCriteria criteria = rule.get(i); String type = criteria.getTypeString(); b &= processRule(uid, criteria, type); } if (b) { result.add(uid); } }
while (it.hasNext()) { b = false; uid = it.next(); for (int i = 0; (i < rule.count()) && !b; i++) { IFilterCriteria criteria = rule.get(i); String type = criteria.getTypeString(); b = processRule(uid, criteria, type); } if (b) { result.add(uid); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/search/DefaultSearchEngine.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/search/DefaultSearchEngine.java
Method name: List processCriteria(IFilterRule, List) Method name: List processCriteria(IFilterRule, List)
Number of AST nodes: 9 Number of AST nodes: 9
1
while (it.hasNext()) {
1
while (it.hasNext()) {
2
				b = true;
2
				b = false;
3
				uid = it.next();
3
				uid = it.next();
4
				for (int i = 0; (i < rule.count()) && b; i++) {
4
				for (int i = 0; (i < rule.count()) && !b; i++) {
5
					IFilterCriteria criteria = rule.get(i);
5
					IFilterCriteria criteria = rule.get(i);
6
					String type = criteria.getTypeString();
6
					String type = criteria.getTypeString();
7
					b &= processRule(uid, criteria, type);
7
					b = processRule(uid, criteria, type);
8
				}
8
				}
9
				if (b) {
9
				if (b) {
10
					result.add(uid);
10
					result.add(uid);
11
				}
11
				}
12
			}
12
			}
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.3
Clones locationClones are in the same method
Number of node comparisons39
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    while (it.hasNext())
    16
    while (it.hasNext())
    8
    b = true;
    8
    b = true;
    17
    b = false;
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    17
    b = false;
    9
    uid = it.next();
    18
    uid = it.next();
    10
    for (int i = 0; (i < rule.count()) && b; i++)
    10
    for (int i = 0; (i < rule.count()) && b; i++)
    19
    for (int i = 0; (i < rule.count()) && !b; i++)
    Differences
    Expression1Expression2Difference
    b!bTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression b cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression !b cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19
    for (int i = 0; (i < rule.count()) && !b; i++)
    11
    IFilterCriteria criteria = rule.get(i);
    20
    IFilterCriteria criteria = rule.get(i);
    12
    String type = criteria.getTypeString();
    21
    String type = criteria.getTypeString();
    13
    b &= processRule(uid, criteria, type);
    13
    b &= processRule(uid, criteria, type);
    Preondition Violations
    Unmatched statement b&=processRule(uid,criteria,type); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
                                                                              
    22
    b = processRule(uid, criteria, type);
    Preondition Violations
    Unmatched statement b=processRule(uid,criteria,type); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22
    b = processRule(uid, criteria, type);
    14
    if (b)
    23
    if (b)
    15
    result.add(uid);
    24
    result.add(uid);
    Precondition Violations (5)
    Row Violation
    1Expression b cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression !b cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement b&=processRule(uid,criteria,type); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement b=processRule(uid,criteria,type); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variables b, uid, criteria, type , while Clone fragment #2 returns variables uid, criteria, type