StringBuffer buf = new StringBuffer();
buf.append("gnome-");
buf.append(contentType);
buf.append("-");
buf.append(contentSubtype);
buf.append(".png");
ImageIcon icon = ImageLoader.getMimetypeIcon(buf.toString());
if (icon == null) {
icon = ImageLoader.getMimetypeIcon("gnome-"
+ contentType + ".png");
}
if (icon == null) {
icon = ImageLoader.getMimetypeIcon("gnome-text.png");
}
return icon;
StringBuffer buf = new StringBuffer();
buf.append("gnome-");
buf.append(contentType);
buf.append("-");
buf.append(contentSubtype);
buf.append(".png");
ImageIcon icon = ImageLoader.getMimetypeIcon(buf.toString());
if (icon == null) {
icon = ImageLoader.getMimetypeIcon("gnome-" + contentType
+ ".png");
}
if (icon == null) {
icon = ImageLoader.getMimetypeIcon("gnome-text.png");
}
return icon;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/AttachmentView.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/HeaderViewer.java
|
Method name: ImageIcon getImageIcon(String, String)
|
|
Method name: ImageIcon getImageIcon(String, String)
|
Number of AST nodes: 12
|
|
Number of AST nodes: 12
|
|
1 | StringBuffer buf = new StringBuffer();↵ | | 1 | StringBuffer buf = new StringBuffer();↵
|
2 | buf.append("gnome-");↵ | | 2 | buf.append("gnome-");↵
|
3 | buf.append(contentType);↵ | | 3 | buf.append(contentType);↵
|
4 | buf.append("-");↵ | | 4 | buf.append("-");↵
|
5 | buf.append(contentSubtype);↵ | | 5 | buf.append(contentSubtype);↵
|
6 | buf.append(".png");↵ | | 6 | buf.append(".png");↵
|
|
7 | ImageIcon icon = ImageLoader.getMimetypeIcon(buf.toString());↵ | | 7 | ImageIcon icon = ImageLoader.getMimetypeIcon(buf.toString());↵
|
|
8 | if (icon == null) {↵ | | 8 | if (icon == null) {↵
|
9 | icon = ImageLoader.getMimetypeIcon("gnome-"↵ | | 9 | icon = ImageLoader.getMimetypeIcon("gnome-"↵
|
10 | + contentType ↵ | | 10 | + contentType↵
|
11 | + ".png");↵ | | 11 | + ".png");↵
|
12 | }↵ | | 12 | }↵
|
|
13 | if (icon == null) {↵ | | 13 | if (icon == null) {↵
|
14 | icon = ImageLoader.getMimetypeIcon("gnome-text.png");↵ | | 14 | icon = ImageLoader.getMimetypeIcon("gnome-text.png");↵
|
15 | }↵ | | 15 | }↵
|
|
16 | return icon; | | 16 | return icon;
|
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 | 63 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 12 |
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) | 8.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | StringBuffer buf = new StringBuffer(); | | 1 | StringBuffer buf = new StringBuffer(); |
2 | buf.append("gnome-"); | | 2 | buf.append("gnome-"); |
3 | buf.append(contentType); | | 3 | buf.append(contentType); |
4 | buf.append("-"); | | 4 | buf.append("-"); |
5 | buf.append(contentSubtype); | | 5 | buf.append(contentSubtype); |
6 | buf.append(".png"); | | 6 | buf.append(".png"); |
7 | ImageIcon icon = ImageLoader.getMimetypeIcon(buf.toString()); | | 7 | ImageIcon icon = ImageLoader.getMimetypeIcon(buf.toString()); |
8 | if (icon == null) | | 8 | if (icon == null) |
9 | icon = ImageLoader.getMimetypeIcon("gnome-" + contentType + ".png"); | | 9 | icon = ImageLoader.getMimetypeIcon("gnome-" + contentType + ".png"); |
10 | if (icon == null) | | 10 | if (icon == null) |
11 | icon = ImageLoader.getMimetypeIcon("gnome-text.png"); | | 11 | icon = ImageLoader.getMimetypeIcon("gnome-text.png"); |
12 | return icon; | | 12 | return icon; |
Precondition Violations (0)
Row |
Violation |