public void setTreeListener(JMeterTreeListener newTreeListener) { treeListener = newTreeListener; } /** * Get the listener for JMeter's test tree. * * @return the JMeter test tree listener */ public JMeterTreeListener getTreeListener() { return treeListener; } /** * Display the specified popup menu with the source component and location * from the specified mouse event. * * @param e * the mouse event causing this popup to be displayed * @param popup * the popup menu to display */ public void displayPopUp(MouseEvent e, JPopupMenu popup) { displayPopUp((Component) e.getSource(), e, popup); } /** * Display the specified popup menu at the location specified by a mouse * event with the specified source component. * * @param invoker * the source component * @param e * the mouse event causing this popup to be displayed * @param popup * the popup menu to display */ public void displayPopUp(Component invoker, MouseEvent e, JPopupMenu popup) { if (popup != null) { log.debug("Showing pop up for " + invoker + " at x,y = " + e.getX() + "," + e.getY()); popup.pack(); popup.show(invoker, e.getX(), e.getY()); popup.setVisible(true); popup.requestFocus(); } } /* * (non-Javadoc) * * @see org.apache.jmeter.util.LocaleChangeListener#localeChanged(org.apache.jmeter.util.LocaleChangeEvent) */ public void localeChanged(LocaleChangeEvent event) { // FIrst make sure we save the content of the current GUI (since we // will flush it away): updateCurrentNode(); // Forget about all GUIs we've created so far: we'll need to re-created // them all! guis = new HashMap(); nodesToGui = new HashMap(); testBeanGUIs = new HashMap(); // BeanInfo objects also contain locale-sensitive data -- flush them // away: Introspector.flushCaches(); // Now put the current GUI in place. [This code was copied from the // EditCommand action -- we can't just trigger the action because that // would populate the current node with the contents of the new GUI -- // which is empty.] MainFrame mf = getMainFrame(); // Fetch once if (mf == null) // Probably caused by unit testing on headless system { log.warn("Mainframe is null"); } else { mf.setMainPanel((javax.swing.JComponent) getCurrentGui()); mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu()); } } private String testPlanFile;
public void setTreeListener(ReportTreeListener newTreeListener) { treeListener = newTreeListener; } /** * Get the listener for JMeter's test tree. * * @return the JMeter test tree listener */ public ReportTreeListener getTreeListener() { return treeListener; } /** * Display the specified popup menu with the source component and location * from the specified mouse event. * * @param e * the mouse event causing this popup to be displayed * @param popup * the popup menu to display */ public void displayPopUp(MouseEvent e, JPopupMenu popup) { displayPopUp((Component) e.getSource(), e, popup); } /** * Display the specified popup menu at the location specified by a mouse * event with the specified source component. * * @param invoker * the source component * @param e * the mouse event causing this popup to be displayed * @param popup * the popup menu to display */ public void displayPopUp(Component invoker, MouseEvent e, JPopupMenu popup) { if (popup != null) { log.debug("Showing pop up for " + invoker + " at x,y = " + e.getX() + "," + e.getY()); popup.pack(); popup.show(invoker, e.getX(), e.getY()); popup.setVisible(true); popup.requestFocus(); } } /* * (non-Javadoc) * * @see org.apache.jmeter.util.LocaleChangeListener#localeChanged(org.apache.jmeter.util.LocaleChangeEvent) */ public void localeChanged(LocaleChangeEvent event) { // FIrst make sure we save the content of the current GUI (since we // will flush it away): updateCurrentNode(); // Forget about all GUIs we've created so far: we'll need to re-created // them all! guis = new HashMap(); nodesToGui = new HashMap(); testBeanGUIs = new HashMap(); // BeanInfo objects also contain locale-sensitive data -- flush them // away: Introspector.flushCaches(); // Now put the current GUI in place. [This code was copied from the // EditCommand action -- we can't just trigger the action because that // would populate the current node with the contents of the new GUI -- // which is empty.] ReportMainFrame mf = getMainFrame(); // Fetch once if (mf == null) // Probably caused by unit testing on headless system { log.warn("Mainframe is null"); } else { mf.setMainPanel((javax.swing.JComponent) getCurrentGui()); mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu()); } } private String reportPlanFile;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/GuiPackage.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/ReportGuiPackage.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void setTreeListener(JMeterTreeListener newTreeListener) {
1
public void setTreeListener(ReportTreeListener newTreeListener) {
2
		treeListener = newTreeListener;
2
		treeListener = newTreeListener;
3
	}
3
	}
4
	/**
4
	/**
5
	 * Get the listener for JMeter's test tree.
5
	 * Get the listener for JMeter's test tree.
6
	 * 
6
	 * 
7
	 * @return the JMeter test tree listener
7
	 * @return the JMeter test tree listener
8
	 */
8
	 */
9
	public JMeterTreeListener getTreeListener() {
9
	public ReportTreeListener getTreeListener() {
10
		return treeListener;
10
		return treeListener;
11
	}
11
	}
12
	/**
12
	/**
13
	 * Display the specified popup menu with the source component and location
13
	 * Display the specified popup menu with the source component and location
14
	 * from the specified mouse event.
14
	 * from the specified mouse event.
15
	 * 
15
	 * 
16
	 * @param e
16
	 * @param e
17
	 *            the mouse event causing this popup to be displayed
17
	 *            the mouse event causing this popup to be displayed
18
	 * @param popup
18
	 * @param popup
19
	 *            the popup menu to display
19
	 *            the popup menu to display
20
	 */
20
	 */
21
	public void displayPopUp(MouseEvent e, JPopupMenu popup) {
21
	public void displayPopUp(MouseEvent e, JPopupMenu popup) {
22
		displayPopUp((Component) e.getSource(), e, popup);
22
		displayPopUp((Component) e.getSource(), e, popup);
23
	}
23
	}
24
	/**
24
	/**
25
	 * Display the specified popup menu at the location specified by a mouse
25
	 * Display the specified popup menu at the location specified by a mouse
26
	 * event with the specified source component.
26
	 * event with the specified source component.
27
	 * 
27
	 * 
28
	 * @param invoker
28
	 * @param invoker
29
	 *            the source component
29
	 *            the source component
30
	 * @param e
30
	 * @param e
31
	 *            the mouse event causing this popup to be displayed
31
	 *            the mouse event causing this popup to be displayed
32
	 * @param popup
32
	 * @param popup
33
	 *            the popup menu to display
33
	 *            the popup menu to display
34
	 */
34
	 */
35
	public void displayPopUp(Component invoker, MouseEvent e, JPopupMenu popup) {
35
	public void displayPopUp(Component invoker, MouseEvent e, JPopupMenu popup) {
36
		if (popup != null) {
36
		if (popup != null) {
37
			log.debug("Showing pop up for " + invoker + " at x,y = " + e.getX() + "," + e.getY());
37
			log.debug("Showing pop up for " + invoker + " at x,y = " + e.getX() + "," + e.getY());
38
			popup.pack();
38
			popup.pack();
39
			popup.show(invoker, e.getX(), e.getY());
39
			popup.show(invoker, e.getX(), e.getY());
40
			popup.setVisible(true);
40
			popup.setVisible(true);
41
			popup.requestFocus();
41
			popup.requestFocus();
42
		}
42
		}
43
	}
43
	}
44
	/*
44
	/*
45
	 * (non-Javadoc)
45
	 * (non-Javadoc)
46
	 * 
46
	 * 
47
	 * @see org.apache.jmeter.util.LocaleChangeListener#localeChanged(org.apache.jmeter.util.LocaleChangeEvent)
47
	 * @see org.apache.jmeter.util.LocaleChangeListener#localeChanged(org.apache.jmeter.util.LocaleChangeEvent)
48
	 */
48
	 */
49
	public void localeChanged(LocaleChangeEvent event) {
49
	public void localeChanged(LocaleChangeEvent event) {
50
		// FIrst make sure we save the content of the current GUI (since we
50
		// FIrst make sure we save the content of the current GUI (since we
51
		// will flush it away):
51
		// will flush it away):
52
		updateCurrentNode();
52
		updateCurrentNode();
53
		// Forget about all GUIs we've created so far: we'll need to re-created
53
		// Forget about all GUIs we've created so far: we'll need to re-created
54
		// them all!
54
		// them all!
55
		guis = new HashMap();
55
		guis = new HashMap();
56
		nodesToGui = new HashMap();
56
		nodesToGui = new HashMap();
57
		testBeanGUIs = new HashMap();
57
		testBeanGUIs = new HashMap();
58
		// BeanInfo objects also contain locale-sensitive data -- flush them
58
		// BeanInfo objects also contain locale-sensitive data -- flush them
59
		// away:
59
		// away:
60
		Introspector.flushCaches();
60
		Introspector.flushCaches();
61
		// Now put the current GUI in place. [This code was copied from the
61
		// Now put the current GUI in place. [This code was copied from the
62
		// EditCommand action -- we can't just trigger the action because that
62
		// EditCommand action -- we can't just trigger the action because that
63
		// would populate the current node with the contents of the new GUI --
63
		// would populate the current node with the contents of the new GUI --
64
		// which is empty.]
64
		// which is empty.]
65
		MainFrame mf = getMainFrame(); // Fetch once
65
		ReportMainFrame mf = getMainFrame(); // Fetch once
66
		if (mf == null) // Probably caused by unit testing on headless system
66
		if (mf == null) // Probably caused by unit testing on headless system
67
		{
67
		{
68
			log.warn("Mainframe is null");
68
			log.warn("Mainframe is null");
69
		} else {
69
		} else {
70
			mf.setMainPanel((javax.swing.JComponent) getCurrentGui());
70
			mf.setMainPanel((javax.swing.JComponent) getCurrentGui());
71
			mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
71
			mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
72
		}
72
		}
73
	}
73
	}
74
	private String testPlanFile;
74
	private String reportPlanFile;
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