if (emailComboBox.getSelectedIndex() == 0) destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_WORK)); if (emailComboBox.getSelectedIndex() == 1) destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_HOME));
if (emailComboBox.getSelectedIndex() == 1) destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_HOME)); if (emailComboBox.getSelectedIndex() == 2) destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_OTHER));
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 fillEmailModel(JTextField, JComboBox, ContactModel) Method name: void fillEmailModel(JTextField, JComboBox, ContactModel)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (emailComboBox.getSelectedIndex() == 0)
1
if (emailComboBox.getSelectedIndex() == 1)
2
				destModel.addEmail(new EmailModel(emailTextField.getText(),
2
				destModel.addEmail(new EmailModel(emailTextField.getText(),
3
						EmailModel.TYPE_WORK));
3
						EmailModel.TYPE_HOME));
4
			if (emailComboBox.getSelectedIndex() == 1)
4
			if (emailComboBox.getSelectedIndex() == 2)
5
				destModel.addEmail(new EmailModel(emailTextField.getText(),
5
				destModel.addEmail(new EmailModel(emailTextField.getText(),
6
						EmailModel.TYPE_HOME));
6
						EmailModel.TYPE_OTHER));
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 in the same method
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (emailComboBox.getSelectedIndex() == 0)
    2
    if (emailComboBox.getSelectedIndex() == 0)
    4
    if (emailComboBox.getSelectedIndex() == 1)
    Differences
    Expression1Expression2Difference
    01LITERAL_VALUE_MISMATCH
    4
    if (emailComboBox.getSelectedIndex() == 1)
    3
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_WORK));
    3
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_WORK));
    5
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_HOME));
    Differences
    Expression1Expression2Difference
    TYPE_WORKTYPE_HOMEVARIABLE_NAME_MISMATCH
    5
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_HOME));
    4
    if (emailComboBox.getSelectedIndex() == 1)
    4
    if (emailComboBox.getSelectedIndex() == 1)
    6
    if (emailComboBox.getSelectedIndex() == 2)
    Differences
    Expression1Expression2Difference
    12LITERAL_VALUE_MISMATCH
    6
    if (emailComboBox.getSelectedIndex() == 2)
    5
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_HOME));
    5
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_HOME));
    7
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_OTHER));
    Differences
    Expression1Expression2Difference
    TYPE_HOMETYPE_OTHERVARIABLE_NAME_MISMATCH
    7
    destModel.addEmail(new EmailModel(emailTextField.getText(), EmailModel.TYPE_OTHER));
    Precondition Violations (0)
    Row Violation