if (contactModel.getSortString() != null) parser.set(VCARD.SORTSTRING, contactModel.getSortString()); // <fn>value</fn> if (contactModel.getFormattedName() != null) parser.set(VCARD.FN, contactModel.getFormattedName());
if (contactModel.getProfession() != null) parser.set(VCARD.ROLE, contactModel.getProfession()); if (contactModel.getTitle() != null) parser.set(VCARD.TITLE, contactModel.getTitle());
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/model/ContactModelXMLFactory.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/model/ContactModelXMLFactory.java
Method name: Document marshall(IContactModel) Method name: Document marshall(IContactModel)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (contactModel.getSortString() != null)
1
if (contactModel.getProfession() != null)
2
			parser.set(VCARD.SORTSTRING, contactModel.getSortString());
2
			parser.set(VCARD.ROLE, contactModel.get
3
		// <fn>value</fn>;
3
Profession());
4
		if (contactModel.getFormattedName() != null)
4
		if (contactModel.getTitle() != null)
5
			parser.set(VCARD.FN, contactModel.getFormattedName());
5
			parser.set(VCARD.TITLE, contactModel.getTitle());
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.4
Clones locationClones are in the same method
Number of node comparisons13
  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)10.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (contactModel.getSortString() != null)
    5
    if (contactModel.getSortString() != null)
    32
    if (contactModel.getProfession() != null)
    Differences
    Expression1Expression2Difference
    getSortStringgetProfessionMETHOD_INVOCATION_NAME_MISMATCH
    32
    if (contactModel.getProfession() != null)
    6
    parser.set(VCARD.SORTSTRING, contactModel.getSortString());
    6
    parser.set(VCARD.SORTSTRING, contactModel.getSortString());
    33
    parser.set(VCARD.ROLE, contactModel.getProfession());
    Differences
    Expression1Expression2Difference
    SORTSTRINGROLEVARIABLE_NAME_MISMATCH
    getSortStringgetProfessionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression contactModel.getSortString() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression contactModel.getProfession() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    33
    parser.set(VCARD.ROLE, contactModel.getProfession());
    7
    if (contactModel.getFormattedName() != null)
    7
    if (contactModel.getFormattedName() != null)
    34
    if (contactModel.getTitle() != null)
    Differences
    Expression1Expression2Difference
    getFormattedNamegetTitleMETHOD_INVOCATION_NAME_MISMATCH
    34
    if (contactModel.getTitle() != null)
    8
    parser.set(VCARD.FN, contactModel.getFormattedName());
    8
    parser.set(VCARD.FN, contactModel.getFormattedName());
    35
    parser.set(VCARD.TITLE, contactModel.getTitle());
    Differences
    Expression1Expression2Difference
    FNTITLEVARIABLE_NAME_MISMATCH
    getFormattedNamegetTitleMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression contactModel.getFormattedName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression contactModel.getTitle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35
    parser.set(VCARD.TITLE, contactModel.getTitle());
    Precondition Violations (4)
    Row Violation
    1Expression contactModel.getSortString() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression contactModel.getProfession() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression contactModel.getFormattedName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression contactModel.getTitle() cannot be parameterized, because it has dependencies to/from statements that will be extracted