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: 19 | Number of AST nodes: 19 | |||
1 | if (dndAction == false) {↵ | 1 | if (dndAction == false) {↵ | |
2 | /*↵ | 2 | /*↵ | |
3 | * HeaderItem[] items = new HeaderItem[selection1.length]; items =↵ | 3 | * HeaderItem[] items = new HeaderItem[selection1.length]; items =↵ | |
4 | * selection1;↵ | 4 | * selection1;↵ | |
5 | * HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | 5 | * HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | |
6 | */↵ | 6 | */↵ | |
7 | if (selection1 == null) {↵ | 7 | if (selection1 == null) {↵ | |
8 | IBasicModelPartial[] items = new IBasicModelPartial[1];↵ | 8 | IHeaderItem[] items = new IHeaderItem[1];↵ | |
9 | items[0] = (IBasicModelPartial) getSelectedValue();↵ | 9 | items[0] = (IHeaderItem) getSelectedValue();↵ | |
10 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | 10 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | |
11 | } else if (selection1.length != 0) {↵ | 11 | } else if (selection1.length != 0) {↵ | |
12 | IBasicModelPartial[] items = new IBasicModelPartial[selection1.length];↵ | 12 | IHeaderItem[] items = new IHeaderItem[selection1.length];↵ | |
13 | items = selection1;↵ | 13 | items = selection1;↵ | |
14 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | 14 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | |
15 | }↵ | 15 | }↵ | |
16 | /*↵ | 16 | /*↵ | |
17 | * else {↵ | 17 | * else {↵ | |
18 | * ↵ | 18 | * ↵ | |
19 | * HeaderItem[] items = new HeaderItem[1]; items[0] = (HeaderItem)↵ | 19 | * HeaderItem[] items = new HeaderItem[1]; items[0] = (HeaderItem)↵ | |
20 | * getSelectedValue();↵ | 20 | * getSelectedValue();↵ | |
21 | * HeaderItemDNDManager.getInstance().setHeaderItemList(items); }↵ | 21 | * HeaderItemDNDManager.getInstance().setHeaderItemList(items); }↵ | |
22 | */↵ | 22 | */↵ | |
23 | } else {↵ | 23 | } else {↵ | |
24 | /*↵ | 24 | /*↵ | |
25 | * HeaderItem[] items = new HeaderItem[selection2.length]; items =↵ | 25 | * HeaderItem[] items = new HeaderItem[selection2.length]; items =↵ | |
26 | * selection2;↵ | 26 | * selection2;↵ | |
27 | * HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | 27 | * HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | |
28 | */↵ | 28 | */↵ | |
29 | if (selection2.length != 0) {↵ | 29 | if (selection2.length != 0) {↵ | |
30 | IBasicModelPartial[] items = new IBasicModelPartial[selection2.length];↵ | 30 | IHeaderItem[] items = new IHeaderItem[selection2.length];↵ | |
31 | items = selection2;↵ | 31 | items = selection2;↵ | |
32 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | 32 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | |
33 | } else {↵ | 33 | } else {↵ | |
34 | IBasicModelPartial[] items = new IBasicModelPartial[1];↵ | 34 | IHeaderItem[] items = new IHeaderItem[1];↵ | |
35 | items[0] = (IBasicModelPartial) getSelectedValue();↵ | 35 | items[0] = (IHeaderItem) getSelectedValue();↵ | |
36 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | 36 | HeaderItemDNDManager.getInstance().setHeaderItemList(items);↵ | |
37 | }↵ | 37 | }↵ | |
38 | }↵ | 38 | }↵ | |
39 | /*↵ | 39 | /*↵ | |
40 | * dragSource.startDrag( event, new Cursor(Cursor.DEFAULT_CURSOR),↵ | 40 | * dragSource.startDrag( event, new Cursor(Cursor.DEFAULT_CURSOR),↵ | |
41 | * ImageLoader.getImageIcon("contact_small","Add16").getImage(), new↵ | 41 | * ImageLoader.getImageIcon("contact_small","Add16").getImage(), new↵ | |
42 | * Point(5, 5), new StringSelection("contact"), this);↵ | 42 | * Point(5, 5), new StringSelection("contact"), this);↵ | |
43 | */↵ | 43 | */↵ | |
44 | StringSelection text = new StringSelection("contact");↵ | 44 | StringSelection text = new StringSelection("contact");↵ | |
45 | dragSource.startDrag(event, DragSource.DefaultMoveDrop, text, this);↵ | 45 | dragSource.startDrag(event, DragSource.DefaultMoveDrop, text, this);↵ | |
46 | clearSelection(); | 46 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 2.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 135 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 8 |
Number of unmapped statements in the second code fragment | 8 |
Time elapsed for statement mapping (ms) | 21.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (dndAction == false) | 1 | if (dndAction == false) | ||||||||||||||||||||||
2 | if (selection1 == null) |
| 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); | |||||||||||||||||||||
6 | else if (selection1.length != 0) |
| 6 | else if (selection1.length != 0) | |||||||||||||||||||||
|
| 7 | IHeaderItem[] items = new IHeaderItem[selection1.length]; | ||||||||||||||||||||||
7 | IBasicModelPartial[] items = new IBasicModelPartial[selection1.length]; |
| | ||||||||||||||||||||||
|
| 8 | items = selection1; | ||||||||||||||||||||||
8 | items = selection1; |
| | ||||||||||||||||||||||
9 | HeaderItemDNDManager.getInstance().setHeaderItemList(items); |
| 9 | HeaderItemDNDManager.getInstance().setHeaderItemList(items); | |||||||||||||||||||||
else | else | ||||||||||||||||||||||||
10 | if (selection2.length != 0) |
| 10 | if (selection2.length != 0) | |||||||||||||||||||||
|
| 11 | IHeaderItem[] items = new IHeaderItem[selection2.length]; | ||||||||||||||||||||||
11 | IBasicModelPartial[] items = new IBasicModelPartial[selection2.length]; |
| | ||||||||||||||||||||||
|
| 12 | items = selection2; | ||||||||||||||||||||||
12 | items = selection2; |
| | ||||||||||||||||||||||
13 | HeaderItemDNDManager.getInstance().setHeaderItemList(items); |
| 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); | |||||||||||||||||||||
17 | StringSelection text = new StringSelection("contact"); | 17 | StringSelection text = new StringSelection("contact"); | ||||||||||||||||||||||
18 | dragSource.startDrag(event, DragSource.DefaultMoveDrop, text, this); | 18 | dragSource.startDrag(event, DragSource.DefaultMoveDrop, text, this); | ||||||||||||||||||||||
19 | clearSelection(); | 19 | clearSelection(); |
Row | Violation |
---|---|
1 | Type org.columba.addressbook.model.IBasicModelPartial[] of variable selection1 does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable selection1 |
2 | Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items |
3 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | 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() |
6 | Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager |
7 | Type int of variable selection1.length does not match with type int of variable selection1.length |
8 | 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 |
9 | 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 |
10 | Unmatched statement items=selection1; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
11 | Unmatched statement items=selection1; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
12 | Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items |
13 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | 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() |
16 | Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager |
17 | Type int of variable selection2.length does not match with type int of variable selection2.length |
18 | 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 |
19 | 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 |
20 | Unmatched statement items=selection2; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
21 | Unmatched statement items=selection2; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
22 | Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items |
23 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
25 | 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() |
26 | Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager |
27 | Type org.columba.addressbook.model.IBasicModelPartial[] of variable items does not match with type org.columba.addressbook.facade.IHeaderItem[] of variable items |
28 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
29 | Expression HeaderItemDNDManager.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
30 | 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() |
31 | Type org.columba.addressbook.gui.list.HeaderItemDNDManager does not match with type org.columba.mail.gui.contact.list.HeaderItemDNDManager |
32 | The 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 |