File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/importfilter/PluginStep.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/mailboximport/PluginStep.java | |||
Method name: JComponent createComponent()
|
Method name: JComponent createComponent()
|
|||
Number of AST nodes: 31 | Number of AST nodes: 31 | |||
1 | JPanel middlePanel = new JPanel();↵ | 1 | JPanel middlePanel = new JPanel();↵ | |
2 | middlePanel.setAlignmentX(1);↵ | 2 | middlePanel.setAlignmentX(1);↵ | |
3 | GridBagLayout layout = new GridBagLayout();↵ | 3 | GridBagLayout layout = new GridBagLayout();↵ | |
4 | middlePanel.setLayout(layout);↵ | 4 | middlePanel.setLayout(layout);↵ | |
5 | Method method = null;↵ | 5 | Method method = null;↵ | |
6 | try {↵ | 6 | try {↵ | |
7 | method = list.getClass().getMethod("getSelectedValue", null);↵ | 7 | method = list.getClass().getMethod("getSelectedValue", null);↵ | |
8 | } catch (NoSuchMethodException nsme) {↵ | 8 | } catch (NoSuchMethodException nsme) {↵ | |
9 | }↵ | 9 | }↵ | |
10 | data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list,↵ | 10 | data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list,↵ | |
11 | method, null));↵ | 11 | method, null));↵ | |
12 | list.addListSelectionListener(this);↵ | 12 | list.addListSelectionListener(this);↵ | |
13 | list.setSelectedIndex(0);↵ | 13 | list.setSelectedIndex(0);↵ | |
14 | JScrollPane scrollPane = new JScrollPane(list);↵ | 14 | JScrollPane scrollPane = new JScrollPane(list);↵ | |
15 | scrollPane↵ | 15 | scrollPane↵ | |
16 | .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);↵ | 16 | .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);↵ | |
17 | // scrollPane.setPreferredSize( new Dimension(200,200) );↵ | |||
18 | GridBagConstraints c = new GridBagConstraints();↵ | 17 | GridBagConstraints c = new GridBagConstraints();↵ | |
19 | c.anchor = GridBagConstraints.NORTHWEST;↵ | 18 | c.anchor = GridBagConstraints.NORTHWEST;↵ | |
20 | c.gridx = 0;↵ | 19 | c.gridx = 0;↵ | |
21 | c.fill = GridBagConstraints.BOTH;↵ | 20 | c.fill = GridBagConstraints.BOTH;↵ | |
22 | c.weightx = 0.4;↵ | 21 | c.weightx = 0.4;↵ | |
23 | // c.gridwidth = GridBagConstraints.RELATIVE;↵ | 22 | // c.gridwidth = GridBagConstraints.RELATIVE;↵ | |
24 | c.weighty = 1.0;↵ | 23 | c.weighty = 1.0;↵ | |
25 | layout.setConstraints(scrollPane, c);↵ | 24 | layout.setConstraints(scrollPane, c);↵ | |
26 | middlePanel.add(scrollPane);↵ | 25 | middlePanel.add(scrollPane);↵ | |
27 | c.gridwidth = GridBagConstraints.REMAINDER;↵ | 26 | c.gridwidth = GridBagConstraints.REMAINDER;↵ | |
28 | c.weightx = 0.6;↵ | 27 | c.weightx = 0.6;↵ | |
29 | c.gridx = 1;↵ | 28 | c.gridx = 1;↵ | |
30 | c.anchor = GridBagConstraints.NORTHWEST;↵ | 29 | c.anchor = GridBagConstraints.NORTHWEST;↵ | |
31 | c.insets = new Insets(0, 10, 0, 0);↵ | 30 | c.insets = new Insets(0, 10, 0, 0);↵ | |
32 | JScrollPane scrollPane2 = new JScrollPane(descriptionLabel);↵ | 31 | JScrollPane scrollPane2 = new JScrollPane(descriptionLabel);↵ | |
33 | scrollPane2↵ | 32 | scrollPane2↵ | |
34 | .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);↵ | 33 | .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);↵ | |
35 | layout.setConstraints(scrollPane2, c);↵ | 34 | layout.setConstraints(scrollPane2, c);↵ | |
36 | middlePanel.add(scrollPane2);↵ | 35 | middlePanel.add(scrollPane2);↵ | |
37 | component.add(middlePanel);↵ | 36 | component.add(middlePanel);↵ | |
38 | return component; | 37 |
| |
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 having the same super class |
Number of node comparisons | 306 |
Number of mapped statements | 31 |
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) | 26.4 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
7 | JPanel middlePanel = new JPanel(); | 6 | JPanel middlePanel = new JPanel(); | |
8 | middlePanel.setAlignmentX(1); | 7 | middlePanel.setAlignmentX(1); | |
9 | GridBagLayout layout = new GridBagLayout(); | 8 | GridBagLayout layout = new GridBagLayout(); | |
10 | middlePanel.setLayout(layout); | 9 | middlePanel.setLayout(layout); | |
11 | Method method = null; | 10 | Method method = null; | |
12 | try | 11 | try | |
13 | method = list.getClass().getMethod("getSelectedValue", null); | 12 | method = list.getClass().getMethod("getSelectedValue", null); | |
14 | data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null)); | 13 | data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null)); | |
15 | list.addListSelectionListener(this); | 14 | list.addListSelectionListener(this); | |
16 | list.setSelectedIndex(0); | 15 | list.setSelectedIndex(0); | |
17 | JScrollPane scrollPane = new JScrollPane(list); | 16 | JScrollPane scrollPane = new JScrollPane(list); | |
18 | scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); | 17 | scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); | |
19 | GridBagConstraints c = new GridBagConstraints(); | 18 | GridBagConstraints c = new GridBagConstraints(); | |
20 | c.anchor = GridBagConstraints.NORTHWEST; | 19 | c.anchor = GridBagConstraints.NORTHWEST; | |
21 | c.gridx = 0; | 20 | c.gridx = 0; | |
22 | c.fill = GridBagConstraints.BOTH; | 21 | c.fill = GridBagConstraints.BOTH; | |
23 | c.weightx = 0.4; | 22 | c.weightx = 0.4; | |
24 | c.weighty = 1.0; | 23 | c.weighty = 1.0; | |
25 | layout.setConstraints(scrollPane, c); | 24 | layout.setConstraints(scrollPane, c); | |
26 | middlePanel.add(scrollPane); | 25 | middlePanel.add(scrollPane); | |
27 | c.gridwidth = GridBagConstraints.REMAINDER; | 26 | c.gridwidth = GridBagConstraints.REMAINDER; | |
28 | c.weightx = 0.6; | 27 | c.weightx = 0.6; | |
29 | c.gridx = 1; | 28 | c.gridx = 1; | |
30 | c.anchor = GridBagConstraints.NORTHWEST; | 29 | c.anchor = GridBagConstraints.NORTHWEST; | |
31 | c.insets = new Insets(0, 10, 0, 0); | 30 | c.insets = new Insets(0, 10, 0, 0); | |
32 | JScrollPane scrollPane2 = new JScrollPane(descriptionLabel); | 31 | JScrollPane scrollPane2 = new JScrollPane(descriptionLabel); | |
33 | scrollPane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); | 32 | scrollPane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); | |
34 | layout.setConstraints(scrollPane2, c); | 33 | layout.setConstraints(scrollPane2, c); | |
35 | middlePanel.add(scrollPane2); | 34 | middlePanel.add(scrollPane2); | |
36 | component.add(middlePanel); | 35 | component.add(middlePanel); | |
37 | return component; | 36 | return component; |
Row | Violation |
---|