if (telephoneComboBox.getSelectedIndex() == 15) destModel.addPhone(new PhoneModel(telephoneTextField.getText(), PhoneModel.TYPE_TELEX)); else if (telephoneComboBox.getSelectedIndex() == 16) destModel.addPhone(new PhoneModel(telephoneTextField.getText(), PhoneModel.TYPE_TTY));
if (imComboBox.getSelectedIndex() == 3) destModel.addInstantMessaging(new InstantMessagingModel( imTextField.getText(), InstantMessagingModel.TYPE_MSN)); else if (imComboBox.getSelectedIndex() == 4) destModel.addInstantMessaging(new InstantMessagingModel( imTextField.getText(), InstantMessagingModel.TYPE_ICQ));
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 fillPhoneModel(JTextField, JComboBox, ContactModel) Method name: void fillIMModel(JTextField, JComboBox, ContactModel)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (telephoneComboBox.getSelectedIndex() == 15)
1
if (imComboBox.getSelectedIndex() == 3)
2
				destModel.addPhone(new PhoneModel(telephone
2
				destModel.addInstantMessaging(new InstantMessagingModel(
3
TextField.getText(),
3
						imTextField.getText(),
4
						PhoneModel.TYPE_TELEX));
4
 InstantMessagingModel.TYPE_MSN));
5
			else if (telephoneComboBox.getSelectedIndex() == 16)
5
			else if (imComboBox.getSelectedIndex() == 4)
6
				destModel.addPhone(new PhoneModel(telephone
6
				destModel.addInstantMessaging(new InstantMessagingModel(
7
TextField.getText(),
7
						imTextField.getText(),
8
						PhoneModel.TYPE_TTY));
8
 InstantMessagingModel.TYPE_ICQ));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    32
    else if (telephoneComboBox.getSelectedIndex() == 15)
    32
    else if (telephoneComboBox.getSelectedIndex() == 15)
    10
    else if (imComboBox.getSelectedIndex() == 4)
    Differences
    Expression1Expression2Difference
    telephoneComboBoximComboBoxVARIABLE_NAME_MISMATCH
    154LITERAL_VALUE_MISMATCH
    10
    else if (imComboBox.getSelectedIndex() == 4)
    33
    destModel.addPhone(new PhoneModel(telephoneTextField.getText(), PhoneModel.TYPE_TELEX));
                                                                                                                                                                                          
    34
    else if (telephoneComboBox.getSelectedIndex() == 16)
    34
    else if (telephoneComboBox.getSelectedIndex() == 16)
    8
    else if (imComboBox.getSelectedIndex() == 3)
    Differences
    Expression1Expression2Difference
    telephoneComboBoximComboBoxVARIABLE_NAME_MISMATCH
    163LITERAL_VALUE_MISMATCH
    8
    else if (imComboBox.getSelectedIndex() == 3)
                                                                                                                                                                                                                                        
    9
    destModel.addInstantMessaging(new InstantMessagingModel(imTextField.getText(), InstantMessagingModel.TYPE_MSN));
    35
    destModel.addPhone(new PhoneModel(telephoneTextField.getText(), PhoneModel.TYPE_TTY));
                                                                                                                                                                                      
                                                                                                                                                                                                                                          
    11
    destModel.addInstantMessaging(new InstantMessagingModel(imTextField.getText(), InstantMessagingModel.TYPE_ICQ));
    Precondition Violations (0)
    Row Violation