if (m.getType() == InstantMessagingModel.TYPE_YAHOO) imComboBox.setSelectedIndex(2); else if (m.getType() == InstantMessagingModel.TYPE_MSN) imComboBox.setSelectedIndex(3); else if (m.getType() == InstantMessagingModel.TYPE_ICQ) imComboBox.setSelectedIndex(4);
if (m.getType() == EmailModel.TYPE_WORK) comboBox.setSelectedIndex(0); else if (m.getType() == EmailModel.TYPE_HOME) comboBox.setSelectedIndex(1); else if (m.getType() == EmailModel.TYPE_OTHER) comboBox.setSelectedIndex(2);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/contact/ContactEditorDialog.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/contact/ContactEditorDialog.java
Method name: void fillIMView(InstantMessagingModel, JComboBox, JTextField) Method name: void fillEmailView(IEmailModel, JComboBox, JTextField)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (m.getType() == InstantMessagingModel.TYPE_YAHOO)
1
if (m.getType() == EmailModel.TYPE_WORK)
2
			imComboBox.setSelectedIndex(2);
2
			comboBox.setSelectedIndex(0);
3
		else if (m.getType() == InstantMessagingModel.TYPE_MSN)
3
		else if (m.getType() == EmailModel.TYPE_HOME)
4
			imComboBox.setSelectedIndex(3);
4
			comboBox.setSelectedIndex(1);
5
		else if (m.getType() == InstantMessagingModel.TYPE_ICQ)
5
		else if (m.getType() == EmailModel.TYPE_OTHER)
6
			imComboBox.setSelectedIndex(4);
6
			comboBox.setSelectedIndex(2);
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)1.1
Clones locationClones are declared in the same class
Number of node comparisons27
  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)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    else if (m.getType() == InstantMessagingModel.TYPE_YAHOO)
    5
    else if (m.getType() == InstantMessagingModel.TYPE_YAHOO)
    5
    else if (m.getType() == EmailModel.TYPE_OTHER)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.IEmailModelVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.EmailModelVARIABLE_TYPE_MISMATCH
    TYPE_YAHOOTYPE_OTHERVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.IEmailModel extend a common superclass
    Type org.columba.addressbook.model.InstantMessagingModel of variable InstantMessagingModel does not match with type org.columba.addressbook.model.EmailModel of variable EmailModel
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.EmailModel extend a common superclass
    5
    else if (m.getType() == EmailModel.TYPE_OTHER)
    6
    imComboBox.setSelectedIndex(2);
    6
    imComboBox.setSelectedIndex(2);
    6
    comboBox.setSelectedIndex(2);
    Differences
    Expression1Expression2Difference
    imComboBoxcomboBoxVARIABLE_NAME_MISMATCH
    6
    comboBox.setSelectedIndex(2);
    7
    else if (m.getType() == InstantMessagingModel.TYPE_MSN)
    7
    else if (m.getType() == InstantMessagingModel.TYPE_MSN)
    3
    else if (m.getType() == EmailModel.TYPE_HOME)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.IEmailModelVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.EmailModelVARIABLE_TYPE_MISMATCH
    TYPE_MSNTYPE_HOMEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.IEmailModel extend a common superclass
    Type org.columba.addressbook.model.InstantMessagingModel of variable InstantMessagingModel does not match with type org.columba.addressbook.model.EmailModel of variable EmailModel
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.EmailModel extend a common superclass
    3
    else if (m.getType() == EmailModel.TYPE_HOME)
    8
    imComboBox.setSelectedIndex(3);
    8
    imComboBox.setSelectedIndex(3);
    4
    comboBox.setSelectedIndex(1);
    Differences
    Expression1Expression2Difference
    31LITERAL_VALUE_MISMATCH
    imComboBoxcomboBoxVARIABLE_NAME_MISMATCH
    4
    comboBox.setSelectedIndex(1);
    9
    else if (m.getType() == InstantMessagingModel.TYPE_ICQ)
    9
    else if (m.getType() == InstantMessagingModel.TYPE_ICQ)
    1
    else if (m.getType() == EmailModel.TYPE_WORK)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.IEmailModelVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.EmailModelVARIABLE_TYPE_MISMATCH
    TYPE_ICQTYPE_WORKVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.IEmailModel extend a common superclass
    Type org.columba.addressbook.model.InstantMessagingModel of variable InstantMessagingModel does not match with type org.columba.addressbook.model.EmailModel of variable EmailModel
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.EmailModel extend a common superclass
    1
    else if (m.getType() == EmailModel.TYPE_WORK)
    10
    imComboBox.setSelectedIndex(4);
    10
    imComboBox.setSelectedIndex(4);
    2
    comboBox.setSelectedIndex(0);
    Differences
    Expression1Expression2Difference
    40LITERAL_VALUE_MISMATCH
    imComboBoxcomboBoxVARIABLE_NAME_MISMATCH
    2
    comboBox.setSelectedIndex(0);
    Precondition Violations (6)
    Row Violation
    1Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel of variable m
    2Type org.columba.addressbook.model.InstantMessagingModel of variable InstantMessagingModel does not match with type org.columba.addressbook.model.EmailModel of variable EmailModel
    3Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel of variable m
    4Type org.columba.addressbook.model.InstantMessagingModel of variable InstantMessagingModel does not match with type org.columba.addressbook.model.EmailModel of variable EmailModel
    5Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel of variable m
    6Type org.columba.addressbook.model.InstantMessagingModel of variable InstantMessagingModel does not match with type org.columba.addressbook.model.EmailModel of variable EmailModel