stopButton = new JRadioButton(stopAction, false); stopButton.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (stopButton.isSelected()) { action = TestAction.STOP; durationField.setEnabled(false); } } });
pauseButton = new JRadioButton(pauseAction, true); pauseButton.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (pauseButton.isSelected()) { action = TestAction.PAUSE; durationField.setEnabled(true); } } });
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/sampler/gui/TestActionGui.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: 2 Number of AST nodes: 2
1
stopButton = new JRadioButton(stopAction, false);
1
pauseButton = new JRadioButton(pauseAction, true);
2
		stopButton.addChangeListener(new ChangeListener() {
2
		pauseButton.addChangeListener(new ChangeListener() {
3
			public void stateChanged(ChangeEvent e) {
3
			public void stateChanged(ChangeEvent e) {
4
				if (stopButton.isSelected()) {
4
				if (pauseButton.isSelected()) {
5
					action = TestAction.STOP;
5
					action = TestAction.PAUSE;
6
					durationField.setEnabled(false);
6
					durationField.setEnabled(true);
7
				}
7
				}
8
			}
8
			}
9
		});
9
		});
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 the same method
Number of node comparisons3
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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
    17
    stopButton = new JRadioButton(stopAction, false);
    17
    stopButton = new JRadioButton(stopAction, false);
    15
    pauseButton = new JRadioButton(pauseAction, true);
    Differences
    Expression1Expression2Difference
    stopButtonpauseButtonVARIABLE_NAME_MISMATCH
    stopActionpauseActionVARIABLE_NAME_MISMATCH
    falsetrueLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression stopButton is a field being modified, and thus it cannot be parameterized
    Expression pauseButton is a field being modified, and thus it cannot be parameterized
    15
    pauseButton = new JRadioButton(pauseAction, true);
    18
    stopButton.addChangeListener(new ChangeListener() {...});
    18
    stopButton.addChangeListener(new ChangeListener() {...});
    16
    pauseButton.addChangeListener(new ChangeListener() {...});
    Differences
    Expression1Expression2Difference
    stopButtonpauseButtonVARIABLE_NAME_MISMATCH
    STOPPAUSEVARIABLE_NAME_MISMATCH
    falsetrueLITERAL_VALUE_MISMATCH
    stopButtonpauseButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression stopButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pauseButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression stopButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pauseButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    pauseButton.addChangeListener(new ChangeListener() {...});
    Precondition Violations (6)
    Row Violation
    1Expression stopButton is a field being modified, and thus it cannot be parameterized
    2Expression pauseButton is a field being modified, and thus it cannot be parameterized
    3Expression stopButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression pauseButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression stopButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression pauseButton cannot be parameterized, because it has dependencies to/from statements that will be extracted