Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); }
Element child = getParentElement().getChild(key); if (child == null) { child = new Element(key); getParentElement().addContent(child); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java
Method name: void set(String, String, String) Method name: String get(String, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
Element child = getParentElement().getChild(key);
1
Element child = getParentElement().getChild(key);
2
		if (child == null) {
2
		if (child == null) {
3
			child = new Element(key);
3
			child = new Element(key);
4
			getParentElement().addContent(child);
4
			getParentElement().addContent(child);
5
		}
5
		}
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 declared in the same class
Number of node comparisons10
  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.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    Element child = getParentElement().getChild(key);
    1
    Element child = getParentElement().getChild(key);
    2
    if (child == null)
    2
    if (child == null)
    3
    child = new Element(key);
    3
    child = new Element(key);
    4
    getParentElement().addContent(child);
    4
    getParentElement().addContent(child);
    Precondition Violations (0)
    Row Violation