component.add(new MultiLineLabel(MailResourceLoader.getString("dialog", "mailboximport", "plugin_text")), BorderLayout.NORTH); JPanel middlePanel = new JPanel(); middlePanel.setAlignmentX(1); GridBagLayout layout = new GridBagLayout(); middlePanel.setLayout(layout); Method method = null; try { method = list.getClass().getMethod("getSelectedValue", null); } catch (NoSuchMethodException nsme) { } data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null)); list.addListSelectionListener(this); list.setSelectedIndex(0); JScrollPane scrollPane = new JScrollPane(list); scrollPane .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHWEST; c.gridx = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 0.4; // c.gridwidth = GridBagConstraints.RELATIVE; c.weighty = 1.0; layout.setConstraints(scrollPane, c); middlePanel.add(scrollPane); c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 0.6; c.gridx = 1; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new Insets(0, 10, 0, 0); JScrollPane scrollPane2 = new JScrollPane(descriptionLabel); scrollPane2 .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); layout.setConstraints(scrollPane2, c); middlePanel.add(scrollPane2); component.add(middlePanel); return component;
component.add(new MultiLineLabel(AddressbookResourceLoader.getString( "dialog", "addressbookimport", "plugin_text")), BorderLayout.NORTH); JPanel middlePanel = new JPanel(); middlePanel.setAlignmentX(1); GridBagLayout layout = new GridBagLayout(); middlePanel.setLayout(layout); Method method = null; try { method = list.getClass().getMethod("getSelectedValue", null); } catch (NoSuchMethodException nsme) { } data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null)); list.addListSelectionListener(this); list.setSelectedIndex(0); JScrollPane scrollPane = new JScrollPane(list); scrollPane .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); // scrollPane.setPreferredSize( new Dimension(200,200) ); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHWEST; c.gridx = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 0.4; // c.gridwidth = GridBagConstraints.RELATIVE; c.weighty = 1.0; layout.setConstraints(scrollPane, c); middlePanel.add(scrollPane); c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 0.6; c.gridx = 1; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new Insets(0, 10, 0, 0); JScrollPane scrollPane2 = new JScrollPane(descriptionLabel); scrollPane2 .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); layout.setConstraints(scrollPane2, c); middlePanel.add(scrollPane2); component.add(middlePanel); return component;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/mailboximport/PluginStep.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/importfilter/PluginStep.java
Method name: JComponent createComponent() Method name: JComponent createComponent()
Number of AST nodes: 32 Number of AST nodes: 32
1
component.add(new MultiLineLabel(MailResourceLoader.getString(
1
component.add(new MultiLineLabel(AddressbookResourceLoader.getString(
2
"dialog",
2
				"dialog",
3
				"mailboximport", "plugin_text")), 
3
 "addressbookimport", "plugin_text")),
4
BorderLayout.NORTH);
4
				BorderLayout.NORTH);
5
		JPanel middlePanel = new JPanel();
5
		JPanel middlePanel = new JPanel();
6
		middlePanel.setAlignmentX(1);
6
		middlePanel.setAlignmentX(1);
7
		GridBagLayout layout = new GridBagLayout();
7
		GridBagLayout layout = new GridBagLayout();
8
		middlePanel.setLayout(layout);
8
		middlePanel.setLayout(layout);
9
		Method method = null;
9
		Method method = null;
10
		try {
10
		try {
11
			method = list.getClass().getMethod("getSelectedValue", null);
11
			method = list.getClass().getMethod("getSelectedValue", null);
12
		} catch (NoSuchMethodException nsme) {
12
		} catch (NoSuchMethodException nsme) {
13
		}
13
		}
14
		data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list,
14
		data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list,
15
				method, null));
15
				method, null));
16
		list.addListSelectionListener(this);
16
		list.addListSelectionListener(this);
17
		list.setSelectedIndex(0);
17
		list.setSelectedIndex(0);
18
		JScrollPane scrollPane = new JScrollPane(list);
18
		JScrollPane scrollPane = new JScrollPane(list);
19
		scrollPane
19
		scrollPane
20
				.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
20
				.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
21
		// scrollPane.setPreferredSize( new Dimension(200,200) );
21
		GridBagConstraints c = new GridBagConstraints();
22
		GridBagConstraints c = new GridBagConstraints();
22
		c.anchor = GridBagConstraints.NORTHWEST;
23
		c.anchor = GridBagConstraints.NORTHWEST;
23
		c.gridx = 0;
24
		c.gridx = 0;
24
		c.fill = GridBagConstraints.BOTH;
25
		c.fill = GridBagConstraints.BOTH;
25
		c.weightx = 0.4;
26
		c.weightx = 0.4;
26
		// c.gridwidth = GridBagConstraints.RELATIVE;
27
		// c.gridwidth = GridBagConstraints.RELATIVE;
27
		c.weighty = 1.0;
28
		c.weighty = 1.0;
28
		layout.setConstraints(scrollPane, c);
29
		layout.setConstraints(scrollPane, c);
29
		middlePanel.add(scrollPane);
30
		middlePanel.add(scrollPane);
30
		c.gridwidth = GridBagConstraints.REMAINDER;
31
		c.gridwidth = GridBagConstraints.REMAINDER;
31
		c.weightx = 0.6;
32
		c.weightx = 0.6;
32
		c.gridx = 1;
33
		c.gridx = 1;
33
		c.anchor = GridBagConstraints.NORTHWEST;
34
		c.anchor = GridBagConstraints.NORTHWEST;
34
		c.insets = new Insets(0, 10, 0, 0);
35
		c.insets = new Insets(0, 10, 0, 0);
35
		JScrollPane scrollPane2 = new JScrollPane(descriptionLabel);
36
		JScrollPane scrollPane2 = new JScrollPane(descriptionLabel);
36
		scrollPane2
37
		scrollPane2
37
				.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
38
				.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
38
		layout.setConstraints(scrollPane2, c);
39
		layout.setConstraints(scrollPane2, c);
39
		middlePanel.add(scrollPane2);
40
		middlePanel.add(scrollPane2);
40
		component.add(middlePanel);
41
		component.add(middlePanel);
41
		return component;
42
		return component;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons399
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements32
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)17.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    component.add(new MultiLineLabel(MailResourceLoader.getString("dialog", "mailboximport", "plugin_text")), BorderLayout.NORTH);
    5
    component.add(new MultiLineLabel(MailResourceLoader.getString("dialog", "mailboximport", "plugin_text")), BorderLayout.NORTH);
    6
    component.add(new MultiLineLabel(AddressbookResourceLoader.getString("dialog", "addressbookimport", "plugin_text")), BorderLayout.NORTH);
    Differences
    Expression1Expression2Difference
    "mailboximport""addressbookimport"LITERAL_VALUE_MISMATCH
    org.columba.mail.util.MailResourceLoaderorg.columba.addressbook.util.AddressbookResourceLoaderSUBCLASS_TYPE_MISMATCH
    6
    component.add(new MultiLineLabel(AddressbookResourceLoader.getString("dialog", "addressbookimport", "plugin_text")), BorderLayout.NORTH);
    6
    JPanel middlePanel = new JPanel();
    7
    JPanel middlePanel = new JPanel();
    7
    middlePanel.setAlignmentX(1);
    8
    middlePanel.setAlignmentX(1);
    8
    GridBagLayout layout = new GridBagLayout();
    9
    GridBagLayout layout = new GridBagLayout();
    9
    middlePanel.setLayout(layout);
    10
    middlePanel.setLayout(layout);
    10
    Method method = null;
    11
    Method method = null;
    11
    try
    12
    try
    12
    method = list.getClass().getMethod("getSelectedValue", null);
    13
    method = list.getClass().getMethod("getSelectedValue", null);
    13
    data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null));
    14
    data.registerDataLookup("Plugin.ID", new DefaultDataLookup(list, method, null));
    14
    list.addListSelectionListener(this);
    15
    list.addListSelectionListener(this);
    15
    list.setSelectedIndex(0);
    16
    list.setSelectedIndex(0);
    16
    JScrollPane scrollPane = new JScrollPane(list);
    17
    JScrollPane scrollPane = new JScrollPane(list);
    17
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    18
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    18
    GridBagConstraints c = new GridBagConstraints();
    19
    GridBagConstraints c = new GridBagConstraints();
    19
    c.anchor = GridBagConstraints.NORTHWEST;
    20
    c.anchor = GridBagConstraints.NORTHWEST;
    20
    c.gridx = 0;
    21
    c.gridx = 0;
    21
    c.fill = GridBagConstraints.BOTH;
    22
    c.fill = GridBagConstraints.BOTH;
    22
    c.weightx = 0.4;
    23
    c.weightx = 0.4;
    23
    c.weighty = 1.0;
    24
    c.weighty = 1.0;
    24
    layout.setConstraints(scrollPane, c);
    25
    layout.setConstraints(scrollPane, c);
    25
    middlePanel.add(scrollPane);
    26
    middlePanel.add(scrollPane);
    26
    c.gridwidth = GridBagConstraints.REMAINDER;
    27
    c.gridwidth = GridBagConstraints.REMAINDER;
    27
    c.weightx = 0.6;
    28
    c.weightx = 0.6;
    28
    c.gridx = 1;
    29
    c.gridx = 1;
    29
    c.anchor = GridBagConstraints.NORTHWEST;
    30
    c.anchor = GridBagConstraints.NORTHWEST;
    30
    c.insets = new Insets(0, 10, 0, 0);
    31
    c.insets = new Insets(0, 10, 0, 0);
    31
    JScrollPane scrollPane2 = new JScrollPane(descriptionLabel);
    32
    JScrollPane scrollPane2 = new JScrollPane(descriptionLabel);
    32
    scrollPane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    33
    scrollPane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    33
    layout.setConstraints(scrollPane2, c);
    34
    layout.setConstraints(scrollPane2, c);
    34
    middlePanel.add(scrollPane2);
    35
    middlePanel.add(scrollPane2);
    35
    component.add(middlePanel);
    36
    component.add(middlePanel);
    36
    return component;
    37
    return component;
    Precondition Violations (0)
    Row Violation