if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox2, telephoneTextField2); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox3, telephoneTextField3); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox4, telephoneTextField4); }
if (it.hasNext()) { InstantMessagingModel m = (InstantMessagingModel) it.next(); fillIMView(m, imComboBox1, imTextField1); } if (it.hasNext()) { InstantMessagingModel m = (InstantMessagingModel) it.next(); fillIMView(m, imComboBox2, imTextField2); } if (it.hasNext()) { InstantMessagingModel m = (InstantMessagingModel) it.next(); fillIMView(m, imComboBox3, imTextField3); }
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: 9 Number of AST nodes: 9
1
if (it.hasNext()) {
1
if (it.hasNext()) {
2
				PhoneModel m = (PhoneModel) it.next();
2
				InstantMessagingModel m = (InstantMessagingModel) it.next();
3
				fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
3
				fillIMView(m, imComboBox1, imTextField1);
4
			}
4
			}
5
			if (it.hasNext()) {
5
			if (it.hasNext()) {
6
				PhoneModel m = (PhoneModel) it.next();
6
				InstantMessagingModel m = (InstantMessagingModel) it.next();
7
				fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
7
				fillIMView(m, imComboBox2, imTextField2);
8
			}
8
			}
9
			if (it.hasNext()) {
9
			if (it.hasNext()) {
10
				PhoneModel m = (PhoneModel) it.next();
10
				InstantMessagingModel m = (InstantMessagingModel) it.next();
11
				fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
11
				fillIMView(m, imComboBox3, imTextField3);
12
			}
12
			}
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.6
Clones locationClones are in the same method
Number of node comparisons58
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)318.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    43
    if (it.hasNext())
    53
    if (it.hasNext())
    44
    PhoneModel m = (PhoneModel)it.next();
    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
                                                                                  
    45
    fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
                                                                                                                            
                                                                                                                              
    54
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    Preondition Violations
    Unmatched statement InstantMessagingModel m=(InstantMessagingModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    54
    InstantMessagingModel m = (InstantMessagingModel)it.next();
                                                                                          
    55
    fillIMView(m, imComboBox1, imTextField1);
    46
    if (it.hasNext())
    56
    if (it.hasNext())
    47
    PhoneModel m = (PhoneModel)it.next();
    47
    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
                                                                                  
    48
    fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
                                                                                                                            
                                                                                                                              
    57
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    Preondition Violations
    Unmatched statement InstantMessagingModel m=(InstantMessagingModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    57
    InstantMessagingModel m = (InstantMessagingModel)it.next();
                                                                                          
    58
    fillIMView(m, imComboBox2, imTextField2);
    49
    if (it.hasNext())
    59
    if (it.hasNext())
    50
    PhoneModel m = (PhoneModel)it.next();
    50
    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
                                                                                  
    51
    fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
                                                                                                                            
                                                                                                                              
    60
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    Preondition Violations
    Unmatched statement InstantMessagingModel m=(InstantMessagingModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    60
    InstantMessagingModel m = (InstantMessagingModel)it.next();
                                                                                          
    61
    fillIMView(m, imComboBox3, imTextField3);
    Precondition Violations (7)
    Row Violation
    1Unmatched 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
    2Unmatched statement InstantMessagingModel m=(InstantMessagingModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched 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
    4Unmatched statement InstantMessagingModel m=(InstantMessagingModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched 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
    6Unmatched statement InstantMessagingModel m=(InstantMessagingModel)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero