mimePartFile = TempFileStore.createTempFile(); try { downloadMimePart(CIDPart, mimePartFile); matcher.appendReplacement(modifiedBody, mimePartFile .toURL().toString()); } catch (Exception e) { matcher.appendReplacement(modifiedBody, "missing"); }
mimePartFile = TempFileStore.createTempFile(); try { downloadMimePart(CIDPart, mimePartFile); matcher.appendReplacement(modifiedBody, mimePartFile.toURL() .toString()); } catch (Exception e) { matcher.appendReplacement(modifiedBody, "missing"); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/TextViewer.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/TextViewer.java
Method name: String downloadCIDParts(String, MimeTree) Method name: String downloadCIDParts(String, MimeTree)
Number of AST nodes: 4 Number of AST nodes: 4
1
mimePartFile = TempFileStore.createTempFile();
1
mimePartFile = TempFileStore.createTempFile();
2
				try {
2
			try {
3
					downloadMimePart(CIDPart, mimePartFile);
3
				downloadMimePart(CIDPart, mimePartFile);
4
					matcher.appendReplacement(modifiedBody, mimePartFile
4
				matcher.appendReplacement(modifiedBody, mimePartFile
5
							.toURL()
5
.toURL()
6
.toString());
6
						.toString());
7
				} catch (Exception e) {
7
			} catch (Exception e) {
8
					matcher.appendReplacement(modifiedBody, "missing");
8
				matcher.appendReplacement(modifiedBody, "missing");
9
				}
9
			}
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.4
Clones locationClones are in the same method
Number of node comparisons11
  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)9.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    mimePartFile = TempFileStore.createTempFile();
    9
    mimePartFile = TempFileStore.createTempFile();
    18
    try
    10
    try
    19
    downloadMimePart(CIDPart, mimePartFile);
    11
    downloadMimePart(CIDPart, mimePartFile);
                                                                                                                                                            
    12
    matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString());
    Preondition Violations
    Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); 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
    12
    matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString());
    20
    matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString());
    20
    matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString());
    Preondition Violations
    Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); 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 (4)
    Row Violation
    1Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); 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
    3Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement matcher.appendReplacement(modifiedBody,mimePartFile.toURL().toString()); 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