XmlElement htmlElement = optionsElement.getElement("html"); // create html element, if it doesn't exist if (htmlElement == null) { htmlElement = optionsElement.addSubElement("html"); } // get enable attribute String enableHtml = htmlElement.getAttribute("enable", "false");
XmlElement html = composerOptions.getElement("html"); if (html == null) { html = composerOptions.addSubElement("html"); } String multipart = html.getAttribute("send_as_multipart", "true");
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/composer/MessageBuilderHelper.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/composer/MessageComposer.java
Method name: boolean isHTMLEnabled() Method name: SendableMessage compose(IWorkerStatusController, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
XmlElement htmlElement = optionsElement.getElement("html");
1
XmlElement html
2
		// create html element, if it doesn't exist
2
 = composerOptions.getElement("html");
3
		if (htmlElement == null) {
3
			if (html == null) {
4
			htmlElement = optionsElement.addSubElement("html");
4
				html = composerOptions.addSubElement("html");
5
		}
5
			}
6
		// get enable attribute
6
		
7
		String enableHtml = htmlElement.getAttribute("enable", "false");
7
	String multipart = html.getAttribute("send_as_multipart", "true");
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.1
Clones locationClones are in different classes
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    XmlElement htmlElement = optionsElement.getElement("html");
    4
    XmlElement htmlElement = optionsElement.getElement("html");
    15
    XmlElement html = composerOptions.getElement("html");
    Differences
    Expression1Expression2Difference
    htmlElementhtmlVARIABLE_NAME_MISMATCH
    optionsElementcomposerOptionsVARIABLE_NAME_MISMATCH
    15
    XmlElement html = composerOptions.getElement("html");
    5
    if (htmlElement == null)
    5
    if (htmlElement == null)
    16
    if (html == null)
    Differences
    Expression1Expression2Difference
    htmlElementhtmlVARIABLE_NAME_MISMATCH
    16
    if (html == null)
    6
    htmlElement = optionsElement.addSubElement("html");
    6
    htmlElement = optionsElement.addSubElement("html");
    17
    html = composerOptions.addSubElement("html");
    Differences
    Expression1Expression2Difference
    htmlElementhtmlVARIABLE_NAME_MISMATCH
    optionsElementcomposerOptionsVARIABLE_NAME_MISMATCH
    17
    html = composerOptions.addSubElement("html");
    7
    String enableHtml = htmlElement.getAttribute("enable", "false");
    7
    String enableHtml = htmlElement.getAttribute("enable", "false");
    18
    String multipart = html.getAttribute("send_as_multipart", "true");
    Differences
    Expression1Expression2Difference
    enableHtmlmultipartVARIABLE_NAME_MISMATCH
    "enable""send_as_multipart"LITERAL_VALUE_MISMATCH
    "false""true"LITERAL_VALUE_MISMATCH
    htmlElementhtmlVARIABLE_NAME_MISMATCH
    18
    String multipart = html.getAttribute("send_as_multipart", "true");
    Precondition Violations (0)
    Row Violation