File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManagerDialog.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileChooserDialog.java | |||
Method name: void initComponents()
|
Method name: void initComponents()
|
|||
Number of AST nodes: 16 | Number of AST nodes: 16 | |||
1 | checkBox.setActionCommand("CHECKBOX");↵ | 1 | okButton.setActionCommand("↵ | |
2 | checkBox↵ | 2 | OK");↵ | |
3 | .addActionListener(this);↵ | 3 | okButton.addActionListener(this);↵ | |
4 | ok↵ | 4 | ↵ | |
5 | Button = new ButtonWithMnemonic(GlobalResourceLoader.getString("",↵ | 5 | cancelButton = new ButtonWithMnemonic(GlobalResourceLoader.getString(↵ | |
6 | "", "close"));↵ | |||
7 | ok↵ | |||
6 | "", "", "cancel"));↵ | |||
8 | Button.setActionCommand("CLOSE");↵ | 7 | cancelButton.setActionCommand("C↵ | |
9 | ok↵ | 8 | ANCEL");↵ | |
10 | Button.addActionListener(this);↵ | 9 | cancelButton.addActionListener(this);↵ | |
11 | ↵ | 10 | ↵ | |
12 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("",↵ | 11 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("",↵ | |
13 | "", "help"));↵ | 12 | "", "help"));↵ | |
14 | ↵ | 13 | ↵ | |
15 | // associate with JavaHelp↵ | 14 | // associate with JavaHelp↵ | |
16 | HelpManager.getInstance().enableHelpOnButton(helpButton,↵ | 15 | HelpManager.getInstance().enableHelpOnButton(helpButton,↵ | |
17 | "extending_columba_2");↵ | 16 | "extending_columba_2");↵ | |
18 | HelpManager.getInstance().enableHelpKey(getRootPane(),↵ | 17 | HelpManager.getInstance().enableHelpKey(getRootPane(),↵ | |
19 | "extending_columba_2");↵ | 18 | "extending_columba_2");↵ | |
20 | ↵ | 19 | ↵ | |
21 | XmlElement profiles = ProfileManager.getInstance().getProfiles();↵ | 20 | XmlElement profiles = ProfileManager.getInstance().getProfiles();↵ | |
22 | model = new DefaultListModel();↵ | 21 | model = new DefaultListModel();↵ | |
23 | model.addElement("Default");↵ | 22 | model.addElement("Default");↵ | |
24 | ↵ | 23 | ↵ | |
25 | for (int i = 0; i < profiles.count(); i++) {↵ | 24 | for (int i = 0; i < profiles.count(); i++) {↵ | |
26 | XmlElement p = profiles.getElement(i);↵ | 25 | XmlElement p = profiles.getElement(i);↵ | |
27 | String name = p.getAttribute("name");↵ | 26 | String name = p.getAttribute("name");↵ | |
28 | model.addElement(name);↵ | 27 | model.addElement(name);↵ | |
29 | }↵ | |||
30 | ↵ | 28 | }↵ | |
29 | ↵ | |||
31 | list = new JList(model); | 30 | list = new JList(model); | |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 90 |
Number of mapped statements | 16 |
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) | 8.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23 | checkBox.setActionCommand("CHECKBOX"); |
| 15 | cancelButton.setActionCommand("CANCEL"); | |||||||||||||||||
24 | checkBox.addActionListener(this); |
| 16 | cancelButton.addActionListener(this); | |||||||||||||||||
25 | okButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "close")); |
| 17 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help")); | |||||||||||||||||
26 | okButton.setActionCommand("CLOSE"); |
| 12 | okButton.setActionCommand("OK"); | |||||||||||||||||
27 | okButton.addActionListener(this); | 13 | okButton.addActionListener(this); | ||||||||||||||||||
28 | helpButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "help")); |
| 14 | cancelButton = new ButtonWithMnemonic(GlobalResourceLoader.getString("", "", "cancel")); | |||||||||||||||||
29 | HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2"); | 18 | HelpManager.getInstance().enableHelpOnButton(helpButton, "extending_columba_2"); | ||||||||||||||||||
30 | HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2"); | 19 | HelpManager.getInstance().enableHelpKey(getRootPane(), "extending_columba_2"); | ||||||||||||||||||
31 | XmlElement profiles = ProfileManager.getInstance().getProfiles(); | 20 | XmlElement profiles = ProfileManager.getInstance().getProfiles(); | ||||||||||||||||||
32 | model = new DefaultListModel(); | 21 | model = new DefaultListModel(); | ||||||||||||||||||
33 | model.addElement("Default"); | 22 | model.addElement("Default"); | ||||||||||||||||||
34 | for (int i = 0; i < profiles.count(); i++) | 23 | for (int i = 0; i < profiles.count(); i++) | ||||||||||||||||||
35 | XmlElement p = profiles.getElement(i); | 24 | XmlElement p = profiles.getElement(i); | ||||||||||||||||||
36 | String name = p.getAttribute("name"); | 25 | String name = p.getAttribute("name"); | ||||||||||||||||||
37 | model.addElement(name); | 26 | model.addElement(name); | ||||||||||||||||||
38 | list = new JList(model); | 27 | list = new JList(model); |
Row | Violation |
---|---|
1 | Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression cancelButton cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression okButton is a field being modified, and thus it cannot be parameterized |
4 | Expression helpButton is a field being modified, and thus it cannot be parameterized |
5 | Expression helpButton is a field being modified, and thus it cannot be parameterized |
6 | Expression cancelButton is a field being modified, and thus it cannot be parameterized |