public class InterleaveControlGui extends AbstractControllerGui { private JCheckBox style; public InterleaveControlGui() { init(); } public void configure(TestElement el) { super.configure(el); if (((InterleaveControl) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) { style.setSelected(true); } else { style.setSelected(false); } } public TestElement createTestElement() { InterleaveControl ic = new InterleaveControl(); modifyTestElement(ic); return ic; } /** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ public void modifyTestElement(TestElement ic) { configureTestElement(ic); if (style.isSelected()) { ((InterleaveControl) ic).setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS); } else { ((InterleaveControl) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS); } } /** * Implements JMeterGUIComponent.clearGui */ public void clearGui() { super.clearGui(); style.setSelected(false); } public String getLabelResource() { return "interleave_control_title"; // $NON-NLS-1$ } private void init() { setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP)); setBorder(makeBorder()); add(makeTitlePanel()); style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$ add(style);
public class RandomControlGui extends AbstractControllerGui { private JCheckBox style; public RandomControlGui() { init(); } public TestElement createTestElement() { RandomController ic = new RandomController(); modifyTestElement(ic); return ic; } /** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ public void modifyTestElement(TestElement ic) { configureTestElement(ic); if (style.isSelected()) { ((RandomController) ic).setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS); } else { ((RandomController) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS); } } /** * Implements JMeterGUIComponent.clearGui */ public void clearGui() { super.clearGui(); style.setSelected(false); } public void configure(TestElement el) { super.configure(el); if (((RandomController) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) { style.setSelected(true); } else { style.setSelected(false); } } public String getLabelResource() { return "random_control_title"; // $NON-NLS-1$ } private void init() { setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP)); setBorder(makeBorder()); add(makeTitlePanel()); style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$ add(style);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/InterleaveControlGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/RandomControlGui.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class InterleaveControlGui extends AbstractControllerGui {
1
public class RandomControlGui extends AbstractControllerGui {
2
	private JCheckBox style;
2
	private JCheckBox style;
3
	public InterleaveControlGui() {
3
	public RandomControlGui() {
4
		init();
4
		init();
5
	}
5
	}
6
	public void configure(TestElement el) {
7
		super.configure(el);
8
		if (((InterleaveControl) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) {
9
			style.setSelected(true);
10
		} else {
11
			style.setSelected(false);
12
		}
13
	}
14
	public TestElement createTestElement() {
6
	public TestElement createTestElement() {
15
		InterleaveControl ic = new InterleaveControl();
7
		RandomController ic = new RandomController();
16
		modifyTestElement(ic);
8
		modifyTestElement(ic);
17
		return ic;
9
		return ic;
18
	}
10
	}
19
	/**
11
	/**
20
	 * Modifies a given TestElement to mirror the data in the gui components.
12
	 * Modifies a given TestElement to mirror the data in the gui components.
21
	 * 
13
	 * 
22
	 * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
14
	 * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
23
	 */
15
	 */
24
	public void modifyTestElement(TestElement ic) {
16
	public void modifyTestElement(TestElement ic) {
25
		configureTestElement(ic);
17
		configureTestElement(ic);
26
		if (style.isSelected()) {
18
		if (style.isSelected()) {
27
			((InterleaveControl) ic).setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
19
			((RandomController) ic).setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
28
		} else {
20
		} else {
29
			((InterleaveControl) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
21
			((RandomController) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
30
		}
22
		}
31
	}
23
	}
32
    /**
24
    /**
33
     * Implements JMeterGUIComponent.clearGui
25
     * Implements JMeterGUIComponent.clearGui
34
     */
26
     */
35
    public void clearGui() {
27
    public void clearGui() {
36
        super.clearGui();    
28
        super.clearGui(); 
37
        style.setSelected(false);
29
        style.setSelected(false);
38
    }
30
    }
39
    
31
	public void configure(TestElement el) {
32
		super.configure(el);
33
		if (((RandomController) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) {
34
			style.setSelected(true);
35
		} else {
36
			style.setSelected(false);
37
		}
38
	}
40
	public String getLabelResource() {
39
	public String getLabelResource() {
41
		return "interleave_control_title"; // $NON-NLS-1$
40
		return "random_control_title"; // $NON-NLS-1$
42
	}
41
	}
43
	private void init() {
42
	private void init() {
44
		setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
43
		setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
45
		setBorder(makeBorder());
44
		setBorder(makeBorder());
46
		add(makeTitlePanel());
45
		add(makeTitlePanel());
47
		style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$
46
		style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$
48
		add(style);
47
		add(style);
49
	
48
	
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