void init() { menuBar = new JMeterMenuBar(); setJMenuBar(menuBar); JPanel all = new JPanel(new BorderLayout()); all.add(createToolBar(), BorderLayout.NORTH); JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); treePanel = createTreePanel(); treeAndMain.setLeftComponent(treePanel); mainPanel = createMainPanel(); treeAndMain.setRightComponent(mainPanel); treeAndMain.setResizeWeight(.2); treeAndMain.setContinuousLayout(true); all.add(treeAndMain, BorderLayout.CENTER); getContentPane().add(all); tree.setSelectionRow(1); addWindowListener(new WindowHappenings()); setTitle(DEFAULT_TITLE); setIconImage(JMeterUtils.getImage("jmeter.jpg").getImage());// $NON-NLS-1$ } public void setExtendedFrameTitle(String fname) { // file New operation may set to null, so just return app name if (fname == null) { setTitle(DEFAULT_TITLE); return; } // allow for windows / chars in filename String temp = fname.replace('\\', '/'); // $NON-NLS-1$ // $NON-NLS-2$ String simpleName = temp.substring(temp.lastIndexOf("/") + 1);// $NON-NLS-1$ setTitle(simpleName + " (" + fname + ") - " + DEFAULT_TITLE); // $NON-NLS-1$ // $NON-NLS-2$ } /** * Create the JMeter tool bar pane containing the running indicator. * * @return a panel containing the running indicator */ private Component createToolBar() { Box toolPanel = new Box(BoxLayout.X_AXIS); toolPanel.add(Box.createRigidArea(new Dimension(10, 15))); toolPanel.add(Box.createGlue()); toolPanel.add(activeThreads);
void init() {// called from ctor, so must not be overridable menuBar = new ReportMenuBar(); setJMenuBar(menuBar); JPanel all = new JPanel(new BorderLayout()); all.add(createToolBar(), BorderLayout.NORTH); JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); treePanel = createTreePanel(); treeAndMain.setLeftComponent(treePanel); mainPanel = createMainPanel(); treeAndMain.setRightComponent(mainPanel); treeAndMain.setResizeWeight(.2); treeAndMain.setContinuousLayout(true); all.add(treeAndMain, BorderLayout.CENTER); getContentPane().add(all); tree.setSelectionRow(1); addWindowListener(new WindowHappenings()); setTitle(DEFAULT_TITLE); setIconImage(JMeterUtils.getImage("jmeter.jpg").getImage());// $NON-NLS-1$ } public void setExtendedFrameTitle(String fname) { // file New operation may set to null, so just return app name if (fname == null) { setTitle(DEFAULT_TITLE); return; } // allow for windows / chars in filename String temp = fname.replace('\\', '/'); // $NON-NLS-1$ // $NON-NLS-2$ String simpleName = temp.substring(temp.lastIndexOf("/") + 1);// $NON-NLS-1$ setTitle(simpleName + " (" + fname + ") - " + DEFAULT_TITLE); // $NON-NLS-1$ // $NON-NLS-2$ } /** * Create the JMeter tool bar pane containing the running indicator. * * @return a panel containing the running indicator */ protected Component createToolBar() { Box toolPanel = new Box(BoxLayout.X_AXIS); toolPanel.add(Box.createRigidArea(new Dimension(10, 15))); toolPanel.add(Box.createGlue()); toolPanel.add(runningIndicator);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/MainFrame.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/ReportMainFrame.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void init() {
1
void init() {// called from ctor, so must not be overridable
2
		menuBar = new JMeterMenuBar();
2
		menuBar = new ReportMenuBar();
3
		setJMenuBar(menuBar);
3
		setJMenuBar(menuBar);
4
		JPanel all = new JPanel(new BorderLayout());
4
		JPanel all = new JPanel(new BorderLayout());
5
		all.add(createToolBar(), BorderLayout.NORTH);
5
		all.add(createToolBar(), BorderLayout.NORTH);
6
		JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
6
		JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
7
		treePanel = createTreePanel();
7
		treePanel = createTreePanel();
8
		treeAndMain.setLeftComponent(treePanel);
8
		treeAndMain.setLeftComponent(treePanel);
9
		mainPanel = createMainPanel();
9
		mainPanel = createMainPanel();
10
		treeAndMain.setRightComponent(mainPanel);
10
		treeAndMain.setRightComponent(mainPanel);
11
		treeAndMain.setResizeWeight(.2);
11
		treeAndMain.setResizeWeight(.2);
12
		treeAndMain.setContinuousLayout(true);
12
		treeAndMain.setContinuousLayout(true);
13
		all.add(treeAndMain, BorderLayout.CENTER);
13
		all.add(treeAndMain, BorderLayout.CENTER);
14
		getContentPane().add(all);
14
		getContentPane().add(all);
15
		tree.setSelectionRow(1);
15
		tree.setSelectionRow(1);
16
		addWindowListener(new WindowHappenings());
16
		addWindowListener(new WindowHappenings());
17
		
18
		setTitle(DEFAULT_TITLE);
17
		setTitle(DEFAULT_TITLE);
19
		setIconImage(JMeterUtils.getImage("jmeter.jpg").getImage());// $NON-NLS-1$
18
		setIconImage(JMeterUtils.getImage("jmeter.jpg").getImage());// $NON-NLS-1$
20
	}
19
    }
21
	public void setExtendedFrameTitle(String fname) {
20
	public void setExtendedFrameTitle(String fname) {
22
		// file New operation may set to null, so just return app name
21
		// file New operation may set to null, so just return app name
23
		if (fname == null) {
22
		if (fname == null) {
24
			setTitle(DEFAULT_TITLE);
23
			setTitle(DEFAULT_TITLE);
25
			return;
24
			return;
26
		}
25
		}
27
		// allow for windows / chars in filename
26
		// allow for windows / chars in filename
28
		String temp = fname.replace('\\', '/'); // $NON-NLS-1$ // $NON-NLS-2$
27
		String temp = fname.replace('\\', '/'); // $NON-NLS-1$ // $NON-NLS-2$
29
		String simpleName = temp.substring(temp.lastIndexOf("/") + 1);// $NON-NLS-1$
28
		String simpleName = temp.substring(temp.lastIndexOf("/") + 1);// $NON-NLS-1$
30
		setTitle(simpleName + " (" + fname + ") - " + DEFAULT_TITLE); // $NON-NLS-1$ // $NON-NLS-2$
29
		setTitle(simpleName + " (" + fname + ") - " + DEFAULT_TITLE); // $NON-NLS-1$ // $NON-NLS-2$
31
	}
30
	}
32
	/**
31
	/**
33
	 * Create the JMeter tool bar pane containing the running indicator.
32
     * Create the JMeter tool bar pane containing the running indicator.
34
	 * 
33
     * 
35
	 * @return a panel containing the running indicator
34
     * @return a panel containing the running indicator
36
	 */
35
     */
37
	private Component createToolBar() {
36
    protected Component createToolBar() {
38
		Box toolPanel = new Box(BoxLayout.X_AXIS);
37
        Box toolPanel = new Box(BoxLayout.X_AXIS);
39
		toolPanel.add(Box.createRigidArea(new Dimension(10, 15)));
38
        toolPanel.add(Box.createRigidArea(new Dimension(10, 15)));
40
		toolPanel.add(Box.createGlue());
39
        toolPanel.add(Box.createGlue());
41
        toolPanel.add(activeThreads);
40
        toolPanel.add(runningIndicator);
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