for (ICommand _command : commandList) { _command.updateGUI(); }
for(Object uid: list) { resultList.add(headerList.get(uid), uid); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/command/CompoundCommand.java File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/imap/TestServer.java
Method name: void updateGUI() Method name: void fetchHeaderList(IHeaderList, List, IMAPFolder)
Number of AST nodes: 2 Number of AST nodes: 2
1
for (ICommand _command : commandList) {
1
for
2
			_command.updateGUI(
2
(Object uid: list) {
3
);
3
			resultList.add(headerList.get(uid), uid);
4
		}
4
		}
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 in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (ICommand _command : commandList)
    1
    for (ICommand _command : commandList)
    1
    for (Object uid : list)
    Differences
    Expression1Expression2Difference
    org.columba.api.command.ICommandjava.lang.ObjectVARIABLE_TYPE_MISMATCH
    commandListlistVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.api.command.ICommand does not match with type java.lang.Object
    • Make classes org.columba.api.command.ICommand and java.lang.Object extend a common superclass
    Type java.util.List<org.columba.api.command.ICommand> of variable commandList does not match with type java.util.List of variable list
    • Make classes java.util.List and java.util.List extend a common superclass
    1
    for (Object uid : list)
                                                                                          
    2
    resultList.add(headerList.get(uid), uid);
    Preondition Violations
    Unmatched statement resultList.add(headerList.get(uid),uid); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    resultList.add(headerList.get(uid), uid);
    2
    _command.updateGUI();
    2
    _command.updateGUI();
    Preondition Violations
    Unmatched statement _command.updateGUI(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement _command.updateGUI(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                    
    Precondition Violations (7)
    Row Violation
    1Type org.columba.api.command.ICommand does not match with type java.lang.Object
    2Type java.util.List<org.columba.api.command.ICommand> of variable commandList does not match with type java.util.List of variable list
    3Unmatched statement resultList.add(headerList.get(uid),uid); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement _command.updateGUI(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement _command.updateGUI(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6Clone fragment #1 returns variable _command with type org.columba.api.command.ICommand , while Clone fragment #2 returns variable uid with type java.lang.Object
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero