StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getEmailAddress() != null) { buf.append("<br> eMail: " + convert((String) item.getEmailAddress())); }
StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getAddress() != null) { buf.append("<br> eMail: " + convert((String) item.getAddress())); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/HeaderItemToolTipFactory.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/util/ToolTipFactory.java
Method name: String createToolTip(IContactItem) Method name: String createToolTip(ContactModelPartial)
Number of AST nodes: 4 Number of AST nodes: 4
1
StringBuffer buf = new StringBuffer();
1
StringBuffer buf = new StringBuffer();
2
		buf.append("<html><body> Name: " + item.getName());
2
		buf.append("<html><body> Name: " + item.getName());
3
		if (item.getEmailAddress() != null) {
3
		if (item.getAddress() != null) {
4
			buf.append("<br> eMail: "
4
			buf.append("<br> eMail: "
5
					+ convert((String) item.getEmailAddress()));
5
					+ convert((String) item.getAddress()));
6
		}
6
		}
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 different classes
Number of node comparisons8
  1. {Non-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)4.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StringBuffer buf = new StringBuffer();
    1
    StringBuffer buf = new StringBuffer();
    2
    buf.append("<html><body> Name: " + item.getName());
    2
    buf.append("<html><body> Name: " + item.getName());
    2
    buf.append("<html><body> Name: " + item.getName());
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.facade.IContactItemorg.columba.addressbook.model.ContactModelPartialVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.facade.IContactItem of variable item does not match with type org.columba.addressbook.model.ContactModelPartial of variable item
    • Make classes org.columba.addressbook.facade.IContactItem and org.columba.addressbook.model.ContactModelPartial extend a common superclass
    2
    buf.append("<html><body> Name: " + item.getName());
    3
    if (item.getEmailAddress() != null)
    3
    if (item.getEmailAddress() != null)
    3
    if (item.getAddress() != null)
    Differences
    Expression1Expression2Difference
    getEmailAddressgetAddressMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.facade.IContactItemorg.columba.addressbook.model.ContactModelPartialVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.facade.IContactItem of variable item does not match with type org.columba.addressbook.model.ContactModelPartial of variable item
    • Make classes org.columba.addressbook.facade.IContactItem and org.columba.addressbook.model.ContactModelPartial extend a common superclass
    3
    if (item.getAddress() != null)
    4
    buf.append("<br> eMail: " + convert((String)item.getEmailAddress()));
    4
    buf.append("<br> eMail: " + convert((String)item.getEmailAddress()));
    4
    buf.append("<br> eMail: " + convert((String)item.getAddress()));
    Differences
    Expression1Expression2Difference
    getEmailAddressgetAddressMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.facade.IContactItemorg.columba.addressbook.model.ContactModelPartialVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression item.getEmailAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression item.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.columba.addressbook.facade.IContactItem of variable item does not match with type org.columba.addressbook.model.ContactModelPartial of variable item
    • Make classes org.columba.addressbook.facade.IContactItem and org.columba.addressbook.model.ContactModelPartial extend a common superclass
    4
    buf.append("<br> eMail: " + convert((String)item.getAddress()));
    Precondition Violations (5)
    Row Violation
    1Type org.columba.addressbook.facade.IContactItem of variable item does not match with type org.columba.addressbook.model.ContactModelPartial of variable item
    2Type org.columba.addressbook.facade.IContactItem of variable item does not match with type org.columba.addressbook.model.ContactModelPartial of variable item
    3Expression item.getEmailAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression item.getAddress() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type org.columba.addressbook.facade.IContactItem of variable item does not match with type org.columba.addressbook.model.ContactModelPartial of variable item