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 | }
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | if (charsetName != null) | | 10 | if (charsetName != null) |
13 | | | 11 | |
14 | | | 12 | |
15 | charset = Charset.forName(charsetName); | | 13 | charset = Charset.forName(charsetName); |
16 | body = new CharsetDecoderInputStream(body, charset); | | 14 | bodyStream = new CharsetDecoderInputStream(bodyStream, charset); |
Precondition Violations (0)
Row |
Violation |