styleBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (((String) styleBox.getSelectedItem()).equals(BYNUMBER_LABEL)) { style = ThroughputController.BYNUMBER; } else { style = ThroughputController.BYPERCENT; } } });
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: 1 Number of AST nodes: 1
1
styleBox.addActionListener(new ActionListener() {
1
targetBox.addActionListener(new ActionListener() {
2
			public void actionPerformed(ActionEvent e) {
2
			public void actionPerformed(ActionEvent e) {
3
				if (((String) styleBox.getSelectedItem()).equals(BYNUMBER_LABEL)) {
3
				if (((String) targetBox.getSelectedItem()).equals(
4
					style = ThroughputController.BYNUMBER;
5
				} else {
6
					style = ThroughputController.BYPERCEN
4
threadTarget)) {
5
					target = TestAction.THREAD;
6
				} else {
7
T;
7
					target = TestAction.TEST;
8
				}
8
				}
9
			}
9
			}
10
		});
10
		});
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 comparisons1
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    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
    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
    Preondition Violations
    Expression style cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression style is a field being modified, and thus it cannot be parameterized
    Expression target is a field being modified, and thus it cannot be parameterized
    Expression style cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression target cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression style is a field being modified, and thus it cannot be parameterized
    Expression target is a field being modified, and thus it cannot be parameterized
    10
    targetBox.addActionListener(new ActionListener() {...});
    Precondition Violations (8)
    Row Violation
    1Expression style cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression target cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression style is a field being modified, and thus it cannot be parameterized
    4Expression target is a field being modified, and thus it cannot be parameterized
    5Expression style cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression target cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression style is a field being modified, and thus it cannot be parameterized
    8Expression target is a field being modified, and thus it cannot be parameterized