InputStream is = new BufferedInputStream(new FileInputStream(file)); // load properties from stream properties.load(is); // close stream is.close();
for (int i = 0; i < uids.length; i++) { InputStream messageSourceStream = getMessageSourceStream(uids[i]); destFolder.addMessage(messageSourceStream); messageSourceStream.close(); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/config/Config.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/temp/TempFolder.java
Method name: void load() Method name: void innerCopy(IMailbox, Object[])
Number of AST nodes: 3 Number of AST nodes: 4
1
InputStream is = new BufferedInputStream(new FileInputStream(file));
2
			// load properties from stream
3
			properties.load(is);
4
			// close stream
5
			is.close();
1
for (int i = 0; i < uids.length; i++) {
2
            InputStream messageSourceStream = getMessageSourceStream(uids[i]);
3
            destFolder.addMessage(messageSourceStream);
4
            messageSourceStream.close();
5
        }
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.0
Clones locationClones are in different classes
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)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    InputStream is = new BufferedInputStream(new FileInputStream(file));
    3
    InputStream is = new BufferedInputStream(new FileInputStream(file));
    2
    InputStream messageSourceStream = getMessageSourceStream(uids[i]);
    Differences
    Expression1Expression2Difference
    ismessageSourceStreamVARIABLE_NAME_MISMATCH
    java.io.BufferedInputStreamjava.io.InputStreamSUBCLASS_TYPE_MISMATCH
    new BufferedInputStream(new FileInputStream(file))getMessageSourceStream(uids[i])TYPE_COMPATIBLE_REPLACEMENT
    2
    InputStream messageSourceStream = getMessageSourceStream(uids[i]);
                                                                                                
    3
    destFolder.addMessage(messageSourceStream);
    Preondition Violations
    Unmatched statement destFolder.addMessage(messageSourceStream); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    destFolder.addMessage(messageSourceStream);
    4
    properties.load(is);
    4
    properties.load(is);
    Preondition Violations
    Unmatched statement properties.load(is); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                  
    5
    is.close();
    5
    is.close();
    4
    messageSourceStream.close();
    Differences
    Expression1Expression2Difference
    ismessageSourceStreamVARIABLE_NAME_MISMATCH
    4
    messageSourceStream.close();
    Precondition Violations (3)
    Row Violation
    1Unmatched statement destFolder.addMessage(messageSourceStream); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement properties.load(is); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3The refactoring of the clones is infeasible, because classes org.columba.chat.config.Config and org.columba.mail.folder.temp.TempFolder do not have a common superclass