JComponent component = new JPanel(); component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS)); component.add(new MultiLineLabel(AddressbookResourceLoader.getString( "dialog", "addressbookimport", "location_text"))); component.add(Box.createVerticalStrut(40)); WizardTextField middlePanel = new WizardTextField(); LabelWithMnemonic sourceLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString( "dialog", "addressbookimport", "source")); middlePanel.addLabel(sourceLabel); sourceButton = new JButton("..."); sourceButton.addActionListener(this); sourceLabel.setLabelFor(sourceButton); middlePanel.addTextField(sourceButton); middlePanel.addExample(new JLabel()); LabelWithMnemonic destinationLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString( "dialog", "addressbookimport", "destination")); middlePanel.addLabel(destinationLabel); destinationButton = new JButton("..."); destinationButton.addActionListener(this); destinationLabel.setLabelFor(destinationButton); middlePanel.addTextField(destinationButton); middlePanel.addExample(new JLabel(AddressbookResourceLoader.getString( "dialog", "addressbookimport", "explanation"))); component.add(middlePanel); return component;
JComponent component = new JPanel(); component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS)); component.add(new MultiLineLabel(MailResourceLoader.getString( "dialog", "mailboximport", "location_text"))); component.add(Box.createVerticalStrut(40)); WizardTextField middlePanel = new WizardTextField(); LabelWithMnemonic sourceLabel = new LabelWithMnemonic(MailResourceLoader.getString( "dialog", "mailboximport", "source")); middlePanel.addLabel(sourceLabel); sourceButton = new JButton("..."); sourceLabel.setLabelFor(sourceButton); sourceButton.addActionListener(this); middlePanel.addTextField(sourceButton); middlePanel.addExample(new JLabel()); LabelWithMnemonic destinationLabel = new LabelWithMnemonic(MailResourceLoader.getString( "dialog", "mailboximport", "destination")); middlePanel.addLabel(destinationLabel); destinationButton = new JButton("..."); destinationLabel.setLabelFor(destinationButton); destinationButton.addActionListener(this); middlePanel.addTextField(destinationButton); middlePanel.addExample(new JLabel(MailResourceLoader.getString( "dialog", "mailboximport", "explanation"))); component.add(middlePanel); return component;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/importfilter/LocationStep.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/mailboximport/LocationStep.java
Method name: JComponent createComponent() Method name: JComponent createComponent()
Number of AST nodes: 21 Number of AST nodes: 21
1
JComponent component = new JPanel();
1
JComponent component = new JPanel();
2
        component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
2
        component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
3
        component.add(new MultiLineLabel(AddressbookResourceLoader.getString(
3
        component.add(new MultiLineLabel(MailResourceLoader.getString(
4
                    "dialog", "addressbookimport", "location_text")));
4
                    "dialog", "mailboximport", "location_text")));
5
        component.add(Box.createVerticalStrut(40));
5
        component.add(Box.createVerticalStrut(40));
6
        WizardTextField middlePanel = new WizardTextField();
6
        WizardTextField middlePanel = new WizardTextField();
7
        LabelWithMnemonic sourceLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString(
7
        LabelWithMnemonic sourceLabel = new LabelWithMnemonic(MailResourceLoader.getString(
8
                    "dialog", "addressbookimport", "source"));
8
                    "dialog", "mailboximport", "source"));
9
        middlePanel.addLabel(sourceLabel);
9
        middlePanel.addLabel(sourceLabel);
10
        sourceButton = new JButton("...");
10
        sourceButton = new JButton("...");
11
        sourceButton.addActionListener(this);
11
        source
12
        sourceLabel.setLabelFor(sourceButton
12
Label.setLabelFor(sourceButton);
13
);
13
        sourceButton.addActionListener(this);
14
        middlePanel.addTextField(sourceButton);
14
        middlePanel.addTextField(sourceButton);
15
        middlePanel.addExample(new JLabel());
15
        middlePanel.addExample(new JLabel());
16
        LabelWithMnemonic destinationLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString(
16
        LabelWithMnemonic destinationLabel = new LabelWithMnemonic(MailResourceLoader.getString(
17
                    "dialog", "addressbookimport", "destination"));
17
                    "dialog", "mailboximport", "destination"));
18
        middlePanel.addLabel(destinationLabel);
18
        middlePanel.addLabel(destinationLabel);
19
        destinationButton = new JButton("...");
19
        destinationButton = new JButton("...");
20
        destinationButton.addActionListener(this);
20
        destination
21
        destinationLabel.setLabelFor(destinationButton
21
Label.setLabelFor(destinationButton);
22
);
22
        destinationButton.addActionListener(this);
23
        middlePanel.addTextField(destinationButton);
23
        middlePanel.addTextField(destinationButton);
24
        middlePanel.addExample(new JLabel(AddressbookResourceLoader.getString(
24
        middlePanel.addExample(new JLabel(MailResourceLoader.getString(
25
                    "dialog", "addressbookimport", "explanation")));
25
                    "dialog", "mailboximport", "explanation")));
26
        component.add(middlePanel);
26
        component.add(middlePanel);
27
        return component;
27
        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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons132
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements21
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    JComponent component = new JPanel();
    1
    JComponent component = new JPanel();
    2
    component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
    2
    component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
    3
    component.add(new MultiLineLabel(AddressbookResourceLoader.getString("dialog", "addressbookimport", "location_text")));
    3
    component.add(new MultiLineLabel(AddressbookResourceLoader.getString("dialog", "addressbookimport", "location_text")));
    3
    component.add(new MultiLineLabel(MailResourceLoader.getString("dialog", "mailboximport", "location_text")));
    Differences
    Expression1Expression2Difference
    "addressbookimport""mailboximport"LITERAL_VALUE_MISMATCH
    org.columba.addressbook.util.AddressbookResourceLoaderorg.columba.mail.util.MailResourceLoaderSUBCLASS_TYPE_MISMATCH
    3
    component.add(new MultiLineLabel(MailResourceLoader.getString("dialog", "mailboximport", "location_text")));
    4
    component.add(Box.createVerticalStrut(40));
    4
    component.add(Box.createVerticalStrut(40));
    5
    WizardTextField middlePanel = new WizardTextField();
    5
    WizardTextField middlePanel = new WizardTextField();
    6
    LabelWithMnemonic sourceLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString("dialog", "addressbookimport", "source"));
    6
    LabelWithMnemonic sourceLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString("dialog", "addressbookimport", "source"));
    6
    LabelWithMnemonic sourceLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "mailboximport", "source"));
    Differences
    Expression1Expression2Difference
    "addressbookimport""mailboximport"LITERAL_VALUE_MISMATCH
    org.columba.addressbook.util.AddressbookResourceLoaderorg.columba.mail.util.MailResourceLoaderSUBCLASS_TYPE_MISMATCH
    6
    LabelWithMnemonic sourceLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "mailboximport", "source"));
    7
    middlePanel.addLabel(sourceLabel);
    7
    middlePanel.addLabel(sourceLabel);
    8
    sourceButton = new JButton("...");
    8
    sourceButton = new JButton("...");
    9
    sourceButton.addActionListener(this);
    10
    sourceButton.addActionListener(this);
    10
    sourceLabel.setLabelFor(sourceButton);
    9
    sourceLabel.setLabelFor(sourceButton);
    11
    middlePanel.addTextField(sourceButton);
    11
    middlePanel.addTextField(sourceButton);
    12
    middlePanel.addExample(new JLabel());
    12
    middlePanel.addExample(new JLabel());
    13
    LabelWithMnemonic destinationLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString("dialog", "addressbookimport", "destination"));
    13
    LabelWithMnemonic destinationLabel = new LabelWithMnemonic(AddressbookResourceLoader.getString("dialog", "addressbookimport", "destination"));
    13
    LabelWithMnemonic destinationLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "mailboximport", "destination"));
    Differences
    Expression1Expression2Difference
    "addressbookimport""mailboximport"LITERAL_VALUE_MISMATCH
    org.columba.addressbook.util.AddressbookResourceLoaderorg.columba.mail.util.MailResourceLoaderSUBCLASS_TYPE_MISMATCH
    13
    LabelWithMnemonic destinationLabel = new LabelWithMnemonic(MailResourceLoader.getString("dialog", "mailboximport", "destination"));
    14
    middlePanel.addLabel(destinationLabel);
    14
    middlePanel.addLabel(destinationLabel);
    15
    destinationButton = new JButton("...");
    15
    destinationButton = new JButton("...");
    16
    destinationButton.addActionListener(this);
    17
    destinationButton.addActionListener(this);
    17
    destinationLabel.setLabelFor(destinationButton);
    16
    destinationLabel.setLabelFor(destinationButton);
    18
    middlePanel.addTextField(destinationButton);
    18
    middlePanel.addTextField(destinationButton);
    19
    middlePanel.addExample(new JLabel(AddressbookResourceLoader.getString("dialog", "addressbookimport", "explanation")));
    19
    middlePanel.addExample(new JLabel(AddressbookResourceLoader.getString("dialog", "addressbookimport", "explanation")));
    19
    middlePanel.addExample(new JLabel(MailResourceLoader.getString("dialog", "mailboximport", "explanation")));
    Differences
    Expression1Expression2Difference
    "addressbookimport""mailboximport"LITERAL_VALUE_MISMATCH
    org.columba.addressbook.util.AddressbookResourceLoaderorg.columba.mail.util.MailResourceLoaderSUBCLASS_TYPE_MISMATCH
    19
    middlePanel.addExample(new JLabel(MailResourceLoader.getString("dialog", "mailboximport", "explanation")));
    20
    component.add(middlePanel);
    20
    component.add(middlePanel);
    21
    return component;
    21
    return component;
    Precondition Violations (0)
    Row Violation