DefaultComboBoxModel styleModel = new DefaultComboBoxModel(); styleModel.addElement(BYNUMBER_LABEL); styleModel.addElement(BYPERCENT_LABEL); styleBox = new JComboBox(styleModel); styleBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (((String) styleBox.getSelectedItem()).equals(BYNUMBER_LABEL)) { style = ThroughputController.BYNUMBER; } else { style = ThroughputController.BYPERCENT; } } });
DefaultComboBoxModel targetModel = new DefaultComboBoxModel(); targetModel.addElement(threadTarget); targetModel.addElement(testTarget); targetBox = new JComboBox(targetModel); targetBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (((String) targetBox.getSelectedItem()).equals(threadTarget)) { target = TestAction.THREAD; } else { target = TestAction.TEST; } } });
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/ThroughputControllerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/sampler/gui/TestActionGui.java
Method name: void init() Method name: void init()
Number of AST nodes: 5 Number of AST nodes: 5
1
DefaultComboBoxModel styleModel = new DefaultComboBoxModel();
1
DefaultComboBoxModel targetModel = new DefaultComboBoxModel();
2
		styleModel.addElement(BYNUMBER_LABEL);
2
		targetModel.addElement(
3
		style
3
threadTarget);
4
Model.addElement(BYPERCENT_LABEL);
4
		targetModel.addElement(
5
		style
5
testTarget);
6
Box = new JComboBox(styleModel);
6
		targetBox = new JComboBox(targetModel);
7
		styleBox.addActionListener(new ActionListener() {
7
		targetBox.addActionListener(new ActionListener() {
8
			public void actionPerformed(ActionEvent e) {
8
			public void actionPerformed(ActionEvent e) {
9
				if (((String) styleBox.getSelectedItem()).equals(BYNUMBER_LABEL)) {
9
				if (((String) targetBox.getSelectedItem()).equals(
10
					style = ThroughputController.BYNUMBER;
11
				} else {
12
					style = ThroughputController.BYPERCEN
10
threadTarget)) {
11
					target = TestAction.THREAD;
12
				} else {
13
T;
13
					target = TestAction.TEST;
14
				}
14
				}
15
			}
15
			}
16
		});
16
		});
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 comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    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
    4
    DefaultComboBoxModel styleModel = new DefaultComboBoxModel();
    4
    DefaultComboBoxModel styleModel = new DefaultComboBoxModel();
    6
    DefaultComboBoxModel targetModel = new DefaultComboBoxModel();
    Differences
    Expression1Expression2Difference
    styleModeltargetModelVARIABLE_NAME_MISMATCH
    6
    DefaultComboBoxModel targetModel = new DefaultComboBoxModel();
    5
    styleModel.addElement(BYNUMBER_LABEL);
    5
    styleModel.addElement(BYNUMBER_LABEL);
    7
    targetModel.addElement(threadTarget);
    Differences
    Expression1Expression2Difference
    BYNUMBER_LABELthreadTargetVARIABLE_NAME_MISMATCH
    styleModeltargetModelVARIABLE_NAME_MISMATCH
    7
    targetModel.addElement(threadTarget);
    6
    styleModel.addElement(BYPERCENT_LABEL);
    6
    styleModel.addElement(BYPERCENT_LABEL);
    8
    targetModel.addElement(testTarget);
    Differences
    Expression1Expression2Difference
    BYPERCENT_LABELtestTargetVARIABLE_NAME_MISMATCH
    styleModeltargetModelVARIABLE_NAME_MISMATCH
    8
    targetModel.addElement(testTarget);
    7
    styleBox = new JComboBox(styleModel);
    7
    styleBox = new JComboBox(styleModel);
    9
    targetBox = new JComboBox(targetModel);
    Differences
    Expression1Expression2Difference
    styleBoxtargetBoxVARIABLE_NAME_MISMATCH
    styleModeltargetModelVARIABLE_NAME_MISMATCH
    9
    targetBox = new JComboBox(targetModel);
    8
    styleBox.addActionListener(new ActionListener() {...});
    8
    styleBox.addActionListener(new ActionListener() {...});
    10
    targetBox.addActionListener(new ActionListener() {...});
    Differences
    Expression1Expression2Difference
    BYNUMBER_LABELthreadTargetVARIABLE_NAME_MISMATCH
    styleBoxtargetBoxVARIABLE_NAME_MISMATCH
    styletargetVARIABLE_NAME_MISMATCH
    org.apache.jmeter.control.ThroughputControllerorg.apache.jmeter.sampler.TestActionSUBCLASS_TYPE_MISMATCH
    BYNUMBERTHREADVARIABLE_NAME_MISMATCH
    styletargetVARIABLE_NAME_MISMATCH
    org.apache.jmeter.control.ThroughputControllerorg.apache.jmeter.sampler.TestActionSUBCLASS_TYPE_MISMATCH
    BYPERCENTTESTVARIABLE_NAME_MISMATCH
    styleBoxtargetBoxVARIABLE_NAME_MISMATCH
    10
    targetBox.addActionListener(new ActionListener() {...});
    Precondition Violations (0)
    Row Violation