String poBox = ""; Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX); if (e1 != null) poBox = e1.getText(); String street = ""; Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
String country = ""; Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY); if (e6 != null) country = e6.getText(); String label = ""; Element e7 = typeElement.getChild(VCARD.LABEL);
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: Iterator getAddressIterator() Method name: Iterator getAddressIterator()
Number of AST nodes: 6 Number of AST nodes: 6
1
String poBox = "";
1
String country = "";
2
			Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
2
			Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
3
			if (e1 != null)
3
			if (e6 != null)
4
				poBox = e1.getText();
4
				country = e6.getText();
5
			String street = "";
5
			String label = "";
6
			Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
6
			Element e7 = typeElement.getChild(VCARD.LABEL);
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.2
Clones locationClones are in the same method
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    String poBox = "";
    8
    String poBox = "";
    28
    String country = "";
    Differences
    Expression1Expression2Difference
    poBoxcountryVARIABLE_NAME_MISMATCH
    28
    String country = "";
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    Differences
    Expression1Expression2Difference
    e1e6VARIABLE_NAME_MISMATCH
    ADR_POSTOFFICEBOXADR_COUNTRYVARIABLE_NAME_MISMATCH
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    10
    if (e1 != null)
    10
    if (e1 != null)
    30
    if (e6 != null)
    Differences
    Expression1Expression2Difference
    e1e6VARIABLE_NAME_MISMATCH
    30
    if (e6 != null)
    11
    poBox = e1.getText();
    11
    poBox = e1.getText();
    31
    country = e6.getText();
    Differences
    Expression1Expression2Difference
    poBoxcountryVARIABLE_NAME_MISMATCH
    e1e6VARIABLE_NAME_MISMATCH
    31
    country = e6.getText();
    12
    String street = "";
    12
    String street = "";
    32
    String label = "";
    Differences
    Expression1Expression2Difference
    streetlabelVARIABLE_NAME_MISMATCH
    32
    String label = "";
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    Differences
    Expression1Expression2Difference
    e2e7VARIABLE_NAME_MISMATCH
    ADR_STREETADDRESSLABELVARIABLE_NAME_MISMATCH
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables e2, street, poBox , while Clone fragment #2 returns variables e7, label, country