if (categories.contains(TIMERS)) { timers.add(new MenuInfo(item.getStaticLabel(), name)); } 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(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)); }
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/MenuFactory.java
Method name: void initializeMenus() Method name: void initializeMenus()
Number of AST nodes: 10 Number of AST nodes: 10
1
if (categories.contains(TIMERS)) {
1
if (categories.contains(SAMPLERS)) {
2
					timers.add(new MenuInfo(item.getStaticLabel(), name));
2
					samplers.add(new MenuInfo(item.getStaticLabel(), name));
3
				}
3
				}
4
				if (categories.contains(POST_PROCESSORS)) {
4
				if (categories.contains(
5
					postProcessor
5
NON_TEST_ELEMENTS)) {
6
s.add(new MenuInfo(item.getStaticLabel(), name));
6
					nonTestElements.add(new MenuInfo(item.getStaticLabel(), name));
7
				}
7
				}
8
				if (categories.contains(PRE_PROCESSORS)) {
8
				if (categories.contains(LISTENERS)) {
9
					preProcessors.add(new MenuInfo(item.getStaticLabel(), name));
9
					listeners.add(new MenuInfo(item.getStaticLabel(), name));
10
				}
10
				}
11
				if (categories.contains(CONTROLLERS)) {
11
				if (categories.contains(CONFIG_ELEMENTS)) {
12
					controllers.add(new MenuInfo(item.getStaticLabel(), name));
12
					configElements.add(new MenuInfo(item.getStaticLabel(), name));
13
				}
13
				}
14
				if (categories.contains(SAMPLERS)) {
14
				if (categories.contains(ASSERTIONS)) {
15
					samplers.add(new MenuInfo(item.getStaticLabel(), name));
15
					assertions.add(new MenuInfo(item.getStaticLabel(), name));
16
				}
16
				}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)1.7
Clones locationClones are in the same method
Number of node comparisons71
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)14.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    41
    if (categories.contains(TIMERS))
    41
    if (categories.contains(TIMERS))
    49
    if (categories.contains(SAMPLERS))
    Differences
    Expression1Expression2Difference
    TIMERSSAMPLERSVARIABLE_NAME_MISMATCH
    49
    if (categories.contains(SAMPLERS))
    42
    timers.add(new MenuInfo(item.getStaticLabel(), name));
    42
    timers.add(new MenuInfo(item.getStaticLabel(), name));
    50
    samplers.add(new MenuInfo(item.getStaticLabel(), name));
    Differences
    Expression1Expression2Difference
    timerssamplersVARIABLE_NAME_MISMATCH
    50
    samplers.add(new MenuInfo(item.getStaticLabel(), name));
    43
    if (categories.contains(POST_PROCESSORS))
    43
    if (categories.contains(POST_PROCESSORS))
    51
    if (categories.contains(NON_TEST_ELEMENTS))
    Differences
    Expression1Expression2Difference
    POST_PROCESSORSNON_TEST_ELEMENTSVARIABLE_NAME_MISMATCH
    51
    if (categories.contains(NON_TEST_ELEMENTS))
    44
    postProcessors.add(new MenuInfo(item.getStaticLabel(), name));
    44
    postProcessors.add(new MenuInfo(item.getStaticLabel(), name));
    52
    nonTestElements.add(new MenuInfo(item.getStaticLabel(), name));
    Differences
    Expression1Expression2Difference
    postProcessorsnonTestElementsVARIABLE_NAME_MISMATCH
    52
    nonTestElements.add(new MenuInfo(item.getStaticLabel(), name));
    45
    if (categories.contains(PRE_PROCESSORS))
    45
    if (categories.contains(PRE_PROCESSORS))
    53
    if (categories.contains(LISTENERS))
    Differences
    Expression1Expression2Difference
    PRE_PROCESSORSLISTENERSVARIABLE_NAME_MISMATCH
    53
    if (categories.contains(LISTENERS))
    46
    preProcessors.add(new MenuInfo(item.getStaticLabel(), name));
    46
    preProcessors.add(new MenuInfo(item.getStaticLabel(), name));
    54
    listeners.add(new MenuInfo(item.getStaticLabel(), name));
    Differences
    Expression1Expression2Difference
    preProcessorslistenersVARIABLE_NAME_MISMATCH
    54
    listeners.add(new MenuInfo(item.getStaticLabel(), name));
    47
    if (categories.contains(CONTROLLERS))
    47
    if (categories.contains(CONTROLLERS))
    55
    if (categories.contains(CONFIG_ELEMENTS))
    Differences
    Expression1Expression2Difference
    CONTROLLERSCONFIG_ELEMENTSVARIABLE_NAME_MISMATCH
    55
    if (categories.contains(CONFIG_ELEMENTS))
    48
    controllers.add(new MenuInfo(item.getStaticLabel(), name));
    48
    controllers.add(new MenuInfo(item.getStaticLabel(), name));
    56
    configElements.add(new MenuInfo(item.getStaticLabel(), name));
    Differences
    Expression1Expression2Difference
    controllersconfigElementsVARIABLE_NAME_MISMATCH
    56
    configElements.add(new MenuInfo(item.getStaticLabel(), name));
    49
    if (categories.contains(SAMPLERS))
    49
    if (categories.contains(SAMPLERS))
    57
    if (categories.contains(ASSERTIONS))
    Differences
    Expression1Expression2Difference
    SAMPLERSASSERTIONSVARIABLE_NAME_MISMATCH
    57
    if (categories.contains(ASSERTIONS))
    50
    samplers.add(new MenuInfo(item.getStaticLabel(), name));
    50
    samplers.add(new MenuInfo(item.getStaticLabel(), name));
    58
    assertions.add(new MenuInfo(item.getStaticLabel(), name));
    Differences
    Expression1Expression2Difference
    samplersassertionsVARIABLE_NAME_MISMATCH
    58
    assertions.add(new MenuInfo(item.getStaticLabel(), name));
    Precondition Violations (0)
    Row Violation