if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Storing the attachment to :" + tempFile);
}
FileOutputStream fileStream = new FileOutputStream(tempFile);
StreamUtils.streamCopy(bodyStream, fileStream);
fileStream.close();
bodyStream.close();
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Storing the attachment to :" + tempFile);
}
FileOutputStream fileStream = new FileOutputStream(tempFile);
StreamUtils.streamCopy(bodyStream, fileStream);
fileStream.close();
bodyStream.close();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/command/OpenAttachmentCommand.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/command/SaveAttachmentCommand.java
|
Method name: void execute(IWorkerStatusController)
|
|
Method name: void execute(IWorkerStatusController)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (LOG.isLoggable(Level.FINE)) {↵ | | 1 | if (LOG.isLoggable(Level.FINE)) {↵
|
2 | LOG.fine("Storing the attachment to :" + tempFile);↵ | | 2 | LOG.fine("Storing the attachment to :" + tempFile);↵
|
3 | }↵ | | 3 | }↵
|
|
4 | FileOutputStream fileStream = new FileOutputStream(tempFile);↵ | | 4 | FileOutputStream fileStream = new FileOutputStream(tempFile);↵
|
5 | StreamUtils.streamCopy(bodyStream, fileStream);↵ | | 5 | StreamUtils.streamCopy(bodyStream, fileStream);↵
|
6 | fileStream.close();↵ | | 6 | fileStream.close();↵
|
7 | bodyStream.close(); | | 7 | bodyStream.close();
|
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 different classes having the same super class |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 2.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
26 | if (LOG.isLoggable(Level.FINE)) | | 24 | if (LOG.isLoggable(Level.FINE)) |
27 | LOG.fine("Storing the attachment to :" + tempFile); | | 25 | LOG.fine("Storing the attachment to :" + tempFile); |
28 | FileOutputStream fileStream = new FileOutputStream(tempFile); | | 26 | FileOutputStream fileStream = new FileOutputStream(tempFile); |
29 | StreamUtils.streamCopy(bodyStream, fileStream); | | 27 | StreamUtils.streamCopy(bodyStream, fileStream); |
30 | fileStream.close(); | | 28 | fileStream.close(); |
31 | bodyStream.close(); | | 29 | bodyStream.close(); |
Precondition Violations (0)
Row |
Violation |