if (m.getType() == PhoneModel.TYPE_PRIMARY_PHONE) telephoneComboBox.setSelectedIndex(13); else if (m.getType() == PhoneModel.TYPE_RADIO) telephoneComboBox.setSelectedIndex(14); else if (m.getType() == PhoneModel.TYPE_TELEX) telephoneComboBox.setSelectedIndex(15); else if (m.getType() == PhoneModel.TYPE_TTY) telephoneComboBox.setSelectedIndex(16);
if (m.getType() == InstantMessagingModel.TYPE_AIM) imComboBox.setSelectedIndex(1); else 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);
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 fillPhoneView(PhoneModel, JComboBox, JTextField) Method name: void fillIMView(InstantMessagingModel, JComboBox, JTextField)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (m.getType() == PhoneModel.TYPE_PRIMARY_PHONE)
1
if (m.getType() == 
2
			telephone
2
InstantMessagingModel.TYPE_AIM)
3
ComboBox.setSelectedIndex(13);
3
			imComboBox.setSelectedIndex(1);
4
		else if (m.getType() == PhoneModel.TYPE_RADIO)
4
		else if (m.getType() == InstantMessagingModel.TYPE_YAHOO)
5
			telephoneComboBox.setSelectedIndex(14);
5
			imComboBox.setSelectedIndex(2);
6
		else if (m.getType() == PhoneModel.TYPE_TELEX)
6
		else if (m.getType() == 
7
			telephone
7
InstantMessagingModel.TYPE_MSN)
8
ComboBox.setSelectedIndex(15);
8
			imComboBox.setSelectedIndex(3);
9
		else if (m.getType() == PhoneModel.TYPE_TTY)
9
		else if (m.getType() == InstantMessagingModel.TYPE_ICQ)
10
			telephoneComboBox.setSelectedIndex(16);
10
			imComboBox.setSelectedIndex(4);
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)2.5
Clones locationClones are declared in the same class
Number of node comparisons46
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    else if (m.getType() == PhoneModel.TYPE_PRIMARY_PHONE)
    27
    else if (m.getType() == PhoneModel.TYPE_PRIMARY_PHONE)
    3
    else if (m.getType() == InstantMessagingModel.TYPE_AIM)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    TYPE_PRIMARY_PHONETYPE_AIMVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    3
    else if (m.getType() == InstantMessagingModel.TYPE_AIM)
    28
    telephoneComboBox.setSelectedIndex(13);
    28
    telephoneComboBox.setSelectedIndex(13);
    4
    imComboBox.setSelectedIndex(1);
    Differences
    Expression1Expression2Difference
    131LITERAL_VALUE_MISMATCH
    telephoneComboBoximComboBoxVARIABLE_NAME_MISMATCH
    4
    imComboBox.setSelectedIndex(1);
    29
    else if (m.getType() == PhoneModel.TYPE_RADIO)
    29
    else if (m.getType() == PhoneModel.TYPE_RADIO)
    5
    else if (m.getType() == InstantMessagingModel.TYPE_YAHOO)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    TYPE_RADIOTYPE_YAHOOVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    5
    else if (m.getType() == InstantMessagingModel.TYPE_YAHOO)
    30
    telephoneComboBox.setSelectedIndex(14);
    30
    telephoneComboBox.setSelectedIndex(14);
    6
    imComboBox.setSelectedIndex(2);
    Differences
    Expression1Expression2Difference
    142LITERAL_VALUE_MISMATCH
    telephoneComboBoximComboBoxVARIABLE_NAME_MISMATCH
    6
    imComboBox.setSelectedIndex(2);
    31
    else if (m.getType() == PhoneModel.TYPE_TELEX)
    31
    else if (m.getType() == PhoneModel.TYPE_TELEX)
    7
    else if (m.getType() == InstantMessagingModel.TYPE_MSN)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    TYPE_TELEXTYPE_MSNVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    7
    else if (m.getType() == InstantMessagingModel.TYPE_MSN)
    32
    telephoneComboBox.setSelectedIndex(15);
    32
    telephoneComboBox.setSelectedIndex(15);
    8
    imComboBox.setSelectedIndex(3);
    Differences
    Expression1Expression2Difference
    153LITERAL_VALUE_MISMATCH
    telephoneComboBoximComboBoxVARIABLE_NAME_MISMATCH
    8
    imComboBox.setSelectedIndex(3);
    33
    else if (m.getType() == PhoneModel.TYPE_TTY)
    33
    else if (m.getType() == PhoneModel.TYPE_TTY)
    9
    else if (m.getType() == InstantMessagingModel.TYPE_ICQ)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.model.PhoneModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    TYPE_TTYTYPE_ICQVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel
    • Make classes org.columba.addressbook.model.PhoneModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    9
    else if (m.getType() == InstantMessagingModel.TYPE_ICQ)
    34
    telephoneComboBox.setSelectedIndex(16);
    34
    telephoneComboBox.setSelectedIndex(16);
    10
    imComboBox.setSelectedIndex(4);
    Differences
    Expression1Expression2Difference
    164LITERAL_VALUE_MISMATCH
    telephoneComboBoximComboBoxVARIABLE_NAME_MISMATCH
    10
    imComboBox.setSelectedIndex(4);
    Precondition Violations (8)
    Row Violation
    1Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    2Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel
    3Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    4Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel
    5Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    6Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel
    7Type org.columba.addressbook.model.PhoneModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m
    8Type org.columba.addressbook.model.PhoneModel does not match with type org.columba.addressbook.model.InstantMessagingModel