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 initComponents()
|
Method name: void initComponents()
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("",↵ | 1 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("",↵ | |
2 | "", "help"));↵ | 2 | "", "help"));↵ | |
3 | ↵ | |||
4 | ↵ | |||
5 | // associate with JavaHelp↵ | 3 | // associate with JavaHelp↵ | |
6 | HelpManager.getInstance().enableHelpOnButton(helpButton,↵ | 4 | HelpManager.getInstance().enableHelpOnButton(helpButton,↵ | |
7 | "extending_columba_2");↵ | 5 | "extending_columba_2");↵ | |
8 | HelpManager.getInstance().enableHelpKey(getRootPane(),↵ | 6 | HelpManager.getInstance().enableHelpKey(getRootPane(),↵ | |
9 | "extending_columba_2");↵ | 7 | "extending_columba_2");↵ | |
10 | ↵ | |||
11 | ↵ | |||
12 | XmlElement profiles = ProfileManager.getInstance().getProfiles();↵ | 8 | XmlElement profiles = ProfileManager.getInstance().getProfiles();↵ | |
13 | model = new DefaultListModel();↵ | 9 | model = new DefaultListModel();↵ | |
14 | model.addElement("Default");↵ | 10 | model.addElement("Default");↵ | |
15 | ↵ | |||
16 | ↵ | |||
17 | for (int i = 0; i < profiles.count(); i++) {↵ | 11 | for (int i = 0; i < profiles.count(); i++) {↵ | |
18 | XmlElement p = profiles.getElement(i);↵ | 12 | XmlElement p = profiles.getElement(i);↵ | |
19 | String name = p.getAttribute("name");↵ | 13 | String name = p.getAttribute("name");↵ | |
20 | model.addElement(name);↵ | 14 | model.addElement(name);↵ | |
21 | }↵ | |||
22 | ↵ | |||
23 | ↵ | 15 | }↵ | |
24 | list = new JList(model);↵ | 16 | list = new JList(model);↵ | |
25 | list.addListSelectionListener(this);↵ | 17 | list.setSelection↵ | |
26 | list.addMouse↵ | 18 | Mode(ListSelectionModel.SINGLE_SELECTION);↵ | |
27 | Listener(this); | 19 | list.addListSelectionListener(this); | |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 57 |
Number of mapped statements | 12 |
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) | 22.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
17 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help")); | 28 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help")); | ||||
18 | HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2"); | 29 | HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2"); | ||||
19 | HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2"); | 30 | HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2"); | ||||
20 | XmlElement profiles = ProfileManager.getInstance().getProfiles(); | 31 | XmlElement profiles = ProfileManager.getInstance().getProfiles(); | ||||
21 | model = new DefaultListModel(); | 32 | model = new DefaultListModel(); | ||||
22 | model.addElement("Default"); | 33 | model.addElement("Default"); | ||||
23 | for (int i = 0; i < profiles.count(); i++) | 34 | for (int i = 0; i < profiles.count(); i++) | ||||
24 | XmlElement p = profiles.getElement(i); | 35 | XmlElement p = profiles.getElement(i); | ||||
25 | String name = p.getAttribute("name"); | 36 | String name = p.getAttribute("name"); | ||||
26 | model.addElement(name); | 37 | model.addElement(name); | ||||
27 | list = new JList(model); | 38 | list = new JList(model); | ||||
| 39 | list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | |||||
28 | list.addListSelectionListener(this); | 40 | list.addListSelectionListener(this); | ||||
29 | list.addMouseListener(this); |
| |
Row | Violation |
---|---|
1 | Unmatched statement list.addMouseListener(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |