if (header.getFileName() != null) { text = header.getFileName(); } else { text = contentType + "/" + contentSubtype; } // Get Tooltip for Icon StringBuffer tooltip = new StringBuffer(); tooltip.append("<html><body>"); if (header.getFileName() != null) { tooltip.append(header.getFileName()); tooltip.append(" - "); } tooltip.append("<i>"); if (header.getContentDescription() != null) { tooltip.append(header.getContentDescription()); } else { tooltip.append(contentType); tooltip.append("/"); tooltip.append(contentSubtype); } tooltip.append("</i></body></html>"); ImageIcon icon = null; icon = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype());
if (header.getFileName() != null) { text = header.getFileName(); } else { text = contentType + "/" + contentSubtype; } // Get Tooltip for Icon StringBuffer tooltip = new StringBuffer(); tooltip.append("<html><body>"); if (header.getFileName() != null) { tooltip.append(header.getFileName()); tooltip.append(" - "); } tooltip.append("<i>"); if (header.getContentDescription() != null) { tooltip.append(header.getContentDescription()); } else { tooltip.append(contentType); tooltip.append("/"); tooltip.append(contentSubtype); } tooltip.append("</i></body></html>"); ImageIcon image = null; image = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype());
Clone fragments detected by clone detection tool
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());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)1.2
Clones locationClones are in different classes having the same super class
Number of node comparisons83
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)11.0
    Clone typeType 2
    Mapped Statements
    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;
    16
    text = contentType + "/" + contentSubtype;
    Preondition Violations
    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
                                                                                            
    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;
    29
    ImageIcon icon = null;
    21
    ImageIcon image = null;
    Differences
    Expression1Expression2Difference
    iconimageVARIABLE_NAME_MISMATCH
    21
    ImageIcon image = null;
    30
    icon = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype());
    30
    icon = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype());
    22
    image = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype());
    Differences
    Expression1Expression2Difference
    iconimageVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.message.viewer.AttachmentsViewer.AttachmentImageIconLoaderorg.columba.mail.gui.message.viewer.HeaderViewer.AttachmentImageIconLoaderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.mail.gui.message.viewer.AttachmentsViewer.AttachmentImageIconLoader does not match with type org.columba.mail.gui.message.viewer.HeaderViewer.AttachmentImageIconLoader
    • Make classes org.columba.mail.gui.message.viewer.AttachmentsViewer.AttachmentImageIconLoader and org.columba.mail.gui.message.viewer.HeaderViewer.AttachmentImageIconLoader extend a common superclass
    22
    image = new AttachmentImageIconLoader().getImageIcon(type.getType(), type.getSubtype());
    Precondition Violations (4)
    Row Violation
    1Unmatched statement text=contentType + "/" + contentSubtype; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type org.columba.mail.gui.message.viewer.AttachmentsViewer.AttachmentImageIconLoader does not match with type org.columba.mail.gui.message.viewer.HeaderViewer.AttachmentImageIconLoader
    3Clone fragment #1 returns variables text, tooltip, icon , while Clone fragment #2 returns variables image, text, tooltip
    4The 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