XmlElement parent = Config.getInstance().get("views").getElement( "views"); XmlElement custom = parent.getElement("custom"); if (custom == null) custom = parent.addSubElement("custom");
XmlElement optionsElement = MailConfig.getInstance().get( "composer_options").getElement("/options"); XmlElement htmlElement = optionsElement.getElement("html"); // create html element, if it doesn't exist if (htmlElement == null) { htmlElement = optionsElement.addSubElement("html"); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/FrameManager.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/composer/MessageBuilderHelper.java
Method name: ViewItem createCustomViewItem(String) Method name: boolean isHTMLEnabled()
Number of AST nodes: 4 Number of AST nodes: 4
1
XmlElement parent = Config.getInstance().get("view
1
XmlElement optionsElement = MailConfig.getInstance().get(
2
s").getElement(
2
				"composer_options").getElement(
3
				"views");
3
"/options");
4
		XmlElement custom = parent.getElement("custom");
4
		XmlElement htmlElement = optionsElement.getElement("html");
5
		if (custom
5
		// create html element, if it doesn't exist
6
 == null)
6
		if (htmlElement == null) {
7
			custom = parent.addSubElement("custom");
7
			htmlElement = optionsElement.addSubElement("html");
8
		}
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.1
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-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)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    XmlElement parent = Config.getInstance().get("views").getElement("views");
    1
    XmlElement parent = Config.getInstance().get("views").getElement("views");
    4
    XmlElement htmlElement = optionsElement.getElement("html");
    Differences
    Expression1Expression2Difference
    parenthtmlElementVARIABLE_NAME_MISMATCH
    "views""html"LITERAL_VALUE_MISMATCH
    Config.getInstance().get("views")optionsElementTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression optionsElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    XmlElement htmlElement = optionsElement.getElement("html");
    2
    XmlElement custom = parent.getElement("custom");
    2
    XmlElement custom = parent.getElement("custom");
    3
    XmlElement optionsElement = MailConfig.getInstance().get("composer_options").getElement("/options");
    Differences
    Expression1Expression2Difference
    customoptionsElementVARIABLE_NAME_MISMATCH
    "custom""/options"LITERAL_VALUE_MISMATCH
    parentMailConfig.getInstance().get("composer_options")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    XmlElement optionsElement = MailConfig.getInstance().get("composer_options").getElement("/options");
    3
    if (custom == null)
    3
    if (custom == null)
    5
    if (htmlElement == null)
    Differences
    Expression1Expression2Difference
    customhtmlElementVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression custom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression htmlElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if (htmlElement == null)
    4
    custom = parent.addSubElement("custom");
    4
    custom = parent.addSubElement("custom");
    6
    htmlElement = optionsElement.addSubElement("html");
    Differences
    Expression1Expression2Difference
    customhtmlElementVARIABLE_NAME_MISMATCH
    "custom""html"LITERAL_VALUE_MISMATCH
    parentoptionsElementVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression custom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression htmlElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression optionsElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    htmlElement = optionsElement.addSubElement("html");
    Precondition Violations (8)
    Row Violation
    1Expression optionsElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression custom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression htmlElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression custom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression htmlElement cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression optionsElement cannot be parameterized, because it has dependencies to/from statements that will be extracted