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);
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);
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 poBox = "";
1
String region = "";
2
			Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
2
			Element e5 = typeElement.getChild(VCARD.ADR_REGION);
3
			if (e1 != null)
3
			if (e5 != null)
4
				poBox = e1.getText();
4
				region = e5.getText();
5
			String street = "";
5
			String country = "";
6
			Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
6
			Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
7
			if (e2 != null)
7
			if (e6 != null)
8
				street = e2.getText();
8
				country = e6.getText();
9
			String locality = "";
9
			String label = "";
10
			Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
10
			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.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)2.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    String poBox = "";
    8
    String poBox = "";
    24
    String region = "";
    Differences
    Expression1Expression2Difference
    poBoxregionVARIABLE_NAME_MISMATCH
    24
    String region = "";
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    25
    Element e5 = typeElement.getChild(VCARD.ADR_REGION);
    Differences
    Expression1Expression2Difference
    e1e5VARIABLE_NAME_MISMATCH
    ADR_POSTOFFICEBOXADR_REGIONVARIABLE_NAME_MISMATCH
    25
    Element e5 = typeElement.getChild(VCARD.ADR_REGION);
    10
    if (e1 != null)
    10
    if (e1 != null)
    26
    if (e5 != null)
    Differences
    Expression1Expression2Difference
    e1e5VARIABLE_NAME_MISMATCH
    26
    if (e5 != null)
    11
    poBox = e1.getText();
    11
    poBox = e1.getText();
    27
    region = e5.getText();
    Differences
    Expression1Expression2Difference
    poBoxregionVARIABLE_NAME_MISMATCH
    e1e5VARIABLE_NAME_MISMATCH
    27
    region = e5.getText();
    12
    String street = "";
    12
    String street = "";
    28
    String country = "";
    Differences
    Expression1Expression2Difference
    streetcountryVARIABLE_NAME_MISMATCH
    28
    String country = "";
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    Differences
    Expression1Expression2Difference
    e2e6VARIABLE_NAME_MISMATCH
    ADR_STREETADDRESSADR_COUNTRYVARIABLE_NAME_MISMATCH
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    14
    if (e2 != null)
    14
    if (e2 != null)
    30
    if (e6 != null)
    Differences
    Expression1Expression2Difference
    e2e6VARIABLE_NAME_MISMATCH
    30
    if (e6 != null)
    15
    street = e2.getText();
    15
    street = e2.getText();
    31
    country = e6.getText();
    Differences
    Expression1Expression2Difference
    streetcountryVARIABLE_NAME_MISMATCH
    e2e6VARIABLE_NAME_MISMATCH
    31
    country = e6.getText();
    16
    String locality = "";
    16
    String locality = "";
    32
    String label = "";
    Differences
    Expression1Expression2Difference
    localitylabelVARIABLE_NAME_MISMATCH
    32
    String label = "";
    17
    Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
    17
    Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    Differences
    Expression1Expression2Difference
    e3e7VARIABLE_NAME_MISMATCH
    ADR_LOCALITYLABELVARIABLE_NAME_MISMATCH
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables e3, locality, poBox, street , while Clone fragment #2 returns variables e7, label, region, country