JRadioButton button = new JRadioButton(name); button.setActionCommand(String.valueOf(value)); button.addActionListener(this); group.add(button); return button;
JCheckBox checkBox = new JCheckBox(JMeterUtils.getResString(labelResourceName)); checkBox.setSelected(true); checkBox.addItemListener(this); checkBox.setForeground(color); return checkBox;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/SizeAssertionGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/GraphVisualizer.java
Method name: JRadioButton createComparatorButton(String, int, ButtonGroup) Method name: JCheckBox createChooseCheckBox(String, Color)
Number of AST nodes: 5 Number of AST nodes: 5
1
JRadioButton button = new JRadioButton(name);
1
JCheckBox checkBox = new JCheckBox(JMeterUtils.getResString(labelResourceName));
2
		button.setActionCommand(String.valueOf(value));
2
		checkBox.setSelected(tr
3
		button.addActionListener(this);
4
		group.add(button
3
ue);
4
		checkBox.addItemListener(this);
5
);
5
		checkBox.setForeground(color);
6
		return button;
6
		return checkBox;
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 comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    JRadioButton button = new JRadioButton(name);
    1
    JRadioButton button = new JRadioButton(name);
    1
    JCheckBox checkBox = new JCheckBox(JMeterUtils.getResString(labelResourceName));
    Differences
    Expression1Expression2Difference
    javax.swing.JRadioButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    buttoncheckBoxVARIABLE_NAME_MISMATCH
    javax.swing.JRadioButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    javax.swing.JRadioButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    nameJMeterUtils.getResString(labelResourceName)TYPE_COMPATIBLE_REPLACEMENT
    1
    JCheckBox checkBox = new JCheckBox(JMeterUtils.getResString(labelResourceName));
                                                                
    2
    checkBox.setSelected(true);
    2
    button.setActionCommand(String.valueOf(value));
                                                                                                        
    3
    button.addActionListener(this);
    3
    button.addActionListener(this);
    3
    checkBox.addItemListener(this);
    Differences
    Expression1Expression2Difference
    addActionListeneraddItemListenerMETHOD_INVOCATION_NAME_MISMATCH
    buttoncheckBoxVARIABLE_NAME_MISMATCH
    javax.swing.JRadioButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression button.addActionListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression checkBox.addItemListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression button.addActionListener(this) is a void method call, and thus it cannot be parameterized
    Expression checkBox.addItemListener(this) is a void method call, and thus it cannot be parameterized
    3
    checkBox.addItemListener(this);
                                                                      
    4
    checkBox.setForeground(color);
    4
    group.add(button);
                                              
    5
    return button;
    5
    return button;
    5
    return checkBox;
    Differences
    Expression1Expression2Difference
    buttoncheckBoxVARIABLE_NAME_MISMATCH
    javax.swing.JRadioButtonjavax.swing.JCheckBoxSUBCLASS_TYPE_MISMATCH
    5
    return checkBox;
    Precondition Violations (5)
    Row Violation
    1Expression button.addActionListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression checkBox.addItemListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression button.addActionListener(this) is a void method call, and thus it cannot be parameterized
    4Expression checkBox.addItemListener(this) is a void method call, and thus it cannot be parameterized
    5Clone fragment #1 returns variable button with type javax.swing.JRadioButton , while Clone fragment #2 returns variable checkBox with type javax.swing.JCheckBox