if (selection1 == null) { IBasicModelPartial[] items = new IBasicModelPartial[1]; items[0] = (IBasicModelPartial) getSelectedValue(); HeaderItemDNDManager.getInstance().setHeaderItemList(items); } else if (selection1.length != 0) { IBasicModelPartial[] items = new IBasicModelPartial[selection1.length]; items = selection1; HeaderItemDNDManager.getInstance().setHeaderItemList(items); }
if (selection1 == null) { IHeaderItem[] items = new IHeaderItem[1]; items[0] = (IHeaderItem) getSelectedValue(); HeaderItemDNDManager.getInstance().setHeaderItemList(items); } else if (selection1.length != 0) { IHeaderItem[] items = new IHeaderItem[selection1.length]; items = selection1; HeaderItemDNDManager.getInstance().setHeaderItemList(items); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookDNDListView.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/ContactDNDListView.java
Method name: void dragGestureRecognized(DragGestureEvent) Method name: void dragGestureRecognized(DragGestureEvent)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (selection1 == null) {
1
if (selection1 == null) {
2
				IBasicModelPartial[] items = new IBasicModelPartial[1];
2
				IHeaderItem[] items = new IHeaderItem[1];
3
				items[0] = (IBasicModelPartial) getSelectedValue();
3
				items[0] = (IHeaderItem) getSelectedValue();
4
				HeaderItemDNDManager.getInstance().setHeaderItemList(items);
4
				HeaderItemDNDManager.getInstance().setHeaderItemList(items);
5
			} else if (selection1.length != 0) {
5
			} else if (selection1.length != 0) {
6
				IBasicModelPartial[] items = new IBasicModelPartial[selection1.length];
6
				IHeaderItem[] items = new IHeaderItem[selection1.length];
7
				items = selection1;
7
				items = selection1;
8
				HeaderItemDNDManager.getInstance().setHeaderItemList(items);
8
				HeaderItemDNDManager.getInstance().setHeaderItemList(items);
9
			}
9
			}
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)5.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (selection1 == null)
    2
    if (selection1 == null)
    2
    if (selection1 == null)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.IBasicModelPartial[]org.columba.addressbook.facade.IHeaderItem[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.IBasicModelPartial[] of variable selection1 does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable selection1
    • Make classes org.columba.addressbook.model.IBasicModelPartial[] and org.columba.addressbook.facade.IHeaderItem[] extend a common superclass
    2
    if (selection1 == null)
                                                                                        
    3
    IHeaderItem[] items = new IHeaderItem[1];
    3
    IBasicModelPartial[] items = new IBasicModelPartial[1];
                                                                                                                    
                                                                                            
    4
    items[0] = (IHeaderItem)getSelectedValue();
    4
    items[0] = (IBasicModelPartial)getSelectedValue();
                                                                                                          
    5
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    5
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    5
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.IBasicModelPartial[]org.columba.addressbook.facade.IHeaderItem[]VARIABLE_TYPE_MISMATCH
    org.columba.addressbook.gui.list.HeaderItemDNDManagerorg.columba.mail.gui.contact.list.HeaderItemDNDManagerVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.gui.list.HeaderItemDNDManagerorg.columba.mail.gui.contact.list.HeaderItemDNDManagerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items
    • Make classes org.columba.addressbook.model.IBasicModelPartial[] and org.columba.addressbook.facade.IHeaderItem[] extend a common superclass
    Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.columba.addressbook.gui.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance() does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance()
    • Make classes org.columba.addressbook.gui.list.HeaderItemDNDManager and org.columba.mail.gui.contact.list.HeaderItemDNDManager extend a common superclass
    Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager
    • Make classes org.columba.addressbook.gui.list.HeaderItemDNDManager and org.columba.mail.gui.contact.list.HeaderItemDNDManager extend a common superclass
    5
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    6
    else if (selection1.length != 0)
    6
    else if (selection1.length != 0)
    6
    else if (selection1.length != 0)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.IBasicModelPartial[]org.columba.addressbook.facade.IHeaderItem[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable selection1.length does not match with type int of variable selection1.length
    • Make classes org.columba.addressbook.model.IBasicModelPartial[] and org.columba.addressbook.facade.IHeaderItem[] extend a common superclass
    6
    else if (selection1.length != 0)
                                                                                                                        
    7
    IHeaderItem[] items = new IHeaderItem[selection1.length];
    Preondition Violations
    Unmatched statement IHeaderItem[] items=new IHeaderItem[selection1.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7
    IHeaderItem[] items = new IHeaderItem[selection1.length];
    7
    IBasicModelPartial[] items = new IBasicModelPartial[selection1.length];
    7
    IBasicModelPartial[] items = new IBasicModelPartial[selection1.length];
    Preondition Violations
    Unmatched statement IBasicModelPartial[] items=new IBasicModelPartial[selection1.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                    
                                            
    8
    items = selection1;
    Preondition Violations
    Unmatched statement items=selection1; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8
    items = selection1;
    8
    items = selection1;
    8
    items = selection1;
    Preondition Violations
    Unmatched statement items=selection1; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
    9
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    9
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    9
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.IBasicModelPartial[]org.columba.addressbook.facade.IHeaderItem[]VARIABLE_TYPE_MISMATCH
    org.columba.addressbook.gui.list.HeaderItemDNDManagerorg.columba.mail.gui.contact.list.HeaderItemDNDManagerVARIABLE_TYPE_MISMATCH
    org.columba.addressbook.gui.list.HeaderItemDNDManagerorg.columba.mail.gui.contact.list.HeaderItemDNDManagerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items
    • Make classes org.columba.addressbook.model.IBasicModelPartial[] and org.columba.addressbook.facade.IHeaderItem[] extend a common superclass
    Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.columba.addressbook.gui.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance() does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance()
    • Make classes org.columba.addressbook.gui.list.HeaderItemDNDManager and org.columba.mail.gui.contact.list.HeaderItemDNDManager extend a common superclass
    Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager
    • Make classes org.columba.addressbook.gui.list.HeaderItemDNDManager and org.columba.mail.gui.contact.list.HeaderItemDNDManager extend a common superclass
    9
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    Precondition Violations (17)
    Row Violation
    1Type org.columba.addressbook.model.IBasicModelPartial[] of variable selection1 does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable selection1
    2Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items
    3Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type org.columba.addressbook.gui.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance() does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance()
    6Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager
    7Type int of variable selection1.length does not match with type int of variable selection1.length
    8Unmatched statement IHeaderItem[] items=new IHeaderItem[selection1.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9Unmatched statement IBasicModelPartial[] items=new IBasicModelPartial[selection1.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Unmatched statement items=selection1; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11Unmatched statement items=selection1; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    12Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items
    13Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type org.columba.addressbook.gui.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance() does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager of variable HeaderItemDNDManager.getInstance()
    16Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager
    17The refactoring of the clones is infeasible, because classes org.columba.addressbook.gui.list.AddressbookDNDListView and org.columba.mail.gui.contact.list.ContactDNDListView do not have a common superclass