if (selection2.length != 0) { IBasicModelPartial[] items = new IBasicModelPartial[selection2.length]; items = selection2; HeaderItemDNDManager.getInstance().setHeaderItemList(items); } else { IBasicModelPartial[] items = new IBasicModelPartial[1]; items[0] = (IBasicModelPartial) getSelectedValue(); HeaderItemDNDManager.getInstance().setHeaderItemList(items); }
if (selection2.length != 0) { IHeaderItem[] items = new IHeaderItem[selection2.length]; items = selection2; HeaderItemDNDManager.getInstance().setHeaderItemList(items); } else { IHeaderItem[] items = new IHeaderItem[1]; items[0] = (IHeaderItem) getSelectedValue(); 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: 7 Number of AST nodes: 7
1
if (selection2.length != 0) {
1
if (selection2.length != 0) {
2
				IBasicModelPartial[] items = new IBasicModelPartial[selection2.length];
2
				IHeaderItem[] items = new IHeaderItem[selection2.length];
3
				items = selection2;
3
				items = selection2;
4
				HeaderItemDNDManager.getInstance().setHeaderItemList(items);
4
				HeaderItemDNDManager.getInstance().setHeaderItemList(items);
5
			} else {
5
			} else {
6
				IBasicModelPartial[] items = new IBasicModelPartial[1];
6
				IHeaderItem[] items = new IHeaderItem[1];
7
				items[0] = (IBasicModelPartial) getSelectedValue();
7
				items[0] = (IHeaderItem) getSelectedValue();
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 comparisons52
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)6.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (selection2.length != 0)
    10
    if (selection2.length != 0)
    10
    if (selection2.length != 0)
    Differences
    Expression1Expression2Difference
    org.columba.addressbook.model.IBasicModelPartial[]org.columba.addressbook.facade.IHeaderItem[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable selection2.length does not match with type int of variable selection2.length
    • Make classes org.columba.addressbook.model.IBasicModelPartial[] and org.columba.addressbook.facade.IHeaderItem[] extend a common superclass
    10
    if (selection2.length != 0)
                                                                                                                          
    11
    IHeaderItem[] items = new IHeaderItem[selection2.length];
    Preondition Violations
    Unmatched statement IHeaderItem[] items=new IHeaderItem[selection2.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11
    IHeaderItem[] items = new IHeaderItem[selection2.length];
    11
    IBasicModelPartial[] items = new IBasicModelPartial[selection2.length];
    11
    IBasicModelPartial[] items = new IBasicModelPartial[selection2.length];
    Preondition Violations
    Unmatched statement IBasicModelPartial[] items=new IBasicModelPartial[selection2.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                      
                                              
    12
    items = selection2;
    Preondition Violations
    Unmatched statement items=selection2; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    12
    items = selection2;
    12
    items = selection2;
    12
    items = selection2;
    Preondition Violations
    Unmatched statement items=selection2; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                              
    13
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    13
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    13
    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
    13
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    else
    else
                                                                                          
    14
    IHeaderItem[] items = new IHeaderItem[1];
    14
    IBasicModelPartial[] items = new IBasicModelPartial[1];
                                                                                                                      
                                                                                              
    15
    items[0] = (IHeaderItem)getSelectedValue();
    15
    items[0] = (IBasicModelPartial)getSelectedValue();
                                                                                                            
    16
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    16
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    16
    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
    16
    HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    Precondition Violations (16)
    Row Violation
    1Type int of variable selection2.length does not match with type int of variable selection2.length
    2Unmatched statement IHeaderItem[] items=new IHeaderItem[selection2.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement IBasicModelPartial[] items=new IBasicModelPartial[selection2.length]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement items=selection2; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement items=selection2; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items
    7Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type 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()
    10Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager
    11Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items
    12Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type 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()
    15Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager
    16The 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