switch (encoding) { case MimeHeader.QUOTED_PRINTABLE: bodyStream = new QuotedPrintableDecoderInputStream(bodyStream); break; case MimeHeader.BASE64: bodyStream = new Base64DecoderInputStream(bodyStream); break; default: } 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();
switch (encoding) { case MimeHeader.QUOTED_PRINTABLE: bodyStream = new QuotedPrintableDecoderInputStream(bodyStream); break; case MimeHeader.BASE64: bodyStream = new Base64DecoderInputStream(bodyStream); break; default: } 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: 14 Number of AST nodes: 14
1
switch (encoding) {
1
switch (encoding) {
2
			case MimeHeader.QUOTED_PRINTABLE:
2
		case MimeHeader.QUOTED_PRINTABLE:
3
				bodyStream = new QuotedPrintableDecoderInputStream(bodyStream);
3
			bodyStream = new QuotedPrintableDecoderInputStream(bodyStream);
4
				break;
4
			break;
5
			case MimeHeader.BASE64:
5
		case MimeHeader.BASE64:
6
				bodyStream = new Base64DecoderInputStream(bodyStream);
6
			bodyStream = new Base64DecoderInputStream(bodyStream);
7
				break;
7
			break;
8
			default:
8
		default:
9
			}
9
		}
10
			if (LOG.isLoggable(Level.FINE)) {
10
		if (LOG.isLoggable(Level.FINE)) {
11
				LOG.fine("Storing the attachment to :" + tempFile);
11
			LOG.fine("Storing the attachment to :" + tempFile);
12
			}
12
		}
13
			FileOutputStream fileStream = new FileOutputStream(tempFile);
13
		FileOutputStream fileStream = new FileOutputStream(tempFile);
14
			StreamUtils.streamCopy(bodyStream, fileStream);
14
		StreamUtils.streamCopy(bodyStream, fileStream);
15
			fileStream.close();
15
		fileStream.close();
16
			bodyStream.close();
16
		bodyStream.close();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes having the same super class
Number of node comparisons66
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    18
    switch (encoding)
    16
    switch (encoding)
    19
    case MimeHeader.QUOTED_PRINTABLE:
    17
    case MimeHeader.QUOTED_PRINTABLE:
    20
    bodyStream = new QuotedPrintableDecoderInputStream(bodyStream);
    18
    bodyStream = new QuotedPrintableDecoderInputStream(bodyStream);
    21
    break;
    19
    break;
    22
    case MimeHeader.BASE64:
    20
    case MimeHeader.BASE64:
    23
    bodyStream = new Base64DecoderInputStream(bodyStream);
    21
    bodyStream = new Base64DecoderInputStream(bodyStream);
    24
    break;
    22
    break;
    25
    default:
    23
    default:
    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