void modifyTestElement(TestElement args) { stopTableEditing(); Iterator modelData = tableModel.iterator(); LDAPArguments arguments = null; if (args instanceof LDAPArguments) { arguments = (LDAPArguments) args; arguments.clear(); while (modelData.hasNext()) { LDAPArgument arg = (LDAPArgument) modelData.next(); arg.setMetaData("="); arguments.addArgument(arg); } } this.configureTestElement(args); } /** * 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 el * the TestElement to configure */ public void configure(TestElement el) { super.configure(el); if (el instanceof LDAPArguments) { tableModel.clearData(); PropertyIterator iter = ((LDAPArguments) el).iterator(); while (iter.hasNext()) { LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue(); tableModel.addRow(arg); } } checkDeleteStatus(); } /** * Get the table used to enter arguments. * * @return the table used to enter arguments */ protected JTable getTable() { return table; } /** * Get the title label for this component. * * @return the title label displayed with the table */ protected JLabel getTableLabel() { return tableLabel; } /** * Get the button used to delete rows from the table. * * @return the button used to delete rows from the table */ protected JButton getDeleteButton() { return delete; } /** * Get the button used to add rows to the table. * * @return the button used to add rows to the table */ protected JButton getAddButton() { return add; } /** * Enable or disable the delete button depending on whether or not there is * a row to be deleted. */ protected void checkDeleteStatus() { // Disable DELETE if there are no rows in the table to delete. if (tableModel.getRowCount() == 0) { delete.setEnabled(false); } else { delete.setEnabled(true); } }
void modifyTestElement(TestElement args) { stopTableEditing(); Iterator modelData = tableModel.iterator(); Arguments arguments = null; if (args instanceof Arguments) { arguments = (Arguments) args; arguments.clear(); while (modelData.hasNext()) { Argument arg = (Argument) modelData.next(); arg.setMetaData("="); // $NON-NLS-1$ arguments.addArgument(arg); } } this.configureTestElement(args); } /** * 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 el * the TestElement to configure */ public void configure(TestElement el) { super.configure(el); if (el instanceof Arguments) { tableModel.clearData(); PropertyIterator iter = ((Arguments) el).iterator(); while (iter.hasNext()) { Argument arg = (Argument) iter.next().getObjectValue(); tableModel.addRow(arg); } } checkDeleteStatus(); } /** * Get the table used to enter arguments. * * @return the table used to enter arguments */ protected JTable getTable() { return table; } /** * Get the title label for this component. * * @return the title label displayed with the table */ protected JLabel getTableLabel() { return tableLabel; } /** * Get the button used to delete rows from the table. * * @return the button used to delete rows from the table */ protected JButton getDeleteButton() { return delete; } /** * Get the button used to add rows to the table. * * @return the button used to add rows to the table */ protected JButton getAddButton() { return add; } /** * Enable or disable the delete button depending on whether or not there is * a row to be deleted. */ protected void checkDeleteStatus() { // Disable DELETE if there are no rows in the table to delete. if (tableModel.getRowCount() == 0) { delete.setEnabled(false); } else { delete.setEnabled(true); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/config/gui/LDAPArgumentsPanel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/config/gui/ArgumentsPanel.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void modifyTestElement(TestElement args) {
1
void modifyTestElement(TestElement args) {
2
		stopTableEditing();
2
		stopTableEditing();
3
		Iterator modelData = tableModel.iterator();
3
		Iterator modelData = tableModel.iterator();
4
		LDAPArguments arguments = null;
4
		Arguments arguments = null;
5
		if (args instanceof LDAPArguments) {
5
		if (args instanceof Arguments) {
6
			arguments = (LDAPArguments) args;
6
			arguments = (Arguments) args;
7
			arguments.clear();
7
			arguments.clear();
8
			while (modelData.hasNext()) {
8
			while (modelData.hasNext()) {
9
				LDAPArgument arg = (LDAPArgument) modelData.next();
9
				Argument arg = (Argument) modelData.next();
10
				arg.setMetaData("=");
10
				arg.setMetaData("="); // $NON-NLS-1$
11
				arguments.addArgument(arg);
11
				arguments.addArgument(arg);
12
			}
12
			}
13
		}
13
		}
14
		this.configureTestElement(args);
14
		this.configureTestElement(args);
15
	}
15
	}
16
	/**
16
	/**
17
	 * A newly created component can be initialized with the contents of a Test
17
	 * A newly created component can be initialized with the contents of a Test
18
	 * Element object by calling this method. The component is responsible for
18
	 * Element object by calling this method. The component is responsible for
19
	 * querying the Test Element object for the relevant information to display
19
	 * querying the Test Element object for the relevant information to display
20
	 * in its GUI.
20
	 * in its GUI.
21
	 * 
21
	 * 
22
	 * @param el
22
	 * @param el
23
	 *            the TestElement to configure
23
	 *            the TestElement to configure
24
	 */
24
	 */
25
	public void configure(TestElement el) {
25
	public void configure(TestElement el) {
26
		super.configure(el);
26
		super.configure(el);
27
		if (el instanceof LDAPArguments) {
27
		if (el instanceof Arguments) {
28
			tableModel.clearData();
28
			tableModel.clearData();
29
			PropertyIterator iter = ((LDAPArguments) el).iterator();
29
			PropertyIterator iter = ((Arguments) el).iterator();
30
			while (iter.hasNext()) {
30
			while (iter.hasNext()) {
31
				LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue();
31
				Argument arg = (Argument) iter.next().getObjectValue();
32
				tableModel.addRow(arg);
32
				tableModel.addRow(arg);
33
			}
33
			}
34
		}
34
		}
35
		checkDeleteStatus();
35
		checkDeleteStatus();
36
	}
36
	}
37
	/**
37
	/**
38
	 * Get the table used to enter arguments.
38
	 * Get the table used to enter arguments.
39
	 * 
39
	 * 
40
	 * @return the table used to enter arguments
40
	 * @return the table used to enter arguments
41
	 */
41
	 */
42
	protected JTable getTable() {
42
	protected JTable getTable() {
43
		return table;
43
		return table;
44
	}
44
	}
45
	/**
45
	/**
46
	 * Get the title label for this component.
46
	 * Get the title label for this component.
47
	 * 
47
	 * 
48
	 * @return the title label displayed with the table
48
	 * @return the title label displayed with the table
49
	 */
49
	 */
50
	protected JLabel getTableLabel() {
50
	protected JLabel getTableLabel() {
51
		return tableLabel;
51
		return tableLabel;
52
	}
52
	}
53
	/**
53
	/**
54
	 * Get the button used to delete rows from the table.
54
	 * Get the button used to delete rows from the table.
55
	 * 
55
	 * 
56
	 * @return the button used to delete rows from the table
56
	 * @return the button used to delete rows from the table
57
	 */
57
	 */
58
	protected JButton getDeleteButton() {
58
	protected JButton getDeleteButton() {
59
		return delete;
59
		return delete;
60
	}
60
	}
61
	/**
61
	/**
62
	 * Get the button used to add rows to the table.
62
	 * Get the button used to add rows to the table.
63
	 * 
63
	 * 
64
	 * @return the button used to add rows to the table
64
	 * @return the button used to add rows to the table
65
	 */
65
	 */
66
	protected JButton getAddButton() {
66
	protected JButton getAddButton() {
67
		return add;
67
		return add;
68
	}
68
	}
69
	/**
69
	/**
70
	 * Enable or disable the delete button depending on whether or not there is
70
	 * Enable or disable the delete button depending on whether or not there is
71
	 * a row to be deleted.
71
	 * a row to be deleted.
72
	 */
72
	 */
73
	protected void checkDeleteStatus() {
73
	protected void checkDeleteStatus() {
74
		// Disable DELETE if there are no rows in the table to delete.
74
		// Disable DELETE if there are no rows in the table to delete.
75
		if (tableModel.getRowCount() == 0) {
75
		if (tableModel.getRowCount() == 0) {
76
			delete.setEnabled(false);
76
			delete.setEnabled(false);
77
		} else {
77
		} else {
78
			delete.setEnabled(true);
78
			delete.setEnabled(true);
79
		}
79
		}
80
	}
80
	}
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