it = sourceModel.getPhoneIterator(); 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); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox4, telephoneTextField4); } // we support up to 4 im entries 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();
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(); 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); } if (it.hasNext()) { PhoneModel m = (PhoneModel) it.next(); fillPhoneView(m, telephoneComboBox4, telephoneTextField4); } // we support up to 4 im entries it = sourceModel.getInstantMessagingIterator();
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: 27 Number of AST nodes: 26
1
it = sourceModel.getPhoneIterator();
2
			if (it.hasNext()) {
1
if (it.hasNext()) {
3
				PhoneModel m = (PhoneModel) it.next();
2
				IEmailModel m = (IEmailModel) it.next();
4
				fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
3
				fillEmailView(m, emailComboBox1, emailTextField1);
5
			}
4
			}
6
			if (it.hasNext()) {
5
			if (it.hasNext()) {
7
				PhoneModel m = (PhoneModel) it.next();
6
				IEmailModel m = (IEmailModel) it.next();
8
				fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
7
				fillEmailView(m, emailComboBox2, emailTextField2);
9
			}
8
			}
10
			if (it.hasNext()) {
9
			if (it.hasNext()) {
11
				PhoneModel m = (PhoneModel) it.next();
10
				IEmailModel m = (IEmailModel) it.next();
12
				fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
11
				fillEmailView(m, emailComboBox3, emailTextField3);
13
			}
12
			}
14
			if (it.hasNext()) {
13
			if (it.hasNext()) {
15
				PhoneModel m = (PhoneModel) it.next();
14
				IEmailModel m = (IEmailModel) it.next();
16
				fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
15
				fillEmailView(m, emailComboBox4, emailTextField4);
17
			}
16
			}
18
			// we support up to 4 im entries
17
			// we support up to 4 phone entries
19
			it = sourceModel.getInstantMessagingIterator();
18
			it = sourceModel.getPhoneIterator();
20
			if (it.hasNext()) {
19
			if (it.hasNext()) {
21
				InstantMessagingModel m = (InstantMessagingModel) it.next();
20
				PhoneModel m = (PhoneModel) it.next();
22
				fillIMView(m, imComboBox1, imTextField1);
21
				fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
23
			}
22
			}
24
			if (it.hasNext()) {
23
			if (it.hasNext()) {
25
				InstantMessagingModel m = (InstantMessagingModel) it.next();
24
				PhoneModel m = (PhoneModel) it.next();
26
				fillIMView(m, imComboBox2, imTextField2);
25
				fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
27
			}
26
			}
28
			if (it.hasNext()) {
27
			if (it.hasNext()) {
29
				InstantMessagingModel m = (InstantMessagingModel) it.next();
28
				PhoneModel m = (PhoneModel) it.next();
30
				fillIMView(m, imComboBox3, imTextField3);
29
				fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
31
			}
30
			}
32
			if (it.hasNext()) {
31
			if (it.hasNext()) {
33
				InstantMessagingModel m = (InstantMessagingModel) it.next();
32
				PhoneModel m = (PhoneModel) it.next();
34
				fillIMView(m, imComboBox4, imTextField4);
33
				fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
35
			}
34
			}
36
			// we support up to 3 address entries (work/private/other)
35
			// we support up to 4 im entries
37
			it = sourceModel.getAddressIterator();
36
			it = sourceModel.getInstantMessagingIterator();
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)2.6
Clones locationClones are in the same method
Number of node comparisons359
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements22
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)3063.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    39
    it = sourceModel.getPhoneIterator();
    39
    it = sourceModel.getPhoneIterator();
    40
    if (it.hasNext())
    40
    if (it.hasNext())
    41
    PhoneModel m = (PhoneModel)it.next();
    41
    PhoneModel m = (PhoneModel)it.next();
    42
    fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
    42
    fillPhoneView(m, telephoneComboBox1, telephoneTextField1);
    43
    if (it.hasNext())
    43
    if (it.hasNext())
    44
    PhoneModel m = (PhoneModel)it.next();
    44
    PhoneModel m = (PhoneModel)it.next();
    45
    fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
    45
    fillPhoneView(m, telephoneComboBox2, telephoneTextField2);
    46
    if (it.hasNext())
    46
    if (it.hasNext())
    47
    PhoneModel m = (PhoneModel)it.next();
    47
    PhoneModel m = (PhoneModel)it.next();
    48
    fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
    48
    fillPhoneView(m, telephoneComboBox3, telephoneTextField3);
    49
    if (it.hasNext())
    49
    if (it.hasNext())
    50
    PhoneModel m = (PhoneModel)it.next();
    50
    PhoneModel m = (PhoneModel)it.next();
    51
    fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
    51
    fillPhoneView(m, telephoneComboBox4, telephoneTextField4);
    52
    it = sourceModel.getInstantMessagingIterator();
    52
    it = sourceModel.getInstantMessagingIterator();
    53
    if (it.hasNext())
    36
    if (it.hasNext())
                                                                                      
    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
    37
    IEmailModel m = (IEmailModel)it.next();
    54
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    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
                                                                                                                              
    55
    fillIMView(m, imComboBox1, imTextField1);
    55
    fillIMView(m, imComboBox1, imTextField1);
    38
    fillEmailView(m, emailComboBox4, emailTextField4);
    Differences
    Expression1Expression2Difference
    fillIMViewfillEmailViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.IEmailModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillIMView(m,imComboBox1,imTextField1) is a void method call, and thus it cannot be parameterized
    Expression fillEmailView(m,emailComboBox4,emailTextField4) 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.IEmailModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.IEmailModel extend a common superclass
    38
    fillEmailView(m, emailComboBox4, emailTextField4);
    56
    if (it.hasNext())
    33
    if (it.hasNext())
                                                                                      
    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
    34
    IEmailModel m = (IEmailModel)it.next();
    57
    InstantMessagingModel m = (InstantMessagingModel)it.next();
    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
                                                                                                                              
    58
    fillIMView(m, imComboBox2, imTextField2);
    58
    fillIMView(m, imComboBox2, imTextField2);
    35
    fillEmailView(m, emailComboBox3, emailTextField3);
    Differences
    Expression1Expression2Difference
    fillIMViewfillEmailViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.IEmailModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillIMView(m,imComboBox2,imTextField2) is a void method call, and thus it cannot be parameterized
    Expression fillEmailView(m,emailComboBox3,emailTextField3) 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.IEmailModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.IEmailModel extend a common superclass
    35
    fillEmailView(m, emailComboBox3, emailTextField3);
    59
    if (it.hasNext())
    30
    if (it.hasNext())
                                                                                      
    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
    31
    IEmailModel m = (IEmailModel)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);
    32
    fillEmailView(m, emailComboBox2, emailTextField2);
    Differences
    Expression1Expression2Difference
    fillIMViewfillEmailViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.IEmailModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillIMView(m,imComboBox3,imTextField3) is a void method call, and thus it cannot be parameterized
    Expression fillEmailView(m,emailComboBox2,emailTextField2) 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.IEmailModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.IEmailModel extend a common superclass
    32
    fillEmailView(m, emailComboBox2, emailTextField2);
    62
    if (it.hasNext())
    27
    if (it.hasNext())
                                                                                      
    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
    28
    IEmailModel m = (IEmailModel)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);
    29
    fillEmailView(m, emailComboBox1, emailTextField1);
    Differences
    Expression1Expression2Difference
    fillIMViewfillEmailViewMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.addressbook.model.InstantMessagingModelorg.columba.addressbook.model.IEmailModelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression fillIMView(m,imComboBox4,imTextField4) is a void method call, and thus it cannot be parameterized
    Expression fillEmailView(m,emailComboBox1,emailTextField1) 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.IEmailModel of variable m
    • Make classes org.columba.addressbook.model.InstantMessagingModel and org.columba.addressbook.model.IEmailModel extend a common superclass
    29
    fillEmailView(m, emailComboBox1, emailTextField1);
    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 fillIMView(m,imComboBox1,imTextField1) is a void method call, and thus it cannot be parameterized
    4Expression fillEmailView(m,emailComboBox4,emailTextField4) 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.IEmailModel 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 fillIMView(m,imComboBox2,imTextField2) is a void method call, and thus it cannot be parameterized
    9Expression fillEmailView(m,emailComboBox3,emailTextField3) 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.IEmailModel 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 fillIMView(m,imComboBox3,imTextField3) is a void method call, and thus it cannot be parameterized
    14Expression fillEmailView(m,emailComboBox2,emailTextField2) is a void method call, and thus it cannot be parameterized
    15Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel 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 fillIMView(m,imComboBox4,imTextField4) is a void method call, and thus it cannot be parameterized
    19Expression fillEmailView(m,emailComboBox1,emailTextField1) is a void method call, and thus it cannot be parameterized
    20Type org.columba.addressbook.model.InstantMessagingModel of variable m does not match with type org.columba.addressbook.model.IEmailModel of variable m