File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/action/CopyActivityMenu.java | File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/action/MoveActivityMenu.java | |||
Method name: void CopyActivityMenu(IFrameMediator)
|
Method name: void MoveActivityMenu(IFrameMediator)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | super(controller, "Copy", "CopyActivity");↵ | 1 | super(controller, "Move", "MoveActivity");↵ | |
2 | ICalendarList list = Config.getInstance().getCalendarList();↵ | 2 | ICalendarList list = Config.getInstance().getCalendarList();↵ | |
3 | Enumeration<ICalendarItem> e = list.getElements();↵ | 3 | Enumeration<ICalendarItem> e = list.getElements();↵ | |
4 | while (e.hasMoreElements()) {↵ | 4 | while (e.hasMoreElements()) {↵ | |
5 | final ICalendarItem calendarItem = e.nextElement();↵ | 5 | final ICalendarItem calendarItem = e.nextElement();↵ | |
6 | JMenuItem item = new JMenuItem(calendarItem.getId());↵ | 6 | JMenuItem item = new JMenuItem(calendarItem.getId());↵ | |
7 | table.put(calendarItem.getId(), item);↵ | 7 | table.put(calendarItem.getId(), item);↵ | |
8 | item.addActionListener(new ActionListener() {↵ | 8 | item.addActionListener(new ActionListener() {↵ | |
9 | public void actionPerformed(ActionEvent e) {↵ | 9 | public void actionPerformed(ActionEvent e) {↵ | |
10 | /**↵ | |||
11 | * move activity↵ | |||
12 | */↵ | |||
10 | ICalendarMediator m = (ICalendarMediator) getFrameMediator();↵ | 13 | ICalendarMediator m = (ICalendarMediator) getFrameMediator();↵ | |
11 | IActivity activity = m.getCalendarView()↵ | 14 | IActivity activity = m.getCalendarView()↵ | |
12 | .getSelectedActivity();↵ | 15 | .getSelectedActivity();↵ | |
13 | // copy activity↵ | |||
14 | ICalendarStore store = CalendarStoreFactory.getInstance()↵ | 16 | ICalendarStore store = CalendarStoreFactory.getInstance()↵ | |
15 | .getLocaleStore();↵ | 17 | .getLocaleStore();↵ | |
16 | Command command = new CopyEventCommand(↵ | 18 | Command command = new MoveEventCommand(↵ | |
17 | new CalendarCommandReference(store, calendarItem,↵ | 19 | new CalendarCommandReference(store, calendarItem,↵ | |
18 | activity));↵ | 20 | activity));↵ | |
19 | CommandProcessor.getInstance().addOp(command);↵ | 21 | CommandProcessor.getInstance().addOp(command);↵ | |
20 | }↵ | 22 | }↵ | |
21 | });↵ | 23 | });↵ | |
22 | add(item);↵ | 24 | add(item);↵ | |
23 | }↵ | 25 | }↵ | |
24 | ICalendarMediator m = (ICalendarMediator) getFrameMediator();↵ | 26 | ICalendarMediator m = (ICalendarMediator) getFrameMediator();↵ | |
25 | m.getCalendarView().addSelectionChangedListener(this); | 27 |
| |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 61 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 4.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | super(controller, "Copy", "CopyActivity"); |
| 1 | super(controller, "Move", "MoveActivity"); | |||||||||||||
2 | ICalendarList list = Config.getInstance().getCalendarList(); | 2 | ICalendarList list = Config.getInstance().getCalendarList(); | ||||||||||||||
3 | Enumeration<ICalendarItem> e = list.getElements(); | 3 | Enumeration<ICalendarItem> e = list.getElements(); | ||||||||||||||
4 | while (e.hasMoreElements()) | 4 | while (e.hasMoreElements()) | ||||||||||||||
5 | final ICalendarItem calendarItem = e.nextElement(); | 5 | final ICalendarItem calendarItem = e.nextElement(); | ||||||||||||||
6 | JMenuItem item = new JMenuItem(calendarItem.getId()); | 6 | JMenuItem item = new JMenuItem(calendarItem.getId()); | ||||||||||||||
7 | table.put(calendarItem.getId(), item); | 7 | table.put(calendarItem.getId(), item); | ||||||||||||||
8 | item.addActionListener(new ActionListener() {...}); |
| 8 | item.addActionListener(new ActionListener() {...}); | |||||||||||||
9 | add(item); | 9 | add(item); | ||||||||||||||
10 | ICalendarMediator m = (ICalendarMediator)getFrameMediator(); | 10 | ICalendarMediator m = (ICalendarMediator)getFrameMediator(); | ||||||||||||||
11 | m.getCalendarView().addSelectionChangedListener(this); | 11 | m.getCalendarView().addSelectionChangedListener(this); |
Row | Violation |
---|---|
1 | Expression new CopyEventCommand(new CalendarCommandReference(store,calendarItem,activity)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new MoveEventCommand(new CalendarCommandReference(store,calendarItem,activity)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |