if (CIDPart != null) { mimePartFile = TempFileStore.createTempFile(); try { downloadMimePart(CIDPart, mimePartFile); matcher.appendReplacement(modifiedBody, mimePartFile.toURL() .toString()); } catch (Exception e) { matcher.appendReplacement(modifiedBody, "missing"); } } else { matcher.appendReplacement(modifiedBody, "missing"); }
if (CIDPart != null) { mimePartFile = TempFileStore.createTempFile(); try { downloadMimePart(CIDPart, mimePartFile); matcher.appendReplacement(modifiedBody, mimePartFile .toURL().toString()); } catch (Exception e) { matcher.appendReplacement(modifiedBody, "missing"); } } else { 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: 6 Number of AST nodes: 6
1
if (CIDPart != null) {
1
if (CIDPart != null) {
2
			mimePartFile = TempFileStore.createTempFile();
2
				mimePartFile = TempFileStore.createTempFile();
3
			try {
3
				try {
4
				downloadMimePart(CIDPart, mimePartFile);
4
					downloadMimePart(CIDPart, mimePartFile);
5
				matcher.appendReplacement(modifiedBody, mimePartFile
5
					matcher.appendReplacement(modifiedBody, mimePartFile
6
.toURL()
6
							.toURL()
7
						.toString());
7
.toString());
8
			} catch (Exception e) {
8
				} catch (Exception e) {
9
				matcher.appendReplacement(modifiedBody, "missing");
9
					matcher.appendReplacement(modifiedBody, "missing");
10
			}
10
				}
11
		} else {
11
			} else {
12
			matcher.appendReplacement(modifiedBody, "missing");
12
				matcher.appendReplacement(modifiedBody, "missing");
13
		}
13
			}
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 comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)11.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    if (CIDPart != null)
    16
    if (CIDPart != null)
    9
    mimePartFile = TempFileStore.createTempFile();
    17
    mimePartFile = TempFileStore.createTempFile();
    10
    try
    18
    try
    11
    downloadMimePart(CIDPart, mimePartFile);
    19
    downloadMimePart(CIDPart, mimePartFile);
    12
    matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString());
    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
                                                                                                                                                            
                                                                                                                                                            
    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
    20
    matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString());
    else
            
    13
    matcher.appendReplacement(modifiedBody, "missing");
    13
    matcher.appendReplacement(modifiedBody, "missing");
    Preondition Violations
    Unmatched statement matcher.appendReplacement(modifiedBody,"missing"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                
                                                                                                                
    21
    matcher.appendReplacement(modifiedBody, "missing");
    Preondition Violations
    Unmatched statement matcher.appendReplacement(modifiedBody,"missing"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    21
    matcher.appendReplacement(modifiedBody, "missing");
    Precondition Violations (6)
    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
    5Unmatched statement matcher.appendReplacement(modifiedBody,"missing"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement matcher.appendReplacement(modifiedBody,"missing"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted