StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getAddress() != null) { buf.append("<br> eMail: " + convert((String) item.getAddress())); }
StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getEmailAddress() != null) { buf.append("<br> eMail: " + convert((String) item.getEmailAddress())); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/util/ToolTipFactory.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/HeaderItemToolTipFactory.java
Method name: String createToolTip(ContactModelPartial) Method name: String createToolTip(IContactItem)
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.getAddress() != null) {
3
		if (item.getEmailAddress() != null) {
4
			buf.append("<br> eMail: "
4
			buf.append("<br> eMail: "
5
					+ convert((String) item.getAddress()));
5
					+ convert((String) item.getEmailAddress()));
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)19.6
    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.model.ContactModelPartialorg.columba.addressbook.facade.IContactItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.ContactModelPartial of variable item does not match with type org.columba.addressbook.facade.IContactItem of variable item
    • Make classes org.columba.addressbook.model.ContactModelPartial and org.columba.addressbook.facade.IContactItem extend a common superclass
    2
    buf.append("<html><body> Name: " + item.getName());
    3
    if (item.getAddress() != null)
    3
    if (item.getAddress() != null)
    3
    if (item.getEmailAddress() != null)
    Differences
    Expression1Expression2Difference
    getAddressgetEmailAddressMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.ContactModelPartialorg.columba.addressbook.facade.IContactItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.ContactModelPartial of variable item does not match with type org.columba.addressbook.facade.IContactItem of variable item
    • Make classes org.columba.addressbook.model.ContactModelPartial and org.columba.addressbook.facade.IContactItem extend a common superclass
    3
    if (item.getEmailAddress() != null)
    4
    buf.append("<br> eMail: " + convert((String)item.getAddress()));
    4
    buf.append("<br> eMail: " + convert((String)item.getAddress()));
    4
    buf.append("<br> eMail: " + convert((String)item.getEmailAddress()));
    Differences
    Expression1Expression2Difference
    getAddressgetEmailAddressMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.ContactModelPartialorg.columba.addressbook.facade.IContactItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.ContactModelPartial of variable item does not match with type org.columba.addressbook.facade.IContactItem of variable item
    • Make classes org.columba.addressbook.model.ContactModelPartial and org.columba.addressbook.facade.IContactItem extend a common superclass
    4
    buf.append("<br> eMail: " + convert((String)item.getEmailAddress()));
    Precondition Violations (3)
    Row Violation
    1Type org.columba.addressbook.model.ContactModelPartial of variable item does not match with type org.columba.addressbook.facade.IContactItem of variable item
    2Type org.columba.addressbook.model.ContactModelPartial of variable item does not match with type org.columba.addressbook.facade.IContactItem of variable item
    3Type org.columba.addressbook.model.ContactModelPartial of variable item does not match with type org.columba.addressbook.facade.IContactItem of variable item