addressList.clear(); for(int i=0; i<addresses.length; i++ ) { addressList.add(addresses[i].toString()); } result.put("cc", addressList.toArray(new String[0]));
for( int i=0; i<uids.length; i++) { matcher.reset(messageFiles[i].getName()); matcher.find(); uids[i] = new Integer(matcher.group(1)); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/parser/MailUrlParser.java File path: /columba-1.4-src/plugins/org.columba.mail.ZippedMHFolder/src/org/columba/mail/folder/zippedmh/ZippedMHDataStorage.java
Method name: Map parse(String) Method name: Object[] getMessageUids()
Number of AST nodes: 4 Number of AST nodes: 4
1
addressList.clear();
2
				for(int i=0; i<addresses.length; i++ ) {
1
for( int i=0; i<uids.length; i++) {
3
					addressList.add(addresses[i].toString());
2
			
4
				}
5
				result.put("cc", addressList.toArray(new String[0]));
3
matcher.reset(messageFiles[i].getName());
4
			matcher.find(); 
5
			uids[i] = new Integer(matcher.group(1));
6
		}
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.1
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    29
    addressList.clear();
                                                    
    30
    for (int i = 0; i < addresses.length; i++)
    30
    for (int i = 0; i < addresses.length; i++)
    4
    for (int i = 0; i < uids.length; i++)
    Differences
    Expression1Expression2Difference
    addressesuidsVARIABLE_NAME_MISMATCH
    org.columba.ristretto.message.Address[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.ristretto.message.Address[] of variable addresses does not match with type java.lang.Object[] of variable uids
    • Make classes org.columba.ristretto.message.Address[] and java.lang.Object[] extend a common superclass
    4
    for (int i = 0; i < uids.length; i++)
                                                                                            
    5
    matcher.reset(messageFiles[i].getName());
    Preondition Violations
    Unmatched statement matcher.reset(messageFiles[i].getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    matcher.reset(messageFiles[i].getName());
                                        
    6
    matcher.find();
    Preondition Violations
    Unmatched statement matcher.find(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    matcher.find();
                                                                                      
    7
    uids[i] = new Integer(matcher.group(1));
    Preondition Violations
    Unmatched statement uids[i]=new Integer(matcher.group(1)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    uids[i] = new Integer(matcher.group(1));
    31
    addressList.add(addresses[i].toString());
    31
    addressList.add(addresses[i].toString());
    Preondition Violations
    Unmatched statement addressList.add(addresses[i].toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    32
    result.put("cc", addressList.toArray(new String[0]));
                                                                                                                    
    Precondition Violations (5)
    Row Violation
    1Type org.columba.ristretto.message.Address[] of variable addresses does not match with type java.lang.Object[] of variable uids
    2Unmatched statement matcher.reset(messageFiles[i].getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement matcher.find(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement uids[i]=new Integer(matcher.group(1)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement addressList.add(addresses[i].toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted