File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/store/AbstractCalendarStore.java | File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/folder/AbstractFolder.java | |||
Method name: void fireItemChanged(Object)
|
Method name: void fireItemAdded(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | StoreEvent e = new StoreEvent(this, uid);↵ | 1 | IFolderEvent e = new FolderEvent(this, null);↵ | |
2 | // Guaranteed to return a non-null array↵ | 2 | // Guaranteed to return a non-null array↵ | |
3 | Object[] listeners = listenerList.getListenerList();↵ | 3 | Object[] listeners = listenerList.getListenerList();↵ | |
4 | // Process the listeners last to first, notifying↵ | 4 | // Process the listeners last to first, notifying↵ | |
5 | // those that are interested in this event↵ | 5 | // those that are interested in this event↵ | |
6 | for (int i = listeners.length - 2; i >= 0; i -= 2) {↵ | 6 | for (int i = listeners.length - 2; i >= 0; i -= 2) {↵ | |
7 | if (listeners[i] == IStoreListener.class) {↵ | 7 | if (listeners[i] == FolderListener.class) {↵ | |
8 | ((IStoreListener) listeners[i + 1]).itemChanged(e);↵ | 8 | ((FolderListener) listeners[i + 1]).itemAdded(e);↵ | |
9 | }↵ | 9 | }↵ | |
10 | } | 10 |
| |
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) | 0.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 1 | IFolderEvent e = new FolderEvent(this, null); | |||||||||||||||||||||||||
1 | StoreEvent e = new StoreEvent(this, uid); |
| | |||||||||||||||||||||||||
2 | Object[] listeners = listenerList.getListenerList(); | 2 | Object[] listeners = listenerList.getListenerList(); | |||||||||||||||||||||||||
3 | for (int i = listeners.length - 2; i >= 0; i -= 2) | 3 | for (int i = listeners.length - 2; i >= 0; i -= 2) | |||||||||||||||||||||||||
4 | if (listeners[i] == IStoreListener.class) |
| 4 | if (listeners[i] == FolderListener.class) | ||||||||||||||||||||||||
5 | ((IStoreListener)listeners[i + 1]).itemChanged(e); |
| 5 | ((FolderListener)listeners[i + 1]).itemAdded(e); |
Row | Violation |
---|---|
1 | Unmatched statement IFolderEvent e=new FolderEvent(this,null); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement StoreEvent e=new StoreEvent(this,uid); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Type org.columba.calendar.store.api.StoreEvent of variable e does not match with type org.columba.addressbook.folder.IFolderEvent of variable e |
4 | Expression ((IStoreListener)listeners[i + 1]).itemChanged(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression ((FolderListener)listeners[i + 1]).itemAdded(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression ((IStoreListener)listeners[i + 1]).itemChanged(e) is a void method call, and thus it cannot be parameterized |
7 | Expression ((FolderListener)listeners[i + 1]).itemAdded(e) is a void method call, and thus it cannot be parameterized |
8 | Expression (IStoreListener)listeners[i + 1] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression (FolderListener)listeners[i + 1] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Type org.columba.calendar.store.api.IStoreListener does not match with type org.columba.addressbook.folder.FolderListener |
11 | The refactoring of the clones is infeasible, because classes org.columba.calendar.store.AbstractCalendarStore and org.columba.addressbook.folder.AbstractFolder do not have a common superclass |