String region = ""; Element e5 = typeElement.getChild(VCARD.ADR_REGION); if (e5 != null) region = e5.getText(); String country = ""; Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY); if (e6 != null) country = e6.getText(); String label = ""; Element e7 = typeElement.getChild(VCARD.LABEL);
String poBox = ""; Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX); if (e1 != null) poBox = e1.getText(); String street = ""; Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS); if (e2 != null) street = e2.getText(); String locality = ""; Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
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: 10 Number of AST nodes: 10
1
String region = "";
1
String poBox = "";
2
			Element e5 = typeElement.getChild(VCARD.ADR_REGION);
2
			Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
3
			if (e5 != null)
3
			if (e1 != null)
4
				region = e5.getText();
4
				poBox = e1.getText();
5
			String country = "";
5
			String street = "";
6
			Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
6
			Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
7
			if (e6 != null)
7
			if (e2 != null)
8
				country = e6.getText();
8
				street = e2.getText();
9
			String label = "";
9
			String locality = "";
10
			Element e7 = typeElement.getChild(VCARD.LABEL);
10
			Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
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.3
Clones locationClones are in the same method
Number of node comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    24
    String region = "";
    24
    String region = "";
    8
    String poBox = "";
    Differences
    Expression1Expression2Difference
    regionpoBoxVARIABLE_NAME_MISMATCH
    8
    String poBox = "";
    25
    Element e5 = typeElement.getChild(VCARD.ADR_REGION);
    25
    Element e5 = typeElement.getChild(VCARD.ADR_REGION);
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    Differences
    Expression1Expression2Difference
    e5e1VARIABLE_NAME_MISMATCH
    ADR_REGIONADR_POSTOFFICEBOXVARIABLE_NAME_MISMATCH
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    26
    if (e5 != null)
    26
    if (e5 != null)
    10
    if (e1 != null)
    Differences
    Expression1Expression2Difference
    e5e1VARIABLE_NAME_MISMATCH
    10
    if (e1 != null)
    27
    region = e5.getText();
    27
    region = e5.getText();
    11
    poBox = e1.getText();
    Differences
    Expression1Expression2Difference
    regionpoBoxVARIABLE_NAME_MISMATCH
    e5e1VARIABLE_NAME_MISMATCH
    11
    poBox = e1.getText();
    28
    String country = "";
    28
    String country = "";
    12
    String street = "";
    Differences
    Expression1Expression2Difference
    countrystreetVARIABLE_NAME_MISMATCH
    12
    String street = "";
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    Differences
    Expression1Expression2Difference
    e6e2VARIABLE_NAME_MISMATCH
    ADR_COUNTRYADR_STREETADDRESSVARIABLE_NAME_MISMATCH
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    30
    if (e6 != null)
    30
    if (e6 != null)
    14
    if (e2 != null)
    Differences
    Expression1Expression2Difference
    e6e2VARIABLE_NAME_MISMATCH
    14
    if (e2 != null)
    31
    country = e6.getText();
    31
    country = e6.getText();
    15
    street = e2.getText();
    Differences
    Expression1Expression2Difference
    countrystreetVARIABLE_NAME_MISMATCH
    e6e2VARIABLE_NAME_MISMATCH
    15
    street = e2.getText();
    32
    String label = "";
    32
    String label = "";
    16
    String locality = "";
    Differences
    Expression1Expression2Difference
    labellocalityVARIABLE_NAME_MISMATCH
    16
    String locality = "";
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    17
    Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
    Differences
    Expression1Expression2Difference
    e7e3VARIABLE_NAME_MISMATCH
    LABELADR_LOCALITYVARIABLE_NAME_MISMATCH
    17
    Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables e7, label, region, country , while Clone fragment #2 returns variables e3, locality, poBox, street