File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileChooserDialog.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: 10 | Number of AST nodes: 10 | |||
1 | JFileChooser fc = new JFileChooser();↵ | 1 | JFileChooser fc = new JFileChooser();↵ | |
2 | fc.setMultiSelectionEnabled(true);↵ | 2 | fc.setMultiSelectionEnabled(true);↵ | |
3 | // bug #996381 (fdietz), directories only!!↵ | 3 | // bug #996381 (fdietz), directories only!!↵ | |
4 | fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);↵ | 4 | fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);↵ | |
5 | fc.setFileHidingEnabled(false);↵ | 5 | fc.setFileHidingEnabled(false);↵ | |
6 | ↵ | |||
7 | if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {↵ | 6 | if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {↵ | |
8 | File location = fc.getSelectedFile();↵ | 7 | File location = fc.getSelectedFile();↵ | |
9 | Profile p = new Profile(location.getName(), location);↵ | 8 | Profile p = new Profile(location.getName(), location);↵ | |
10 | // add profile to profiles.xml↵ | 9 | // add profile to profiles.xml↵ | |
11 | ProfileManager.getInstance().addProfile(p);↵ | 10 | ProfileManager.getInstance().addProfile(p);↵ | |
12 | ↵ | |||
13 | ↵ | |||
14 | // add to listmodel↵ | 11 | // add to listmodel↵ | |
15 | model.addElement(p.getName());↵ | 12 | model.addElement(p.getName());↵ | |
16 | // select new item↵ | 13 | // select new item↵ | |
17 | list.setSelectedValue(p.getName(), true);↵ | 14 | list.setSelectedValue(p.getName(), true);↵ | |
18 | } | 15 | } | |
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 53 |
Number of mapped statements | 10 |
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) | 12.6 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
7 | JFileChooser fc = new JFileChooser(); | 7 | JFileChooser fc = new JFileChooser(); | |
8 | fc.setMultiSelectionEnabled(true); | 8 | fc.setMultiSelectionEnabled(true); | |
9 | fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); | 9 | fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); | |
10 | fc.setFileHidingEnabled(false); | 10 | fc.setFileHidingEnabled(false); | |
11 | if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) | 11 | if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) | |
12 | File location = fc.getSelectedFile(); | 12 | File location = fc.getSelectedFile(); | |
13 | Profile p = new Profile(location.getName(), location); | 13 | Profile p = new Profile(location.getName(), location); | |
14 | ProfileManager.getInstance().addProfile(p); | 14 | ProfileManager.getInstance().addProfile(p); | |
15 | model.addElement(p.getName()); | 15 | model.addElement(p.getName()); | |
16 | list.setSelectedValue(p.getName(), true); | 16 | list.setSelectedValue(p.getName(), true); |
Row | Violation |
---|