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"); }
XmlElement parent = Config.getInstance().get("views").getElement( "views"); XmlElement custom = parent.getElement("custom"); if (custom == null) custom = parent.addSubElement("custom");
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/core/src/main/java/org/columba/core/gui/frame/FrameManager.java
Method name: boolean isHTMLEnabled() Method name: ViewItem createCustomViewItem(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
XmlElement optionsElement = MailConfig.getInstance().get(
1
XmlElement parent = Config.getInstance().get(
2
				"composer_options").getElement("/option
2
"views").getElement(
3
s");
3
				"views");
4
		XmlElement htmlElement = optionsElement.getElement("html");
4
		XmlElement custom = parent.getElement("custom");
5
		// create html element, if it doesn't exist
5
		
6
		if (htmlElement == null) {
6
if (custom == null)
7
			htmlElement = optionsElement.addSubElement("html");
7
			custom = parent.addSubElement("
8
		}
8
custom");
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)15.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    XmlElement optionsElement = MailConfig.getInstance().get("composer_options").getElement("/options");
    3
    XmlElement optionsElement = MailConfig.getInstance().get("composer_options").getElement("/options");
    1
    XmlElement parent = Config.getInstance().get("views").getElement("views");
    Differences
    Expression1Expression2Difference
    optionsElementparentVARIABLE_NAME_MISMATCH
    "/options""views"LITERAL_VALUE_MISMATCH
    "composer_options""views"LITERAL_VALUE_MISMATCH
    org.columba.mail.config.MailConfigorg.columba.core.config.ConfigVARIABLE_TYPE_MISMATCH
    org.columba.mail.config.MailConfigorg.columba.core.config.ConfigVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.mail.config.MailConfig of variable MailConfig.getInstance() does not match with type org.columba.core.config.Config of variable Config.getInstance()
    • Make classes org.columba.mail.config.MailConfig and org.columba.core.config.Config extend a common superclass
    Type org.columba.mail.config.MailConfig does not match with type org.columba.core.config.Config
    • Make classes org.columba.mail.config.MailConfig and org.columba.core.config.Config extend a common superclass
    1
    XmlElement parent = Config.getInstance().get("views").getElement("views");
    4
    XmlElement htmlElement = optionsElement.getElement("html");
    4
    XmlElement htmlElement = optionsElement.getElement("html");
    2
    XmlElement custom = parent.getElement("custom");
    Differences
    Expression1Expression2Difference
    htmlElementcustomVARIABLE_NAME_MISMATCH
    "html""custom"LITERAL_VALUE_MISMATCH
    optionsElementparentVARIABLE_NAME_MISMATCH
    2
    XmlElement custom = parent.getElement("custom");
    5
    if (htmlElement == null)
    5
    if (htmlElement == null)
    3
    if (custom == null)
    Differences
    Expression1Expression2Difference
    htmlElementcustomVARIABLE_NAME_MISMATCH
    3
    if (custom == null)
    6
    htmlElement = optionsElement.addSubElement("html");
    6
    htmlElement = optionsElement.addSubElement("html");
    4
    custom = parent.addSubElement("custom");
    Differences
    Expression1Expression2Difference
    htmlElementcustomVARIABLE_NAME_MISMATCH
    "html""custom"LITERAL_VALUE_MISMATCH
    optionsElementparentVARIABLE_NAME_MISMATCH
    4
    custom = parent.addSubElement("custom");
    Precondition Violations (2)
    Row Violation
    1Type org.columba.mail.config.MailConfig of variable MailConfig.getInstance() does not match with type org.columba.core.config.Config of variable Config.getInstance()
    2Type org.columba.mail.config.MailConfig does not match with type org.columba.core.config.Config