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 comparisons32
  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());
                                                                          
    2
    list.setCellRenderer(createThemeRenderer());
                                                                                                  
    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());
    Preondition Violations
    Unmatched statement panel.setLayout(new BorderLayout()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
    5
    JScrollPane pane = new JScrollPane(list);
                                                                                        
    6
    panel.add(pane, BorderLayout.NORTH);
    6
    panel.add(pane, BorderLayout.NORTH);
    2
    component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
    Differences
    Expression1Expression2Difference
    addsetLayoutMETHOD_INVOCATION_NAME_MISMATCH
    panelcomponentVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JComponentSUBCLASS_TYPE_MISMATCH
    panel.add(pane,BorderLayout.NORTH)component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression panel.add(pane,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(pane,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) is a void method call, and thus it cannot be parameterized
    Expression panel.add(pane,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression panel.add(pane,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) is a void method call, and thus it cannot be parameterized
    2
    component.setLayout(new BoxLayout(component, BoxLayout.Y_AXIS));
                                                                                                                                                                                                                                      
    3
    MultiLineLabel label = new MultiLineLabel(MailResourceLoader.getString("dialog", "accountwizard", "finish_text"));
                                                    
    4
    component.add(label);
                                                                                          
    5
    component.add(Box.createVerticalGlue());
    7
    return panel;
    7
    return panel;
    6
    return component;
    Differences
    Expression1Expression2Difference
    panelcomponentVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JComponentSUBCLASS_TYPE_MISMATCH
    6
    return component;
    Precondition Violations (10)
    Row Violation
    1Unmatched statement panel.setLayout(new BorderLayout()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression panel.add(pane,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression panel.add(pane,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    5Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) is a void method call, and thus it cannot be parameterized
    6Expression panel.add(pane,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression panel.add(pane,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    9Expression component.setLayout(new BoxLayout(component,BoxLayout.Y_AXIS)) is a void method call, and thus it cannot be parameterized
    10Clone fragment #1 returns variable panel with type javax.swing.JPanel , while Clone fragment #2 returns variable component with type javax.swing.JComponent