if (it.hasNext()) { IEmailModel m = (IEmailModel) it.next(); fillEmailView(m, emailComboBox2, emailTextField2); } if (it.hasNext()) { IEmailModel m = (IEmailModel) it.next(); fillEmailView(m, emailComboBox3, emailTextField3); } if (it.hasNext()) { IEmailModel m = (IEmailModel) it.next(); fillEmailView(m, emailComboBox4, emailTextField4); }
if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox1, telephoneTextField1); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox2, telephoneTextField2); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox3, telephoneTextField3); }
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
				IEmailModel m = (IEmailModel) it.next();
2
				PhoneModel m = (PhoneModel) it.next();
3
				fillEmailView(m, emailComboBox2, emailTextField2);
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, emailComboBox3, emailTextField3);
7
				fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
8
			}
8
			}
9
			if (it.hasNext()) {
9
			if (it.hasNext()) {
10
				IEmailModel m = (IEmailModel) it.next();
10
				PhoneModel m = (PhoneModel) it.next();
11
				fillEmailView(m, emailComboBox4, emailTextField4);
11
				fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
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.5
Clones locationClones are in the same method
Number of node comparisons58
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)124.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    30
    if (it.hasNext())
    40
    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
                                                                                      
                                                                                  
    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();
    32
    fillEmailView(m, emailComboBox2, emailTextField2);
    32
    fillEmailView(m, emailComboBox2, emailTextField2);
    42
    fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
    Differences
    Expression1Expression2Difference
    fillEmailViewfillPhoneViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.IEmailModelorg.columba.addressbook.model.PhoneModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillEmailView(m,emailComboBox2,emailTextField2) is a void method call, and thus it cannot be parameterized
    Expression fillPhoneView(m,telephoneComboBox1,telephoneTextField1) is a void method call, and thus it cannot be parameterized
    Type org.columba.addressbook.model.IEmailModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    • Make classes org.columba.addressbook.model.IEmailModel and org.columba.addressbook.model.PhoneModel extend a common superclass
    42
    fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
    33
    if (it.hasNext())
    43
    if (it.hasNext())
    34
    IEmailModel m = (IEmailModel)it.next();
    34
    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
                                                                                      
                                                                                  
    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();
    35
    fillEmailView(m, emailComboBox3, emailTextField3);
    35
    fillEmailView(m, emailComboBox3, emailTextField3);
    45
    fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
    Differences
    Expression1Expression2Difference
    fillEmailViewfillPhoneViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.IEmailModelorg.columba.addressbook.model.PhoneModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillEmailView(m,emailComboBox3,emailTextField3) is a void method call, and thus it cannot be parameterized
    Expression fillPhoneView(m,telephoneComboBox2,telephoneTextField2) is a void method call, and thus it cannot be parameterized
    Type org.columba.addressbook.model.IEmailModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    • Make classes org.columba.addressbook.model.IEmailModel and org.columba.addressbook.model.PhoneModel extend a common superclass
    45
    fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
    36
    if (it.hasNext())
    46
    if (it.hasNext())
    37
    IEmailModel m = (IEmailModel)it.next();
    37
    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
                                                                                      
                                                                                  
    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();
    38
    fillEmailView(m, emailComboBox4, emailTextField4);
    38
    fillEmailView(m, emailComboBox4, emailTextField4);
    48
    fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
    Differences
    Expression1Expression2Difference
    fillEmailViewfillPhoneViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.IEmailModelorg.columba.addressbook.model.PhoneModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillEmailView(m,emailComboBox4,emailTextField4) 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.IEmailModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    • Make classes org.columba.addressbook.model.IEmailModel and org.columba.addressbook.model.PhoneModel extend a common superclass
    48
    fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
    Precondition Violations (15)
    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
    3Expression fillEmailView(m,emailComboBox2,emailTextField2) is a void method call, and thus it cannot be parameterized
    4Expression fillPhoneView(m,telephoneComboBox1,telephoneTextField1) is a void method call, and thus it cannot be parameterized
    5Type org.columba.addressbook.model.IEmailModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    6Unmatched 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
    7Unmatched 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
    8Expression fillEmailView(m,emailComboBox3,emailTextField3) is a void method call, and thus it cannot be parameterized
    9Expression fillPhoneView(m,telephoneComboBox2,telephoneTextField2) is a void method call, and thus it cannot be parameterized
    10Type org.columba.addressbook.model.IEmailModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m
    11Unmatched 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
    12Unmatched 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
    13Expression fillEmailView(m,emailComboBox4,emailTextField4) is a void method call, and thus it cannot be parameterized
    14Expression fillPhoneView(m,telephoneComboBox3,telephoneTextField3) is a void method call, and thus it cannot be parameterized
    15Type org.columba.addressbook.model.IEmailModel of variable m does not match with type org.columba.addressbook.model.PhoneModel of variable m