StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getDescription() != null) { buf.append("<br> Description: " + item.getDescription()); } buf.append("</body></html>"); return buf.toString();
StringBuffer buf = new StringBuffer(); buf.append("<html><body> Name: " + item.getName()); if (item.getDescription() != null) { buf.append("<br> Description: " + item.getDescription()); } buf.append("</body></html>"); return buf.toString();
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(GroupModelPartial) Method name: String createToolTip(IGroupItem)
Number of AST nodes: 6 Number of AST nodes: 6
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.getDescription() != null) {
3
		if (item.getDescription() != null) {
4
			buf.append("<br> Description: " + item.getDescription());
4
			buf.append("<br> Description: " + item.getDescription());
5
		}
5
		}
6
		buf.append("</body></html>");
6
		buf.append("</body></html>");
7
		return buf.toString();
7
		return buf.toString();
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 comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.0
    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.GroupModelPartialorg.columba.addressbook.facade.IGroupItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.GroupModelPartial of variable item does not match with type org.columba.addressbook.facade.IGroupItem of variable item
    • Make classes org.columba.addressbook.model.GroupModelPartial and org.columba.addressbook.facade.IGroupItem extend a common superclass
    2
    buf.append("<html><body> Name: " + item.getName());
    3
    if (item.getDescription() != null)
    3
    if (item.getDescription() != null)
    3
    if (item.getDescription() != null)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.GroupModelPartialorg.columba.addressbook.facade.IGroupItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.GroupModelPartial of variable item does not match with type org.columba.addressbook.facade.IGroupItem of variable item
    • Make classes org.columba.addressbook.model.GroupModelPartial and org.columba.addressbook.facade.IGroupItem extend a common superclass
    3
    if (item.getDescription() != null)
    4
    buf.append("<br> Description: " + item.getDescription());
    4
    buf.append("<br> Description: " + item.getDescription());
    4
    buf.append("<br> Description: " + item.getDescription());
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.GroupModelPartialorg.columba.addressbook.facade.IGroupItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.GroupModelPartial of variable item does not match with type org.columba.addressbook.facade.IGroupItem of variable item
    • Make classes org.columba.addressbook.model.GroupModelPartial and org.columba.addressbook.facade.IGroupItem extend a common superclass
    4
    buf.append("<br> Description: " + item.getDescription());
    5
    buf.append("</body></html>");
    5
    buf.append("</body></html>");
    6
    return buf.toString();
    6
    return buf.toString();
    Precondition Violations (3)
    Row Violation
    1Type org.columba.addressbook.model.GroupModelPartial of variable item does not match with type org.columba.addressbook.facade.IGroupItem of variable item
    2Type org.columba.addressbook.model.GroupModelPartial of variable item does not match with type org.columba.addressbook.facade.IGroupItem of variable item
    3Type org.columba.addressbook.model.GroupModelPartial of variable item does not match with type org.columba.addressbook.facade.IGroupItem of variable item