if (charsetName != null) { Charset charset; try { charset = Charset.forName(charsetName); } catch (UnsupportedCharsetException e) { charset = Charset.forName(System.getProperty("file.encoding")); } body = new CharsetDecoderInputStream(body, charset); }
if (charsetName != null) { Charset charset; try { charset = Charset.forName(charsetName); } catch (UnsupportedCharsetException e) { charset = Charset.forName(System.getProperty("file.encoding")); } bodyStream = new CharsetDecoderInputStream(bodyStream, charset); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/composer/MessageBuilderHelper.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/AbstractMessageFolder.java
Method name: String createBodyText(MimePart) Method name: InputStream decodeStream(MimeHeader, InputStream)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (charsetName != null) {
1
if (charsetName != null) {
2
			Charset charset;
2
			Charset charset;
3
			try {
3
			try {
4
				charset = Charset.forName(charsetName);
4
				charset = Charset.forName(charsetName);
5
			} catch (UnsupportedCharsetException e) {
5
			} catch (UnsupportedCharsetException e) {
6
				charset = Charset.forName(System.getProperty("file.encoding"));
6
				charset = Charset.forName(System.getProperty("file.encoding"));
7
			}
7
			}
8
			body = new CharsetDecoderInputStream(body, charset);
8
			bodyStream = new CharsetDecoderInputStream(bodyStream, charset);
9
		}
9
		}
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
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (charsetName != null)
    10
    if (charsetName != null)
    13
    Charset charset;
    11
    Charset charset;
    14
    try
    12
    try
    15
    charset = Charset.forName(charsetName);
    13
    charset = Charset.forName(charsetName);
    16
    body = new CharsetDecoderInputStream(body, charset);
    16
    body = new CharsetDecoderInputStream(body, charset);
    14
    bodyStream = new CharsetDecoderInputStream(bodyStream, charset);
    Differences
    Expression1Expression2Difference
    bodybodyStreamVARIABLE_NAME_MISMATCH
    bodybodyStreamVARIABLE_NAME_MISMATCH
    14
    bodyStream = new CharsetDecoderInputStream(bodyStream, charset);
    Precondition Violations (0)
    Row Violation