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()) { IEmailModel m = (IEmailModel) it.next(); fillEmailView(m, emailComboBox3, emailTextField3); } if (it.hasNext()) { IEmailModel m = (IEmailModel) it.next(); fillEmailView(m, emailComboBox4, emailTextField4); } // we support up to 4 phone entries it = sourceModel.getPhoneIterator();
it = sourceModel.getInstantMessagingIterator(); 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); } if (it.hasNext()) { InstantMessagingModel m = (InstantMessagingModel) it.next(); fillIMView(m, imComboBox4, imTextField4); } // we support up to 3 address entries (work/private/other) it = sourceModel.getAddressIterator();
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: 13 Number of AST nodes: 14
1
it = sourceModel.getInstantMessagingIterator();
1
if (it.hasNext()) {
2
			if (it.hasNext()) {
2
				IEmailModel m = (IEmailModel) it.next();
3
				InstantMessagingModel m = (InstantMessagingModel) it.next();
3
				fillEmailView(m, emailComboBox1, emailTextField1);
4
				fillIMView(m, imComboBox1, imTextField1);
4
			}
5
			}
5
			if (it.hasNext()) {
6
			if (it.hasNext()) {
6
				IEmailModel m = (IEmailModel) it.next();
7
				InstantMessagingModel m = (InstantMessagingModel) it.next();
7
				fillEmailView(m, emailComboBox2, emailTextField2);
8
				fillIMView(m, imComboBox2, imTextField2);
8
			}
9
			}
9
			if (it.hasNext()) {
10
			if (it.hasNext()) {
10
				IEmailModel m = (IEmailModel) it.next();
11
				InstantMessagingModel m = (InstantMessagingModel) it.next();
11
				fillEmailView(m, emailComboBox3, emailTextField3);
12
				fillIMView(m, imComboBox3, imTextField3);
12
			}
13
			}
13
			if (it.hasNext()) {
14
			if (it.hasNext()) {
14
				IEmailModel m = (IEmailModel) it.next();
15
				InstantMessagingModel m = (InstantMessagingModel) it.next();
15
				fillEmailView(m, emailComboBox4, emailTextField4);
16
				fillIMView(m, imComboBox4, imTextField4);
16
			}
17
			}
17
			// we support up to 4 phone entries
18
			// we support up to 3 address entries (work/private/other)
18
			it = sourceModel.getPhoneIterator();
19
			it = sourceModel.getAddressIterator();
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.7
Clones locationClones are in the same method
Number of node comparisons99
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)176.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    27
    if (it.hasNext())
    53
    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
                                                                                      
                                                                                                                              
    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();
    29
    fillEmailView(m, emailComboBox1, emailTextField1);
    29
    fillEmailView(m, emailComboBox1, emailTextField1);
    55
    fillIMView(m, imComboBox1, imTextField1);
    Differences
    Expression1Expression2Difference
    fillEmailViewfillIMViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.IEmailModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillEmailView(m,emailComboBox1,emailTextField1) is a void method call, and thus it cannot be parameterized
    Expression fillIMView(m,imComboBox1,imTextField1) 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.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.IEmailModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    55
    fillIMView(m, imComboBox1, imTextField1);
    30
    if (it.hasNext())
    56
    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
                                                                                      
                                                                                                                              
    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();
    32
    fillEmailView(m, emailComboBox2, emailTextField2);
    32
    fillEmailView(m, emailComboBox2, emailTextField2);
    58
    fillIMView(m, imComboBox2, imTextField2);
    Differences
    Expression1Expression2Difference
    fillEmailViewfillIMViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.IEmailModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillEmailView(m,emailComboBox2,emailTextField2) is a void method call, and thus it cannot be parameterized
    Expression fillIMView(m,imComboBox2,imTextField2) 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.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.IEmailModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    58
    fillIMView(m, imComboBox2, imTextField2);
    33
    if (it.hasNext())
    59
    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
                                                                                      
                                                                                                                              
    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();
    35
    fillEmailView(m, emailComboBox3, emailTextField3);
    35
    fillEmailView(m, emailComboBox3, emailTextField3);
    61
    fillIMView(m, imComboBox3, imTextField3);
    Differences
    Expression1Expression2Difference
    fillEmailViewfillIMViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.IEmailModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillEmailView(m,emailComboBox3,emailTextField3) is a void method call, and thus it cannot be parameterized
    Expression fillIMView(m,imComboBox3,imTextField3) 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.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.IEmailModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    61
    fillIMView(m, imComboBox3, imTextField3);
    36
    if (it.hasNext())
    62
    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
                                                                                      
                                                                                                                              
    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
    63
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    38
    fillEmailView(m, emailComboBox4, emailTextField4);
    38
    fillEmailView(m, emailComboBox4, emailTextField4);
    64
    fillIMView(m, imComboBox4, imTextField4);
    Differences
    Expression1Expression2Difference
    fillEmailViewfillIMViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.IEmailModelorg.columba.addressbook.model.InstantMessagingModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillEmailView(m,emailComboBox4,emailTextField4) is a void method call, and thus it cannot be parameterized
    Expression fillIMView(m,imComboBox4,imTextField4) 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.InstantMessagingModel of variable m
    • Make classes org.columba.addressbook.model.IEmailModel and org.columba.addressbook.model.InstantMessagingModel extend a common superclass
    64
    fillIMView(m, imComboBox4, imTextField4);
    39
    it = sourceModel.getPhoneIterator();
    39
    it = sourceModel.getPhoneIterator();
    52
    it = sourceModel.getInstantMessagingIterator();
    Differences
    Expression1Expression2Difference
    getPhoneIteratorgetInstantMessagingIteratorMETHOD_INVOCATION_NAME_MISMATCH
    52
    it = sourceModel.getInstantMessagingIterator();
                                                                                    
    65
    it = sourceModel.getAddressIterator();
    Precondition Violations (20)
    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 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 fillEmailView(m,emailComboBox1,emailTextField1) is a void method call, and thus it cannot be parameterized
    4Expression fillIMView(m,imComboBox1,imTextField1) 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.InstantMessagingModel 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 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 fillEmailView(m,emailComboBox2,emailTextField2) is a void method call, and thus it cannot be parameterized
    9Expression fillIMView(m,imComboBox2,imTextField2) 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.InstantMessagingModel 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 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
    13Expression fillEmailView(m,emailComboBox3,emailTextField3) is a void method call, and thus it cannot be parameterized
    14Expression fillIMView(m,imComboBox3,imTextField3) 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.InstantMessagingModel of variable m
    16Unmatched 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
    17Unmatched 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
    18Expression fillEmailView(m,emailComboBox4,emailTextField4) is a void method call, and thus it cannot be parameterized
    19Expression fillIMView(m,imComboBox4,imTextField4) is a void method call, and thus it cannot be parameterized
    20Type org.columba.addressbook.model.IEmailModel of variable m does not match with type org.columba.addressbook.model.InstantMessagingModel of variable m