list = new JList(computeThemes()); list.setCellRenderer(createThemeRenderer()); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); JScrollPane pane = new JScrollPane(list); panel.add(pane, BorderLayout.NORTH); return panel;
JComponent component = new JPanel(); component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS)); MultiLineLabel label = new MultiLineLabel(MailResourceLoader.getString( "dialog", "accountwizard", "finish_text")); component.add(label); component.add(Box.createVerticalGlue()); return component;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/themes/plugin/PlasticLookAndFeelConfigPlugin.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/accountwizard/FinishStep.java
Method name: JPanel createPanel() Method name: JComponent createComponent()
Number of AST nodes: 7 Number of AST nodes: 6
1
list = new JList(computeThemes());
1
JComponent component = new JPanel();
2
        list.setCellRenderer(createThemeRenderer());
2
        
3
        JPanel panel = new JPanel();
4
        panel.setLayout(new BorderLayout(
3
component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
4
        MultiLineLabel label = new MultiLineLabel(MailResourceLoader.getString(
5
));
5
                    "dialog", "accountwizard", "finish_text"));
6
        JScrollPane pane = new JScrollPane(list);
6
        
7
        panel.add(pane, BorderLayout.NORTH
7
component.add(label);
8
);
8
        component.add(Box.createVerticalGlue());
9
        return panel;
9
        return component;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    list = new JList(computeThemes());
    1
    list = new JList(computeThemes());
    Preondition Violations
    Unmatched statement list=new JList(computeThemes()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                          
    2
    list.setCellRenderer(createThemeRenderer());
    2
    list.setCellRenderer(createThemeRenderer());
    Preondition Violations
    Unmatched statement list.setCellRenderer(createThemeRenderer()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                  
    3
    JPanel panel = new JPanel();
    3
    JPanel panel = new JPanel();
    1
    JComponent component = new JPanel();
    Differences
    Expression1Expression2Difference
    javax.swing.JPaneljavax.swing.JComponentSUBCLASS_TYPE_MISMATCH
    panelcomponentVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JComponentSUBCLASS_TYPE_MISMATCH
    1
    JComponent component = new JPanel();
    4
    panel.setLayout(new BorderLayout());
    4
    panel.setLayout(new BorderLayout());
    2
    component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
    Differences
    Expression1Expression2Difference
    java.awt.BorderLayoutjavax.swing.BoxLayoutSUBCLASS_TYPE_MISMATCH
    new BorderLayout()new BoxLayout(component,BoxLayout.Y_AXIS)ARGUMENT_NUMBER_MISMATCH
    panelcomponentVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JComponentSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new BoxLayout(component,BoxLayout.Y_AXIS) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new BoxLayout(component,BoxLayout.Y_AXIS) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression component cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
                                                                                                                                                                                                                                      
    3
    MultiLineLabel label = new MultiLineLabel(MailResourceLoader.getString("dialog", "accountwizard", "finish_text"));
    Preondition Violations
    Unmatched statement MultiLineLabel label=new MultiLineLabel(MailResourceLoader.getString("dialog","accountwizard","finish_text")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    MultiLineLabel label = new MultiLineLabel(MailResourceLoader.getString("dialog", "accountwizard", "finish_text"));
                                                    
    4
    component.add(label);
    Preondition Violations
    Unmatched statement component.add(label); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    component.add(label);
                                                                                          
    5
    component.add(Box.createVerticalGlue());
    Preondition Violations
    Unmatched statement component.add(Box.createVerticalGlue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    component.add(Box.createVerticalGlue());
    5
    JScrollPane pane = new JScrollPane(list);
                                                                                        
    6
    panel.add(pane, BorderLayout.NORTH);
    6
    panel.add(pane, BorderLayout.NORTH);
    Preondition Violations
    Unmatched statement panel.add(pane,BorderLayout.NORTH); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    7
    return panel;
    7
    return panel;
    6
    return component;
    Differences
    Expression1Expression2Difference
    panelcomponentVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JComponentSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression panel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression component cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    return component;
    Precondition Violations (13)
    Row Violation
    1Unmatched statement list=new JList(computeThemes()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement list.setCellRenderer(createThemeRenderer()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Expression new BoxLayout(component,BoxLayout.Y_AXIS) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new BoxLayout(component,BoxLayout.Y_AXIS) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression panel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression component cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Unmatched statement MultiLineLabel label=new MultiLineLabel(MailResourceLoader.getString("dialog","accountwizard","finish_text")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched statement component.add(label); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched statement component.add(Box.createVerticalGlue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched statement panel.add(pane,BorderLayout.NORTH); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Expression panel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression component cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13The refactoring of the clones is infeasible, because classes org.columba.core.gui.themes.plugin.PlasticLookAndFeelConfigPlugin and org.columba.mail.gui.config.accountwizard.FinishStep do not have a common superclass