File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/AttachmentsViewer.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/HeaderViewer.java | |||
Method name: boolean setMimePartTree(MimeTree)
|
Method name: JButton createAttachmentItem(StreamableMimePart)
|
|||
Number of AST nodes: 17 | Number of AST nodes: 17 | |||
1 | if (header.getFileName() != null) {↵ | 1 | if (header.getFileName() != null) {↵ | |
2 | text = header.getFileName();↵ | 2 | text = header.getFileName();↵ | |
3 | } else {↵ | 3 | } else {↵ | |
4 | text = contentType + "/" + contentSubtype;↵ | 4 | text = contentType + "/" + contentSubtype;↵ | |
5 | }↵ | 5 | }↵ | |
6 | // Get Tooltip for Icon↵ | 6 | // Get Tooltip for Icon↵ | |
7 | StringBuffer tooltip = new StringBuffer();↵ | 7 | StringBuffer tooltip = new StringBuffer();↵ | |
8 | tooltip.append("<html><body>");↵ | 8 | tooltip.append("<html><body>");↵ | |
9 | if (header.getFileName() != null) {↵ | 9 | if (header.getFileName() != null) {↵ | |
10 | tooltip.append(header.getFileName());↵ | 10 | tooltip.append(header.getFileName());↵ | |
11 | tooltip.append(" - ");↵ | 11 | tooltip.append(" - ");↵ | |
12 | }↵ | 12 | }↵ | |
13 | tooltip.append("<i>");↵ | 13 | tooltip.append("<i>");↵ | |
14 | if (header.getContentDescription() != null) {↵ | 14 | if (header.getContentDescription() != null) {↵ | |
15 | tooltip.append(header.getContentDescription());↵ | 15 | tooltip.append(header.getContentDescription());↵ | |
16 | } else {↵ | 16 | } else {↵ | |
17 | tooltip.append(contentType);↵ | 17 | tooltip.append(contentType);↵ | |
18 | tooltip.append("/");↵ | 18 | tooltip.append("/");↵ | |
19 | tooltip.append(contentSubtype);↵ | 19 | tooltip.append(contentSubtype);↵ | |
20 | }↵ | 20 | }↵ | |
21 | tooltip.append("</i></body></html>");↵ | 21 | tooltip.append("</i></body></html>");↵ | |
22 | ImageIcon icon = null;↵ | 22 | ImageIcon image = null;↵ | |
23 | icon = new AttachmentImageIconLoader().getImageIcon(type.getType(),↵ | 23 | image = new AttachmentImageIconLoader().getImageIcon(type.getType(),↵ | |
24 | type.getSubtype()); | 24 | type.getSubtype()); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 83 |
Number of mapped statements | 16 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 11.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | if (header.getFileName() != null) | 6 | if (header.getFileName() != null) | |||||||||||||||
15 | text = header.getFileName(); | 7 | text = header.getFileName(); | |||||||||||||||
else | | |||||||||||||||||
| 8 | text = contentType + "/" + contentSubtype; | ||||||||||||||||
16 | text = contentType + "/" + contentSubtype; |
| | |||||||||||||||
17 | StringBuffer tooltip = new StringBuffer(); | 9 | StringBuffer tooltip = new StringBuffer(); | |||||||||||||||
18 | tooltip.append("<html><body>"); | 10 | tooltip.append("<html><body>"); | |||||||||||||||
19 | if (header.getFileName() != null) | 11 | if (header.getFileName() != null) | |||||||||||||||
20 | tooltip.append(header.getFileName()); | 12 | tooltip.append(header.getFileName()); | |||||||||||||||
21 | tooltip.append(" - "); | 13 | tooltip.append(" - "); | |||||||||||||||
22 | tooltip.append("<i>"); | 14 | tooltip.append("<i>"); | |||||||||||||||
23 | if (header.getContentDescription() != null) | 15 | if (header.getContentDescription() != null) | |||||||||||||||
24 | tooltip.append(header.getContentDescription()); | 16 | tooltip.append(header.getContentDescription()); | |||||||||||||||
else | else | |||||||||||||||||
25 | tooltip.append(contentType); | 17 | tooltip.append(contentType); | |||||||||||||||
26 | tooltip.append("/"); | 18 | tooltip.append("/"); | |||||||||||||||
27 | tooltip.append(contentSubtype); | 19 | tooltip.append(contentSubtype); | |||||||||||||||
28 | tooltip.append("</i></body></html>"); | 20 | tooltip.append("</i></body></html>"); | |||||||||||||||
29 | ImageIcon icon = null; |
| 21 | ImageIcon image = null; | ||||||||||||||
30 | icon = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype()); |
| 22 | image = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype()); |
Row | Violation |
---|---|
1 | Unmatched statement text=contentType + "/" + contentSubtype; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type org.columba.mail.gui.message.viewer.AttachmentsViewer.AttachmentImageIconLoader does not match with type org.columba.mail.gui.message.viewer.HeaderViewer.AttachmentImageIconLoader |
3 | Clone fragment #1 returns variables text, tooltip, icon , while Clone fragment #2 returns variables image, text, tooltip |
4 | The refactoring of the clones is infeasible, because classes org.columba.mail.gui.message.viewer.AttachmentsViewer and org.columba.mail.gui.message.viewer.HeaderViewer do not have a common superclass |