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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 11 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 7.0 |
Clone type | Type 1 |
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); |
20 | matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString()); | | 12 | matcher.appendReplacement(modifiedBody, mimePartFile.toURL().toString()); |
Precondition Violations (0)
Row |
Violation |