if (categories.contains(POST_PROCESSORS)) { postProcessors.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(PRE_PROCESSORS)) { preProcessors.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(CONTROLLERS)) { controllers.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(SAMPLERS)) { samplers.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(NON_TEST_ELEMENTS)) { nonTestElements.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(LISTENERS)) { listeners.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(CONFIG_ELEMENTS)) { configElements.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(ASSERTIONS)) { assertions.add(new MenuInfo(item.getStaticLabel(), name)); } } } catch (IOException e) { log.error("", e); } } private static void addSeparator(JPopupMenu menu) { MenuElement[] elements = menu.getSubElements(); if ((elements.length > 0) && !(elements[elements.length - 1] instanceof JPopupMenu.Separator)) { menu.addSeparator(); }
if (categories.contains(POST_PROCESSORS)) { postProcessors.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(PRE_PROCESSORS)) { preProcessors.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(CONTROLLERS)) { controllers.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(NON_TEST_ELEMENTS)) { nonTestElements.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(LISTENERS)) { listeners.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(CONFIG_ELEMENTS)) { configElements.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(TABLES)) { tables.add(new MenuInfo(item.getStaticLabel(), name)); } if (categories.contains(REPORT_PAGE)) { reportPage.add(new MenuInfo(item.getStaticLabel(), name)); } } } catch (Exception e) { log.error("", e); } } private static void addSeparator(JPopupMenu menu) { MenuElement[] elements = menu.getSubElements(); if ((elements.length > 0) && !(elements[elements.length - 1] instanceof JPopupMenu.Separator)) { menu.addSeparator(); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/MenuFactory.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuFactory.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (categories.contains(POST_PROCESSORS)) {
1
if (categories.contains(POST_PROCESSORS)) {
2
					postProcessors.add(new MenuInfo(item.getStaticLabel(), name));
2
					postProcessors.add(new MenuInfo(item.getStaticLabel(), name));
3
				}
3
				}
4
				if (categories.contains(PRE_PROCESSORS)) {
4
				if (categories.contains(PRE_PROCESSORS)) {
5
					preProcessors.add(new MenuInfo(item.getStaticLabel(), name));
5
					preProcessors.add(new MenuInfo(item.getStaticLabel(), name));
6
				}
6
				}
7
				if (categories.contains(CONTROLLERS)) {
7
				if (categories.contains(CONTROLLERS)) {
8
					controllers.add(new MenuInfo(item.getStaticLabel(), name));
8
					controllers.add(new MenuInfo(item.getStaticLabel(), name));
9
				}
9
				}
10
				if (categories.contains(SAMPLERS)) {
11
					samplers.add(new MenuInfo(item.getStaticLabel(), name));
12
				}
13
				if (categories.contains(NON_TEST_ELEMENTS)) {
10
				if (categories.contains(NON_TEST_ELEMENTS)) {
14
					nonTestElements.add(new MenuInfo(item.getStaticLabel(), name));
11
					nonTestElements.add(new MenuInfo(item.getStaticLabel(), name));
15
				}
12
				}
16
				if (categories.contains(LISTENERS)) {
13
				if (categories.contains(LISTENERS)) {
17
					listeners.add(new MenuInfo(item.getStaticLabel(), name));
14
					listeners.add(new MenuInfo(item.getStaticLabel(), name));
18
				}
15
				}
19
				if (categories.contains(CONFIG_ELEMENTS)) {
16
				if (categories.contains(CONFIG_ELEMENTS)) {
20
					configElements.add(new MenuInfo(item.getStaticLabel(), name));
17
					configElements.add(new MenuInfo(item.getStaticLabel(), name));
21
				}
18
				}
22
				if (categories.contains(ASSERTIONS)) {
19
				if (categories.contains(TABLES)) {
23
					assertions
20
					tables.add(new MenuInfo(item.getStaticLabel(), name));
21
				}
22
				if (categories.contains(REPORT_PAGE)) {
24
.add(new MenuInfo(item.getStaticLabel(), name));
23
					reportPage.add(new MenuInfo(item.getStaticLabel(), name));
25
				}
24
				}
26
			}
25
			}
27
		} catch (IOException e) {
26
		} catch (Exception e) {
28
            log.error("", e);
27
			log.error("", e);
29
        }
28
		}
30
	}
29
	}
31
	private static void addSeparator(JPopupMenu menu) {
30
	private static void addSeparator(JPopupMenu menu) {
32
		MenuElement[] elements = menu.getSubElements();
31
		MenuElement[] elements = menu.getSubElements();
33
		if ((elements.length > 0) && !(elements[elements.length - 1] instanceof JPopupMenu.Separator)) {
32
		if ((elements.length > 0) && !(elements[elements.length - 1] instanceof JPopupMenu.Separator)) {
34
			menu.addSeparator();
33
			menu.addSeparator();
35
		}
34
		}
36
	
35
	
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