void configure(TestElement element) { scriptField.setText(element.getPropertyAsString(BeanShellAssertion.SCRIPT)); filename.setText(element.getPropertyAsString(BeanShellAssertion.FILENAME)); parameters.setText(element.getPropertyAsString(BeanShellAssertion.PARAMETERS)); resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellAssertion.RESET_INTERPRETER)); super.configure(element); } public TestElement createTestElement() { BeanShellAssertion sampler = new BeanShellAssertion(); modifyTestElement(sampler); return sampler; } /** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ public void modifyTestElement(TestElement te) { te.clear(); this.configureTestElement(te); te.setProperty(BeanShellAssertion.SCRIPT, scriptField.getText()); te.setProperty(BeanShellAssertion.FILENAME, filename.getText()); te.setProperty(BeanShellAssertion.PARAMETERS, parameters.getText()); te.setProperty(new BooleanProperty(BeanShellAssertion.RESET_INTERPRETER, resetInterpreter.isSelected())); }
void configure(TestElement element) { scriptField.setText(element.getPropertyAsString(BeanShellSampler.SCRIPT)); filename.setText(element.getPropertyAsString(BeanShellSampler.FILENAME)); parameters.setText(element.getPropertyAsString(BeanShellSampler.PARAMETERS)); resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellSampler.RESET_INTERPRETER)); super.configure(element); } public TestElement createTestElement() { BeanShellSampler sampler = new BeanShellSampler(); modifyTestElement(sampler); return sampler; } /** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ public void modifyTestElement(TestElement te) { te.clear(); this.configureTestElement(te); te.setProperty(BeanShellSampler.SCRIPT, scriptField.getText()); te.setProperty(BeanShellSampler.FILENAME, filename.getText()); te.setProperty(BeanShellSampler.PARAMETERS, parameters.getText()); te.setProperty(new BooleanProperty(BeanShellSampler.RESET_INTERPRETER, resetInterpreter.isSelected())); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/BeanShellAssertionGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/java/control/gui/BeanShellSamplerGui.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void configure(TestElement element) {
1
void configure(TestElement element) {
2
		scriptField.setText(element.getPropertyAsString(BeanShellAssertion.SCRIPT));
2
		scriptField.setText(element.getPropertyAsString(BeanShellSampler.SCRIPT));
3
		filename.setText(element.getPropertyAsString(BeanShellAssertion.FILENAME));
3
		filename.setText(element.getPropertyAsString(BeanShellSampler.FILENAME));
4
		parameters.setText(element.getPropertyAsString(BeanShellAssertion.PARAMETERS));
4
		parameters.setText(element.getPropertyAsString(BeanShellSampler.PARAMETERS));
5
        resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellAssertion.RESET_INTERPRETER));
5
		resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellSampler.RESET_INTERPRETER));
6
		super.configure(element);
6
		super.configure(element);
7
	}
7
	}
8
	public TestElement createTestElement() {
8
	public TestElement createTestElement() {
9
		BeanShellAssertion sampler = new BeanShellAssertion();
9
		BeanShellSampler sampler = new BeanShellSampler();
10
		modifyTestElement(sampler);
10
		modifyTestElement(sampler);
11
		return sampler;
11
		return sampler;
12
	}
12
	}
13
	/**
13
	/**
14
	 * Modifies a given TestElement to mirror the data in the gui components.
14
	 * Modifies a given TestElement to mirror the data in the gui components.
15
	 * 
15
	 * 
16
	 * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
16
	 * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
17
	 */
17
	 */
18
	public void modifyTestElement(TestElement te) {
18
	public void modifyTestElement(TestElement te) {
19
		te.clear();
19
		te.clear();
20
		this.configureTestElement(te);
20
		this.configureTestElement(te);
21
		te.setProperty(BeanShellAssertion.SCRIPT, scriptField.getText());
21
		te.setProperty(BeanShellSampler.SCRIPT, scriptField.getText());
22
		te.setProperty(BeanShellAssertion.FILENAME, filename.getText());
22
		te.setProperty(BeanShellSampler.FILENAME, filename.getText());
23
		te.setProperty(BeanShellAssertion.PARAMETERS, parameters.getText());
23
		te.setProperty(BeanShellSampler.PARAMETERS, parameters.getText());
24
        te.setProperty(new BooleanProperty(BeanShellAssertion.RESET_INTERPRETER, resetInterpreter.isSelected()));
24
		te.setProperty(new BooleanProperty(BeanShellSampler.RESET_INTERPRETER, resetInterpreter.isSelected()));
25
	}
25
	}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0