String street = ""; Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS); if (e2 != null) street = e2.getText(); String locality = ""; Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY); if (e3 != null) locality = e3.getText(); String postalCode = ""; Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE); if (e4 != null) postalCode = e4.getText(); 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); if (e3 != null) locality = e3.getText(); String postalCode = ""; Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE); if (e4 != null) postalCode = e4.getText(); String region = ""; Element e5 = typeElement.getChild(VCARD.ADR_REGION); if (e5 != null) region = e5.getText(); String country = ""; Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
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: 22 Number of AST nodes: 22
1
String poBox = "";
2
			Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
3
			if (e1 != null)
4
				poBox = e1.getText();
1
String street = "";
5
			String street = "";
2
			Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
6
			Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
3
			if (e2 != null)
7
			if (e2 != null)
4
				street = e2.getText();
8
				street = e2.getText();
5
			String locality = "";
9
			String locality = "";
6
			Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
10
			Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
7
			if (e3 != null)
11
			if (e3 != null)
8
				locality = e3.getText();
12
				locality = e3.getText();
9
			String postalCode = "";
13
			String postalCode = "";
10
			Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE);
14
			Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE);
11
			if (e4 != null)
15
			if (e4 != null)
12
				postalCode = e4.getText();
16
				postalCode = e4.getText();
13
			String region = "";
17
			String region = "";
14
			Element e5 = typeElement.getChild(VCARD.ADR_REGION);
18
			Element e5 = typeElement.getChild(VCARD.ADR_REGION);
15
			if (e5 != null)
19
			if (e5 != null)
16
				region = e5.getText();
20
				region = e5.getText();
17
			String country = "";
21
			String country = "";
18
			Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
22
			Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
19
			if (e6 != null)
20
				country = e6.getText();
21
			String label = "";
22
			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)1.0
Clones locationClones are in the same method
Number of node comparisons215
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements22
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    String street = "";
    12
    String street = "";
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    13
    Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);
    14
    if (e2 != null)
    14
    if (e2 != null)
    15
    street = e2.getText();
    15
    street = e2.getText();
    16
    String locality = "";
    16
    String locality = "";
    17
    Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
    17
    Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);
    18
    if (e3 != null)
    18
    if (e3 != null)
    19
    locality = e3.getText();
    19
    locality = e3.getText();
    20
    String postalCode = "";
    20
    String postalCode = "";
    21
    Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE);
    21
    Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE);
    22
    if (e4 != null)
    22
    if (e4 != null)
    23
    postalCode = e4.getText();
    23
    postalCode = e4.getText();
    24
    String region = "";
    24
    String region = "";
    25
    Element e5 = typeElement.getChild(VCARD.ADR_REGION);
    25
    Element e5 = typeElement.getChild(VCARD.ADR_REGION);
    26
    if (e5 != null)
    26
    if (e5 != null)
    27
    region = e5.getText();
    27
    region = e5.getText();
    28
    String country = "";
    28
    String country = "";
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    29
    Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);
    30
    if (e6 != null)
    30
    if (e6 != null)
    10
    if (e1 != null)
    Differences
    Expression1Expression2Difference
    e6e1VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression e6 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (e1 != null)
    31
    country = e6.getText();
    31
    country = e6.getText();
    11
    poBox = e1.getText();
    Differences
    Expression1Expression2Difference
    countrypoBoxVARIABLE_NAME_MISMATCH
    e6e1VARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression country cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression poBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e6 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    poBox = e1.getText();
    32
    String label = "";
    32
    String label = "";
    8
    String poBox = "";
    Differences
    Expression1Expression2Difference
    labelpoBoxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression poBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    String poBox = "";
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    33
    Element e7 = typeElement.getChild(VCARD.LABEL);
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    Differences
    Expression1Expression2Difference
    e7e1VARIABLE_NAME_MISMATCH
    LABELADR_POSTOFFICEBOXVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression e1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);
    Precondition Violations (9)
    Row Violation
    1Expression e6 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression e1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression country cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression poBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression e6 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression e1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression poBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression e1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Clone fragment #1 returns variables e7, label, street, locality, postalCode, region, country , while Clone fragment #2 returns variables e6, country, poBox, street, locality, postalCode, region