if (it.hasNext()) { IEmailModel m = (IEmailModel) it.next(); fillEmailView(m, emailComboBox1, emailTextField1); } if (it.hasNext()) { IEmailModel m = (IEmailModel) it.next(); fillEmailView(m, emailComboBox2, emailTextField2); }
if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox1, telephoneTextField1); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox2, telephoneTextField2); }
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 updateComponents(boolean) Method name: void updateComponents(boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (it.hasNext()) {
1
if (it.hasNext()) {
2
				IEmailModel m = (IEmailModel) it.next();
2
				PhoneModel m = (PhoneModel) it.next();
3
				fillEmailView(m, emailComboBox1, emailTextField1);
3
				fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
4
			}
4
			}
5
			if (it.hasNext()) {
5
			if (it.hasNext()) {
6
				IEmailModel m = (IEmailModel) it.next();
6
				PhoneModel m = (PhoneModel) it.next();
7
				fillEmailView(m, emailComboBox2, emailTextField2);
7
				fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
8
			}
8
			}
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.3
Clones locationClones are in the same method
Number of node comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)139.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    if (it.hasNext())
    40
    if (it.hasNext())
    28
    IEmailModel m = (IEmailModel)it.next();
    28
    IEmailModel m = (IEmailModel)it.next();
    Preondition Violations
    Unmatched statement IEmailModel m=(IEmailModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                      
    29
    fillEmailView(m, emailComboBox1, emailTextField1);
                                                                                                            
                                                                                  
    41
    PhoneModel m = (PhoneModel)it.next();
    Preondition Violations
    Unmatched statement PhoneModel m=(PhoneModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    41
    PhoneModel m = (PhoneModel)it.next();
                                                                                                                            
    42
    fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
    30
    if (it.hasNext())
    43
    if (it.hasNext())
    31
    IEmailModel m = (IEmailModel)it.next();
    31
    IEmailModel m = (IEmailModel)it.next();
    Preondition Violations
    Unmatched statement IEmailModel m=(IEmailModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                      
    32
    fillEmailView(m, emailComboBox2, emailTextField2);
                                                                                                            
                                                                                  
    44
    PhoneModel m = (PhoneModel)it.next();
    Preondition Violations
    Unmatched statement PhoneModel m=(PhoneModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    44
    PhoneModel m = (PhoneModel)it.next();
                                                                                                                            
    45
    fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
    Precondition Violations (5)
    Row Violation
    1Unmatched statement IEmailModel m=(IEmailModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement PhoneModel m=(PhoneModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement IEmailModel m=(IEmailModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement PhoneModel m=(PhoneModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero