MimeHeader bodyHeader = bodyPart.getHeader(); if (bodyHeader.getMimeType().getSubtype().equals("html")) { model.setHtml(true); } else { model.setHtml(false); } // Select the charset of the original message String charset = bodyHeader.getContentParameter("charset"); if (charset != null) { try { model.setCharset(Charset.forName(charset)); } catch( UnsupportedCharsetException e ) { // Stick with the default charset } }
MimeHeader bodyHeader = bodyPart.getHeader(); if (bodyHeader.getMimeType().getSubtype().equals("html")) { model.setHtml(true); } else { model.setHtml(false); } // Select the charset of the original message String charset = bodyHeader.getContentParameter("charset"); if (charset != null) { try { model.setCharset(Charset.forName(charset)); } catch( UnsupportedCharsetException e ) { // Stick with the default charset } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/command/ReplyCommand.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/command/ForwardInlineCommand.java
Method name: void initMimeHeader(MimePart) Method name: void initMimeHeader(MimePart)
Number of AST nodes: 8 Number of AST nodes: 8
1
MimeHeader bodyHeader = bodyPart.getHeader();
1
MimeHeader bodyHeader = bodyPart.getHeader();
2
        if (bodyHeader.getMimeType().getSubtype().equals("html")) {
2
		if (bodyHeader.getMimeType().getSubtype().equals("html")) {
3
            model.setHtml(true);
3
			model.setHtml(true);
4
        } else {
4
		} else {
5
            model.setHtml(false);
5
			model.setHtml(false);
6
        }
7
        
6
		}
8
// Select the charset of the original message
7
		// Select the charset of the original message
9
        String charset = bodyHeader.getContentParameter("charset");
8
		String charset = bodyHeader.getContentParameter("charset");
10
        if (charset != null) {
9
        if (charset != null) {
11
        	try {
10
        	try {
12
        		model.setCharset(Charset.forName(charset));
11
        		model.setCharset(Charset.forName(charset));
13
        	} catch( UnsupportedCharsetException e ) {
12
        	} catch( UnsupportedCharsetException e ) {
14
        		// Stick with the default charset
13
        		// Stick with the default charset
15
        	}
14
        	}
16
        }
15
        }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)12.4
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    MimeHeader bodyHeader = bodyPart.getHeader();
    1
    MimeHeader bodyHeader = bodyPart.getHeader();
    2
    if (bodyHeader.getMimeType().getSubtype().equals("html"))
    2
    if (bodyHeader.getMimeType().getSubtype().equals("html"))
    3
    model.setHtml(true);
    3
    model.setHtml(true);
    else
    else
    4
    model.setHtml(false);
    4
    model.setHtml(false);
    5
    String charset = bodyHeader.getContentParameter("charset");
    5
    String charset = bodyHeader.getContentParameter("charset");
    6
    if (charset != null)
    6
    if (charset != null)
    7
    try
    7
    try
    8
    model.setCharset(Charset.forName(charset));
    8
    model.setCharset(Charset.forName(charset));
    Precondition Violations (0)
    Row Violation