if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } IContactModelPartial result = (IContactModelPartial) value;
if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } BasicModelPartial item = (BasicModelPartial) value;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/ContactList.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookListRenderer.java
Method name: Component getListCellRendererComponent(JList, Object, int, boolean, boolean) Method name: Component getListCellRendererComponent(JList, Object, int, boolean, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (isSelected) {
1
if (isSelected) {
2
				setBackground(list.getSelectionBackground());
2
			setBackground(list.getSelectionBackground());
3
				setForeground(list.getSelectionForeground());
3
			setForeground(list.getSelectionForeground());
4
			} else {
4
		} else {
5
				setBackground(list.getBackground());
5
			setBackground(list.getBackground());
6
				setForeground(list.getForeground());
6
			setForeground(list.getForeground());
7
			}
7
		}
8
			IContactModelPartial result = (IContactModelPartial) value;
8
		BasicModelPartial item = (BasicModelPartial) value;
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons26
  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)3.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isSelected)
    1
    if (isSelected)
    2
    setBackground(list.getSelectionBackground());
    2
    setBackground(list.getSelectionBackground());
    3
    setForeground(list.getSelectionForeground());
    3
    setForeground(list.getSelectionForeground());
    else
    else
    4
    setBackground(list.getBackground());
    4
    setBackground(list.getBackground());
    5
    setForeground(list.getForeground());
    5
    setForeground(list.getForeground());
    6
    IContactModelPartial result = (IContactModelPartial)value;
    6
    IContactModelPartial result = (IContactModelPartial)value;
    6
    BasicModelPartial item = (BasicModelPartial)value;
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.IContactModelPartialorg.columba.addressbook.model.BasicModelPartialSUBCLASS_TYPE_MISMATCH
    resultitemVARIABLE_NAME_MISMATCH
    org.columba.addressbook.model.IContactModelPartialorg.columba.addressbook.model.BasicModelPartialSUBCLASS_TYPE_MISMATCH
    org.columba.addressbook.model.IContactModelPartialorg.columba.addressbook.model.BasicModelPartialSUBCLASS_TYPE_MISMATCH
    6
    BasicModelPartial item = (BasicModelPartial)value;
    Precondition Violations (2)
    Row Violation
    1Clone fragment #1 returns variable result with type org.columba.addressbook.model.IContactModelPartial , while Clone fragment #2 returns variable item with type org.columba.addressbook.model.BasicModelPartial
    2The refactoring of the clones is infeasible, because classes org.columba.contact.gui.box.ContactList.MyListCellRenderer and org.columba.addressbook.gui.list.AddressbookListRenderer do not have a common superclass