public class FtpTestSamplerGui extends AbstractSamplerGui { private LoginConfigGui loginPanel; private FtpConfigGui ftpDefaultPanel; public FtpTestSamplerGui() { init(); } public void configure(TestElement element) { super.configure(element); loginPanel.configure(element); ftpDefaultPanel.configure(element); } public TestElement createTestElement() { FTPSampler sampler = new FTPSampler(); 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 sampler) { sampler.clear(); ftpDefaultPanel.modifyTestElement(sampler); loginPanel.modifyTestElement(sampler); this.configureTestElement(sampler); } /** * Implements JMeterGUIComponent.clearGui */ public void clearGui() { super.clearGui(); ftpDefaultPanel.clearGui(); loginPanel.clearGui(); } public String getLabelResource() { return "ftp_testing_title"; // $NON-NLS-1$ } private void init() { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); VerticalPanel mainPanel = new VerticalPanel(); ftpDefaultPanel = new FtpConfigGui(false); mainPanel.add(ftpDefaultPanel); loginPanel = new LoginConfigGui(false); loginPanel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("login_config"))); // $NON-NLS-1$ mainPanel.add(loginPanel); add(mainPanel, BorderLayout.CENTER);
public class TCPSamplerGui extends AbstractSamplerGui { private LoginConfigGui loginPanel; private TCPConfigGui TcpDefaultPanel; public TCPSamplerGui() { init(); } public void configure(TestElement element) { super.configure(element); loginPanel.configure(element); TcpDefaultPanel.configure(element); } public TestElement createTestElement() { TCPSampler sampler = new TCPSampler(); 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 sampler) { sampler.clear(); sampler.addTestElement(TcpDefaultPanel.createTestElement()); sampler.addTestElement(loginPanel.createTestElement()); this.configureTestElement(sampler); } /** * Implements JMeterGUIComponent.clearGui */ public void clearGui() { super.clearGui(); TcpDefaultPanel.clearGui(); loginPanel.clearGui(); } public String getLabelResource() { return "tcp_sample_title"; // $NON-NLS-1$ } private void init() { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); VerticalPanel mainPanel = new VerticalPanel(); TcpDefaultPanel = new TCPConfigGui(false); mainPanel.add(TcpDefaultPanel); loginPanel = new LoginConfigGui(false); loginPanel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("login_config"))); // $NON-NLS-1$ mainPanel.add(loginPanel); add(mainPanel, BorderLayout.CENTER);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ftp/control/gui/FtpTestSamplerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/tcp/control/gui/TCPSamplerGui.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class FtpTestSamplerGui extends AbstractSamplerGui {
1
public class TCPSamplerGui extends AbstractSamplerGui {
2
	private LoginConfigGui loginPanel;
2
	private LoginConfigGui loginPanel;
3
	private FtpConfigGui ftpDefaultPanel;
3
	private TCPConfigGui TcpDefaultPanel;
4
	public FtpTestSamplerGui() {
4
	public TCPSamplerGui() {
5
		init();
5
		init();
6
	}
6
	}
7
	public void configure(TestElement element) {
7
	public void configure(TestElement element) {
8
		super.configure(element);
8
		super.configure(element);
9
		loginPanel.configure(element);
9
		loginPanel.configure(element);
10
		ftpDefaultPanel.configure(element);
10
		TcpDefaultPanel.configure(element);
11
	}
11
	}
12
	public TestElement createTestElement() {
12
	public TestElement createTestElement() {
13
		FTPSampler sampler = new FTPSampler();
13
		TCPSampler sampler = new TCPSampler();
14
		modifyTestElement(sampler);
14
		modifyTestElement(sampler);
15
		return sampler;
15
		return sampler;
16
	}
16
	}
17
	/**
17
	/**
18
	 * Modifies a given TestElement to mirror the data in the gui components.
18
	 * Modifies a given TestElement to mirror the data in the gui components.
19
	 * 
19
	 * 
20
	 * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
20
	 * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
21
	 */
21
	 */
22
	public void modifyTestElement(TestElement sampler) {
22
	public void modifyTestElement(TestElement sampler) {
23
		sampler.clear();
23
		sampler.clear();
24
		ftpDefaultPanel.modifyTestElement(sampler);
24
        sampler.addTestElement(TcpDefaultPanel.createTestElement(
25
		
25
));
26
loginPanel.modifyTestElement(sampler);
26
		sampler.addTestElement(loginPanel.createTestElement());
27
		this.configureTestElement(sampler);
27
		this.configureTestElement(sampler);
28
	}
28
	}
29
    /**
29
    /**
30
     * Implements JMeterGUIComponent.clearGui
30
     * Implements JMeterGUIComponent.clearGui
31
     */
31
     */
32
    public void clearGui() {
32
    public void clearGui() {
33
        super.clearGui();
33
        super.clearGui();
34
        ftpDefaultPanel.clearGui();
34
        TcpDefaultPanel.clearGui();
35
        loginPanel.clearGui();
35
        loginPanel.clearGui();
36
    }    
36
    }    
37
    
37
    
38
	public String getLabelResource() {
38
	public String getLabelResource() {
39
		return "ftp_testing_title"; // $NON-NLS-1$
39
		return "tcp_sample_title"; // $NON-NLS-1$
40
	}
40
	}
41
	private void init() {
41
	private void init() {
42
		setLayout(new BorderLayout(0, 5));
42
		setLayout(new BorderLayout(0, 5));
43
		setBorder(makeBorder());
43
		setBorder(makeBorder());
44
		add(makeTitlePanel(), BorderLayout.NORTH);
44
		add(makeTitlePanel(), BorderLayout.NORTH);
45
		VerticalPanel mainPanel = new VerticalPanel();
45
		VerticalPanel mainPanel = new VerticalPanel();
46
		ftpDefaultPanel = new FtpConfigGui(false);
46
		TcpDefaultPanel = new TCPConfigGui(false);
47
		mainPanel.add(ftpDefaultPanel);
47
		mainPanel.add(TcpDefaultPanel);
48
		loginPanel = new LoginConfigGui(false);
48
		loginPanel = new LoginConfigGui(false);
49
		loginPanel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("login_config"))); // $NON-NLS-1$
49
		loginPanel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("login_config"))); // $NON-NLS-1$
50
		mainPanel.add(loginPanel);
50
		mainPanel.add(loginPanel);
51
		add(mainPanel, BorderLayout.CENTER);
51
		add(mainPanel, BorderLayout.CENTER);
52
	
52
	
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