File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/action/SaveAsAction.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManagerDialog.java | |||
Method name: void actionPerformed(ActionEvent)
|
Method name: void actionPerformed(ActionEvent)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 6 | |||
1 | if (fc.showSaveDialog(frameMediator.getContainer().getFrame()) == JFileChooser.APPROVE_OPTION) {↵ | 1 | if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {↵ | |
2 | File destFile = fc.getSelectedFile();↵ | 2 | File location = fc.getSelectedFile();↵ | |
3 | ICalendarStore store = CalendarStoreFactory.getInstance()↵ | 3 | ↵ | |
4 | .getLocaleStore(↵ | 4 | Profile p = new Profile(location.getName(), location);↵ | |
5 | // add profile to profiles.xml↵ | |||
5 | );↵ | 6 | ProfileManager.getInstance().addProfile(p);↵ | |
6 | Command command = new SaveEventToFileCommand(↵ | 7 | ↵ | |
7 | new CalendarCommandReference(store, activity), destFile);↵ | |||
8 | CommandProcessor.getInstance().addOp(command↵ | 8 | // add to listmodel↵ | |
9 | model.addElement(p.getName());↵ | |||
10 | // select new item↵ | |||
9 | );↵ | 11 | list.setSelectedValue(p.getName(), true);↵ | |
10 | } | 12 | } | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 30 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12 | if (fc.showSaveDialog(frameMediator.getContainer().getFrame()) == JFileChooser.APPROVE_OPTION) |
| 11 | if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) | |||||||||||||
13 | File destFile = fc.getSelectedFile(); |
| 12 | File location = fc.getSelectedFile(); | |||||||||||||
| 13 | Profile p = new Profile(location.getName(), location); | |||||||||||||||
| 14 | ProfileManager.getInstance().addProfile(p); | |||||||||||||||
14 | ICalendarStore store = CalendarStoreFactory.getInstance().getLocaleStore(); | | |||||||||||||||
| 15 | model.addElement(p.getName()); | |||||||||||||||
15 | Command command = new SaveEventToFileCommand(new CalendarCommandReference(store, activity), destFile); | | |||||||||||||||
| 16 | list.setSelectedValue(p.getName(), true); | |||||||||||||||
16 | CommandProcessor.getInstance().addOp(command); | |
Row | Violation |
---|