XmlElement parent = Config.getInstance().get("views").getElement( "views"); XmlElement custom = parent.getElement("custom"); if (custom == null) custom = parent.addSubElement("custom");
XmlElement gui = MailConfig.getInstance().get("options").getElement( "/options/gui"); XmlElement messageviewer = gui.getElement("messageviewer"); if (messageviewer == null) { messageviewer = gui.addSubElement("messageviewer"); }
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/gui/message/viewer/TextViewer.java
Method name: ViewItem createCustomViewItem(String) Method name: void initConfiguration()
Number of AST nodes: 4 Number of AST nodes: 4
1
XmlElement parent = Config.getInstance().get("views").getElement(
1
XmlElement gui = MailConfig.getInstance().get("options").getElement(
2
				"views");
2
				"/options/gui");
3
		XmlElement custom = parent.getElement("custom");
3
		XmlElement messageviewer = gui.getElement("messageviewer");
4
		if (custom == null)
4
		if (messageviewer == null) {
5
			custom = parent.addSubElement("custom");
5
			messageviewer = gui.addSubElement("messageviewer");
6
		}
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.3
    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");
    2
    XmlElement messageviewer = gui.getElement("messageviewer");
    Differences
    Expression1Expression2Difference
    parentmessageviewerVARIABLE_NAME_MISMATCH
    "views""messageviewer"LITERAL_VALUE_MISMATCH
    Config.getInstance().get("views")guiTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression gui cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    XmlElement messageviewer = gui.getElement("messageviewer");
    2
    XmlElement custom = parent.getElement("custom");
    2
    XmlElement custom = parent.getElement("custom");
    1
    XmlElement gui = MailConfig.getInstance().get("options").getElement("/options/gui");
    Differences
    Expression1Expression2Difference
    customguiVARIABLE_NAME_MISMATCH
    "custom""/options/gui"LITERAL_VALUE_MISMATCH
    parentMailConfig.getInstance().get("options")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression parent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    XmlElement gui = MailConfig.getInstance().get("options").getElement("/options/gui");
    3
    if (custom == null)
    3
    if (custom == null)
    3
    if (messageviewer == null)
    Differences
    Expression1Expression2Difference
    custommessageviewerVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression custom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression messageviewer cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (messageviewer == null)
    4
    custom = parent.addSubElement("custom");
    4
    custom = parent.addSubElement("custom");
    4
    messageviewer = gui.addSubElement("messageviewer");
    Differences
    Expression1Expression2Difference
    custommessageviewerVARIABLE_NAME_MISMATCH
    "custom""messageviewer"LITERAL_VALUE_MISMATCH
    parentguiVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression custom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression messageviewer 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 gui cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    messageviewer = gui.addSubElement("messageviewer");
    Precondition Violations (8)
    Row Violation
    1Expression gui 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 messageviewer 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 messageviewer 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 gui cannot be parameterized, because it has dependencies to/from statements that will be extracted