add = new JButton(JMeterUtils.getResString("add")); //$NON-NLS-1$ add.setActionCommand(ADD); add.addActionListener(this); add.setEnabled(true); delete = new JButton(JMeterUtils.getResString("delete")); // $NON-NLS-1$ delete.setActionCommand(DELETE); delete.addActionListener(this); checkDeleteStatus(); JPanel buttonPanel = new JPanel(); buttonPanel.add(add); buttonPanel.add(delete); return buttonPanel;
setLayout(new BorderLayout()); setBorder(makeBorder()); Box box = Box.createVerticalBox(); box.add(makeTitlePanel()); box.add(createFilenamePanel()); errorsOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_errors")); // $NON-NLS-1$ box.add(errorsOnly); successOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_success")); // $NON-NLS-1$ box.add(successOnly); add(box, BorderLayout.NORTH);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/config/gui/SimpleConfigGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/reporters/gui/ResultSaverGui.java
Method name: JPanel createButtonPanel() Method name: void init()
Number of AST nodes: 12 Number of AST nodes: 10
1
add = new JButton(JMeterUtils.getResString("add")); //$NON-NLS-1$
2
		add.setActionCommand(ADD
1
setLayout(new BorderLayout());
2
		setBorder(makeBorder());
3
);
3
		Box box = Box.createVerticalBox();
4
		add.addActionListener(this);
4
		box.add
5
		add.setEnabled(true);
6
		delete = new JButton
5
(makeTitlePanel());
6
		box.add(createFilenamePanel());
7
(JMeterUtils.getResString("delete")); // $NON-NLS-1$
7
		errorsOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_errors")); // $NON-NLS-1$
8
		delete.setActionCommand(DELETE);
8
		
9
		delete.addActionListener(this);
10
		checkDeleteStatus();
11
		JPanel buttonPanel = new JPanel();
12
		buttonPanel.add(add);
13
		buttonPanel.add(delete);
14
		return buttonPanel
9
box.add(errorsOnly);
10
        successOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_success")); // $NON-NLS-1$
11
        box.add(successOnly);
15
;
12
		add(box, BorderLayout.NORTH);
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 having the same super class
Number of node comparisons59
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment5
    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
                                                          
    2
    setBorder(makeBorder());
    1
    add = new JButton(JMeterUtils.getResString("add"));
    1
    add = new JButton(JMeterUtils.getResString("add"));
    6
    errorsOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_errors"));
    Differences
    Expression1Expression2Difference
    adderrorsOnlyVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    javax.swing.JButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    "add""resultsaver_errors"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression add is a field being modified, and thus it cannot be parameterized
    Expression errorsOnly is a field being modified, and thus it cannot be parameterized
    6
    errorsOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_errors"));
    2
    add.setActionCommand(ADD);
                                                              
    3
    add.addActionListener(this);
                                                                  
    4
    add.setEnabled(true);
                                                    
                                                  
    7
    box.add(errorsOnly);
    5
    delete = new JButton(JMeterUtils.getResString("delete"));
    5
    delete = new JButton(JMeterUtils.getResString("delete"));
    8
    successOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_success"));
    Differences
    Expression1Expression2Difference
    deletesuccessOnlyVARIABLE_NAME_MISMATCH
    javax.swing.JButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    javax.swing.JButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    "delete""resultsaver_success"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression delete is a field being modified, and thus it cannot be parameterized
    Expression successOnly is a field being modified, and thus it cannot be parameterized
    8
    successOnly = new JCheckBox(JMeterUtils.getResString("resultsaver_success"));
    6
    delete.setActionCommand(DELETE);
                                                                          
    7
    delete.addActionListener(this);
    7
    delete.addActionListener(this);
    10
    add(box, BorderLayout.NORTH);
    Differences
    Expression1Expression2Difference
    addActionListeneraddMETHOD_INVOCATION_NAME_MISMATCH
    delete.addActionListener(this)add(box,BorderLayout.NORTH)ARGUMENT_NUMBER_MISMATCH
    deleteMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression delete.addActionListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(box,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression delete.addActionListener(this) is a void method call, and thus it cannot be parameterized
    Expression add(box,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression delete.addActionListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(box,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression delete.addActionListener(this) is a void method call, and thus it cannot be parameterized
    Expression add(box,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    10
    add(box, BorderLayout.NORTH);
    8
    checkDeleteStatus();
    8
    checkDeleteStatus();
    1
    setLayout(new BorderLayout());
    Differences
    Expression1Expression2Difference
    checkDeleteStatussetLayoutMETHOD_INVOCATION_NAME_MISMATCH
    checkDeleteStatus()setLayout(new BorderLayout())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression checkDeleteStatus() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression checkDeleteStatus() is a void method call, and thus it cannot be parameterized
    Expression setLayout(new BorderLayout()) is a void method call, and thus it cannot be parameterized
    Expression checkDeleteStatus() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression checkDeleteStatus() is a void method call, and thus it cannot be parameterized
    Expression setLayout(new BorderLayout()) is a void method call, and thus it cannot be parameterized
    1
    setLayout(new BorderLayout());
    9
    JPanel buttonPanel = new JPanel();
    9
    JPanel buttonPanel = new JPanel();
    3
    Box box = Box.createVerticalBox();
    Differences
    Expression1Expression2Difference
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    buttonPanelboxVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    new JPanel()Box.createVerticalBox()TYPE_COMPATIBLE_REPLACEMENT
    3
    Box box = Box.createVerticalBox();
    10
    buttonPanel.add(add);
    10
    buttonPanel.add(add);
    4
    box.add(makeTitlePanel());
    Differences
    Expression1Expression2Difference
    addmakeTitlePanel()TYPE_COMPATIBLE_REPLACEMENT
    buttonPanelboxVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression add cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    box.add(makeTitlePanel());
    11
    buttonPanel.add(delete);
    11
    buttonPanel.add(delete);
    5
    box.add(createFilenamePanel());
    Differences
    Expression1Expression2Difference
    deletecreateFilenamePanel()TYPE_COMPATIBLE_REPLACEMENT
    buttonPanelboxVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression delete cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    box.add(createFilenamePanel());
                                                    
    9
    box.add(successOnly);
    12
    return buttonPanel;
                                                  
    Precondition Violations (21)
    Row Violation
    1Expression add is a field being modified, and thus it cannot be parameterized
    2Expression errorsOnly is a field being modified, and thus it cannot be parameterized
    3Expression delete is a field being modified, and thus it cannot be parameterized
    4Expression successOnly is a field being modified, and thus it cannot be parameterized
    5Expression delete.addActionListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression add(box,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression delete.addActionListener(this) is a void method call, and thus it cannot be parameterized
    8Expression add(box,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    9Expression delete.addActionListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression add(box,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression delete.addActionListener(this) is a void method call, and thus it cannot be parameterized
    12Expression add(box,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    13Expression checkDeleteStatus() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression checkDeleteStatus() is a void method call, and thus it cannot be parameterized
    15Expression setLayout(new BorderLayout()) is a void method call, and thus it cannot be parameterized
    16Expression checkDeleteStatus() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression checkDeleteStatus() is a void method call, and thus it cannot be parameterized
    18Expression setLayout(new BorderLayout()) is a void method call, and thus it cannot be parameterized
    19Expression add cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression delete cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Clone fragment #1 returns variable buttonPanel with type javax.swing.JPanel , while Clone fragment #2 returns variable box with type javax.swing.Box