if (Boolean.valueOf(html.getAttribute("prefer")).booleanValue()) { bodyPart = mimePartTree.getFirstTextPart("html"); } else { bodyPart = mimePartTree.getFirstTextPart("plain"); } if (bodyPart != null) { // setup charset and html initMimeHeader(bodyPart); bodyPartAddress = bodyPart.getAddress(); String quotedBodyText = createQuotedBody(bodyPart.getHeader(), folder, uids, bodyPartAddress); /* * *20040210, karlpeder* Remove html comments - they are not * displayed properly in the composer */ if (bodyPart.getHeader().getMimeType().getSubtype().equals("html")) { quotedBodyText = HtmlParser.removeComments(quotedBodyText); } model.setBodyText(quotedBodyText); } // add all attachments MimeTree mt = folder.getMimePartTree(uids[0]); Iterator it = mt.getAllLeafs().iterator();
if (Boolean.valueOf(html.getAttribute("prefer")).booleanValue()) { bodyPart = mimePartTree.getFirstTextPart("html"); } else { bodyPart = mimePartTree.getFirstTextPart("plain"); } if (bodyPart != null) { // setup charset and html initMimeHeader(bodyPart); bodyPartAddress = bodyPart.getAddress(); String quotedBodyText = createQuotedBody(folder, uids, bodyPartAddress); /* * *20040210, karlpeder* Remove html comments - they are not * displayed properly in the composer */ if (bodyPart.getHeader().getMimeType().getSubtype().equals("html")) { quotedBodyText = HtmlParser.removeComments(quotedBodyText); } model.setBodyText(quotedBodyText); } // add all attachments MimeTree mt = folder.getMimePartTree(uids[0]); Iterator it = mt.getAllLeafs().iterator();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/command/ForwardInlineCommand.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/command/RedirectCommand.java
Method name: void execute(IWorkerStatusController) Method name: void execute(IWorkerStatusController)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (Boolean.valueOf(html.getAttribute("prefer")).booleanValue()) {
1
if (Boolean.valueOf(html.getAttribute("prefer")).booleanValue()) {
2
			bodyPart = mimePartTree.getFirstTextPart("html");
2
			bodyPart = mimePartTree.getFirstTextPart("html");
3
		} else {
3
		} else {
4
			bodyPart = mimePartTree.getFirstTextPart("plain");
4
			bodyPart = mimePartTree.getFirstTextPart("plain");
5
		}
5
		}
6
		if (bodyPart != null) {
6
		if (bodyPart != null) {
7
			// setup charset and html
7
			// setup charset and html
8
			initMimeHeader(bodyPart);
8
			initMimeHeader(bodyPart);
9
			bodyPartAddress = bodyPart.getAddress();
9
			bodyPartAddress = bodyPart.getAddress();
10
			String quotedBodyText = createQuotedBody(bodyPart.getHeader(),
10
			String quotedBodyText = createQuotedBody(
11
					folder, uids, 
11
folder, uids,
12
bodyPartAddress);
12
					bodyPartAddress);
13
			/*
13
			/*
14
			 * *20040210, karlpeder* Remove html comments - they are not
14
			 * *20040210, karlpeder* Remove html comments - they are not
15
			 * displayed properly in the composer
15
			 * displayed properly in the composer
16
			 */
16
			 */
17
			if (bodyPart.getHeader().getMimeType().getSubtype().equals("html")) {
17
			if (bodyPart.getHeader().getMimeType().getSubtype().equals("html")) {
18
				quotedBodyText = HtmlParser.removeComments(quotedBodyText);
18
				quotedBodyText = HtmlParser.removeComments(quotedBodyText);
19
			}
19
			}
20
			model.setBodyText(quotedBodyText);
20
			model.setBodyText(quotedBodyText);
21
		}
21
		}
22
		//  add all attachments
22
		// add all attachments
23
		MimeTree mt = folder.getMimePartTree(uids[0]);
23
		MimeTree mt = folder.getMimePartTree(uids[0]);
24
		Iterator it = mt.getAllLeafs().iterator();
24
		Iterator it = mt.getAllLeafs().iterator();
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)0.5
Clones locationClones are in different classes having the same super class
Number of node comparisons43
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)28.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    if (Boolean.valueOf(html.getAttribute("prefer")).booleanValue())
    11
    if (Boolean.valueOf(html.getAttribute("prefer")).booleanValue())
    12
    bodyPart = mimePartTree.getFirstTextPart("html");
    12
    bodyPart = mimePartTree.getFirstTextPart("html");
    else
    else
    13
    bodyPart = mimePartTree.getFirstTextPart("plain");
    13
    bodyPart = mimePartTree.getFirstTextPart("plain");
    14
    if (bodyPart != null)
    14
    if (bodyPart != null)
    15
    initMimeHeader(bodyPart);
    15
    initMimeHeader(bodyPart);
    16
    bodyPartAddress = bodyPart.getAddress();
    16
    bodyPartAddress = bodyPart.getAddress();
    17
    String quotedBodyText = createQuotedBody(bodyPart.getHeader(), folder, uids, bodyPartAddress);
    17
    String quotedBodyText = createQuotedBody(bodyPart.getHeader(), folder, uids, bodyPartAddress);
    17
    String quotedBodyText = createQuotedBody(folder, uids, bodyPartAddress);
    Differences
    Expression1Expression2Difference
    createQuotedBody(bodyPart.getHeader(),folder,uids,bodyPartAddress)createQuotedBody(folder,uids,bodyPartAddress)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression createQuotedBody(bodyPart.getHeader(),folder,uids,bodyPartAddress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression createQuotedBody(folder,uids,bodyPartAddress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17
    String quotedBodyText = createQuotedBody(folder, uids, bodyPartAddress);
    18
    if (bodyPart.getHeader().getMimeType().getSubtype().equals("html"))
    18
    if (bodyPart.getHeader().getMimeType().getSubtype().equals("html"))
    19
    quotedBodyText = HtmlParser.removeComments(quotedBodyText);
    19
    quotedBodyText = HtmlParser.removeComments(quotedBodyText);
    20
    model.setBodyText(quotedBodyText);
    20
    model.setBodyText(quotedBodyText);
    21
    MimeTree mt = folder.getMimePartTree(uids[0]);
    21
    MimeTree mt = folder.getMimePartTree(uids[0]);
    22
    Iterator it = mt.getAllLeafs().iterator();
    22
    Iterator it = mt.getAllLeafs().iterator();
    Precondition Violations (3)
    Row Violation
    1Expression createQuotedBody(bodyPart.getHeader(),folder,uids,bodyPartAddress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression createQuotedBody(folder,uids,bodyPartAddress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables it, bodyPartAddress , while Clone fragment #2 returns variables it, bodyPartAddress