void addPostActionListener(Class action, ActionListener listener) { if (action != null) { HashSet set = (HashSet) postActionListeners.get(action.getName()); if (set == null) { set = new HashSet(); } set.add(listener); postActionListeners.put(action.getName(), set); } } /** * Allows an ActionListener to be removed from receiving notifications of a * command being executed after the command has executed. * * @param action * the Class of the command for which the listener will * notifications for. Class must extend * org.apache.jmeter.report.gui.action.Command. * @param listener */ public void removePostActionListener(Class action, ActionListener listener) { if (action != null) { HashSet set = (HashSet) postActionListeners.get(action.getName()); if (set != null) { set.remove(listener); postActionListeners.put(action.getName(), set); } } }
void addPreActionListener(Class action, ActionListener listener) { if (action != null) { HashSet set = (HashSet) preActionListeners.get(action.getName()); if (set == null) { set = new HashSet(); } set.add(listener); preActionListeners.put(action.getName(), set); } } /** * Allows an ActionListener to be removed from receiving notifications of a * command being executed prior to the actual execution of the command. * * @param action * the Class of the command for which the listener will * notifications for. Class must extend * org.apache.jmeter.gui.action.Command. * @param listener * the ActionListener to receive the notifications */ public void removePreActionListener(Class action, ActionListener listener) { if (action != null) { HashSet set = (HashSet) preActionListeners.get(action.getName()); if (set != null) { set.remove(listener); preActionListeners.put(action.getName(), set); } } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportActionRouter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/ActionRouter.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void addPostActionListener(Class action, ActionListener listener) {
1
void addPreActionListener(Class action, ActionListener listener) {
2
		if (action != null) {
2
		if (action != null) {
3
			HashSet set = (HashSet) postActionListeners.get(action.getName());
3
			HashSet set = (HashSet) preActionListeners.get(action.getName());
4
			if (set == null) {
4
			if (set == null) {
5
				set = new HashSet();
5
				set = new HashSet();
6
			}
6
			}
7
			set.add(listener);
7
			set.add(listener);
8
			postActionListeners.put(action.getName(), set);
8
			preActionListeners.put(action.getName(), set);
9
		}
9
		}
10
	}
10
	}
11
	/**
11
	/**
12
	 * Allows an ActionListener to be removed from receiving notifications of a
12
	 * Allows an ActionListener to be removed from receiving notifications of a
13
	 * command being executed after the command has executed.
13
	 * command being executed prior to the actual execution of the command.
14
	 * 
14
	 * 
15
	 * @param action
15
	 * @param action
16
	 *            the Class of the command for which the listener will
16
	 *            the Class of the command for which the listener will
17
	 *            notifications for. Class must extend
17
	 *            notifications for. Class must extend
18
	 *            org.apache.jmeter.report.gui.action.Command.
18
	 *            org.apache.jmeter.gui.action.Command.
19
	 * @param listener
19
	 * @param listener
20
	
20
	 *            the ActionListener to receive the notifications
21
 */
21
	 */
22
	public void removePostActionListener(Class action, ActionListener listener) {
22
	public void removePreActionListener(Class action, ActionListener listener) {
23
		if (action != null) {
23
		if (action != null) {
24
			HashSet set = (HashSet) postActionListeners.get(action.getName());
24
			HashSet set = (HashSet) preActionListeners.get(action.getName());
25
			if (set != null) {
25
			if (set != null) {
26
				set.remove(listener);
26
				set.remove(listener);
27
				postActionListeners.put(action.getName(), set);
27
				preActionListeners.put(action.getName(), set);
28
			}
28
			}
29
		}
29
		}
30
	}
30
	}
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