if (it.hasNext()) { InstantMessagingModel m = (InstantMessagingModel) it.next(); fillIMView(m, imComboBox3, imTextField3); } if (it.hasNext()) { InstantMessagingModel m = (InstantMessagingModel) it.next(); fillIMView(m, imComboBox4, imTextField4); }
if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox3, telephoneTextField3); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox4, telephoneTextField4); }
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
				InstantMessagingModel m = (InstantMessagingModel) it.next();
2
				PhoneModel m = (PhoneModel) it.next();
3
				fillIMView(m, imComboBox3, imTextField3);
3
				fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
4
			}
4
			}
5
			if (it.hasNext()) {
5
			if (it.hasNext()) {
6
				InstantMessagingModel m = (InstantMessagingModel) it.next();
6
				PhoneModel m = (PhoneModel) it.next();
7
				fillIMView(m, imComboBox4, imTextField4);
7
				fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
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 statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)67.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    59
    if (it.hasNext())
    49
    if (it.hasNext())
                                                                                  
    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
    50
    PhoneModel m = (PhoneModel)it.next();
    60
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    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
                                                                                                                              
    61
    fillIMView(m, imComboBox3, imTextField3);
    61
    fillIMView(m, imComboBox3, imTextField3);
    51
    fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
    Differences
    Expression1Expression2Difference
    fillIMViewfillPhoneViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.PhoneModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillIMView(m,imComboBox3,imTextField3) is a void method call, and thus it cannot be parameterized
    Expression fillPhoneView(m,telephoneComboBox4,telephoneTextField4) is a void method call, and thus it cannot be parameterized
    Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.PhoneModel extend a common superclass
    51
    fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
    62
    if (it.hasNext())
    46
    if (it.hasNext())
                                                                                  
    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
    47
    PhoneModel m = (PhoneModel)it.next();
    63
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    63
    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
                                                                                                                              
    64
    fillIMView(m, imComboBox4, imTextField4);
    64
    fillIMView(m, imComboBox4, imTextField4);
    48
    fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
    Differences
    Expression1Expression2Difference
    fillIMViewfillPhoneViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.PhoneModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillIMView(m,imComboBox4,imTextField4) is a void method call, and thus it cannot be parameterized
    Expression fillPhoneView(m,telephoneComboBox3,telephoneTextField3) is a void method call, and thus it cannot be parameterized
    Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.PhoneModel extend a common superclass
    48
    fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
    Precondition Violations (10)
    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
    3Expression fillIMView(m,imComboBox3,imTextField3) is a void method call, and thus it cannot be parameterized
    4Expression fillPhoneView(m,telephoneComboBox4,telephoneTextField4) is a void method call, and thus it cannot be parameterized
    5Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    6Unmatched 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
    7Unmatched 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
    8Expression fillIMView(m,imComboBox4,imTextField4) is a void method call, and thus it cannot be parameterized
    9Expression fillPhoneView(m,telephoneComboBox3,telephoneTextField3) is a void method call, and thus it cannot be parameterized
    10Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m