RunTimeGui(boolean displayName) { this.displayName = displayName; init(); setState(1); } /** * A newly created component can be initialized with the contents of a Test * Element object by calling this method. The component is responsible for * querying the Test Element object for the relevant information to display * in its GUI. * * @param element * the TestElement to configure */ public void configure(TestElement element) { super.configure(element); if (element instanceof RunTime) { setState(((RunTime) element).getRuntimeString()); } else { setState(1); } } /* Implements JMeterGUIComponent.createTestElement() */ public TestElement createTestElement() { RunTime lc = new RunTime(); modifyTestElement(lc); return lc; } /* Implements JMeterGUIComponent.modifyTestElement(TestElement) */ public void modifyTestElement(TestElement lc) { configureTestElement(lc); if (lc instanceof RunTime) { if (seconds.getText().length() > 0) { ((RunTime) lc).setRuntime(seconds.getText()); } else { ((RunTime) lc).setRuntime(0); } } }
LoopControlPanel(boolean displayName) { this.displayName = displayName; init(); setState(1); } /** * A newly created component can be initialized with the contents of a Test * Element object by calling this method. The component is responsible for * querying the Test Element object for the relevant information to display * in its GUI. * * @param element * the TestElement to configure */ public void configure(TestElement element) { super.configure(element); if (element instanceof LoopController) { setState(((LoopController) element).getLoopString()); } else { setState(1); } } /* Implements JMeterGUIComponent.createTestElement() */ public TestElement createTestElement() { LoopController lc = new LoopController(); modifyTestElement(lc); return lc; } /* Implements JMeterGUIComponent.modifyTestElement(TestElement) */ public void modifyTestElement(TestElement lc) { configureTestElement(lc); if (lc instanceof LoopController) { if (loops.getText().length() > 0) { ((LoopController) lc).setLoops(loops.getText()); } else { ((LoopController) lc).setLoops(-1); } } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/RunTimeGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/LoopControlPanel.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
RunTimeGui(boolean displayName) {
1
LoopControlPanel(boolean displayName) {
2
		this.displayName = displayName;
2
		this.displayName = displayName;
3
		init();
3
		init();
4
		setState(1);
4
		setState(1);
5
	}
5
	}
6
	/**
6
	/**
7
	 * A newly created component can be initialized with the contents of a Test
7
	 * A newly created component can be initialized with the contents of a Test
8
	 * Element object by calling this method. The component is responsible for
8
	 * Element object by calling this method. The component is responsible for
9
	 * querying the Test Element object for the relevant information to display
9
	 * querying the Test Element object for the relevant information to display
10
	 * in its GUI.
10
	 * in its GUI.
11
	 * 
11
	 * 
12
	 * @param element
12
	 * @param element
13
	 *            the TestElement to configure
13
	 *            the TestElement to configure
14
	 */
14
	 */
15
	public void configure(TestElement element) {
15
	public void configure(TestElement element) {
16
		super.configure(element);
16
		super.configure(element);
17
		if (element instanceof RunTime) {
17
		if (element instanceof LoopController) {
18
			setState(((RunTime) element).getRuntimeString());
18
			setState(((LoopController) element).getLoopString());
19
		} else {
19
		} else {
20
			setState(1);
20
			setState(1);
21
		}
21
		}
22
	}
22
	}
23
	/* Implements JMeterGUIComponent.createTestElement() */
23
	/* Implements JMeterGUIComponent.createTestElement() */
24
	public TestElement createTestElement() {
24
	public TestElement createTestElement() {
25
		RunTime lc = new RunTime();
25
		LoopController lc = new LoopController();
26
		modifyTestElement(lc);
26
		modifyTestElement(lc);
27
		return lc;
27
		return lc;
28
	}
28
	}
29
	/* Implements JMeterGUIComponent.modifyTestElement(TestElement) */
29
	/* Implements JMeterGUIComponent.modifyTestElement(TestElement) */
30
	public void modifyTestElement(TestElement lc) {
30
	public void modifyTestElement(TestElement lc) {
31
		configureTestElement(lc);
31
		configureTestElement(lc);
32
		if (lc instanceof RunTime) {
32
		if (lc instanceof LoopController) {
33
			if (seconds.getText().length() > 0) {
33
			if (loops.getText().length() > 0) {
34
				((RunTime) lc).setRuntime(seconds.getText());
34
				((LoopController) lc).setLoops(loops.getText());
35
			} else {
35
			} else {
36
				((RunTime) lc).setRuntime(0);
36
				((LoopController) lc).setLoops(-1);
37
			}
37
			}
38
		}
38
		}
39
	}
39
	}
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