StreamableMimePart bodyPart = (StreamableMimePart) model .getFirstTextPart("plain"); if (bodyPart != null) { MimePart bodyParent = bodyPart.getParent(); if (bodyParent != null) { if (bodyParent.getHeader().getMimeType().getSubtype().equals( "alternative")) { List bodyParts = bodyParent.getChilds(); displayedMimeParts.removeAll(bodyParts); } else { displayedMimeParts.remove(bodyPart); } } else { displayedMimeParts.remove(bodyPart); } }
StreamableMimePart bodyPart = (StreamableMimePart) collection .getFirstTextPart("plain"); if (bodyPart != null) { MimePart bodyParent = bodyPart.getParent(); if (bodyParent != null) { if (bodyParent.getHeader().getMimeType().getSubtype().equals( "alternative")) { List bodyParts = bodyParent.getChilds(); displayedMimeParts.removeAll(bodyParts); } else { displayedMimeParts.remove(bodyPart); } } else { displayedMimeParts.remove(bodyPart); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/HeaderViewer.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/viewer/AttachmentModel.java
Method name: void removeBodyParts(MimeTree, List) Method name: void setCollection(MimeTree)
Number of AST nodes: 9 Number of AST nodes: 9
1
StreamableMimePart bodyPart = (StreamableMimePart) model
1
StreamableMimePart bodyPart = (StreamableMimePart) collection
2
				.getFirstTextPart("plain");
2
				.getFirstTextPart("plain");
3
		if (bodyPart != null) {
3
		if (bodyPart != null) {
4
			MimePart bodyParent = bodyPart.getParent();
4
			MimePart bodyParent = bodyPart.getParent();
5
			if (bodyParent != null) {
5
			if (bodyParent != null) {
6
				if (bodyParent.getHeader().getMimeType().getSubtype().equals(
6
				if (bodyParent.getHeader().getMimeType().getSubtype().equals(
7
						"alternative")) {
7
						"alternative")) {
8
					List bodyParts = bodyParent.getChilds();
8
					List bodyParts = bodyParent.getChilds();
9
					displayedMimeParts.removeAll(bodyParts);
9
					displayedMimeParts.removeAll(bodyParts);
10
				} else {
10
				} else {
11
					displayedMimeParts.remove(bodyPart);
11
					displayedMimeParts.remove(bodyPart);
12
				}
12
				}
13
			} else {
13
			} else {
14
				displayedMimeParts.remove(bodyPart);
14
				displayedMimeParts.remove(bodyPart);
15
			}
15
			}
16
		}
16
		}
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 comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StreamableMimePart bodyPart = (StreamableMimePart)model.getFirstTextPart("plain");
    1
    StreamableMimePart bodyPart = (StreamableMimePart)model.getFirstTextPart("plain");
    3
    StreamableMimePart bodyPart = (StreamableMimePart)collection.getFirstTextPart("plain");
    Differences
    Expression1Expression2Difference
    modelcollectionVARIABLE_NAME_MISMATCH
    3
    StreamableMimePart bodyPart = (StreamableMimePart)collection.getFirstTextPart("plain");
    2
    if (bodyPart != null)
    4
    if (bodyPart != null)
    3
    MimePart bodyParent = bodyPart.getParent();
    5
    MimePart bodyParent = bodyPart.getParent();
    4
    if (bodyParent != null)
    6
    if (bodyParent != null)
    5
    if (bodyParent.getHeader().getMimeType().getSubtype().equals("alternative"))
    7
    if (bodyParent.getHeader().getMimeType().getSubtype().equals("alternative"))
    6
    List bodyParts = bodyParent.getChilds();
    8
    List bodyParts = bodyParent.getChilds();
    7
    displayedMimeParts.removeAll(bodyParts);
    9
    displayedMimeParts.removeAll(bodyParts);
    else
    else
    8
    displayedMimeParts.remove(bodyPart);
    10
    displayedMimeParts.remove(bodyPart);
    else
    else
    9
    displayedMimeParts.remove(bodyPart);
    11
    displayedMimeParts.remove(bodyPart);
    Precondition Violations (0)
    Row Violation