if (bshInterpreter == null) { log.error("BeanShell not found"); return; } JMeterContext jmctx = JMeterContextService.getContext(); JMeterVariables vars = jmctx.getVariables();
if (bshInterpreter == null) { log.error("BeanShell not found"); return; } JMeterContext jmctx = JMeterContextService.getContext(); JMeterVariables vars = jmctx.getVariables();
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/BeanShellListener.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/modifiers/BeanShellPreProcessor.java
Method name: void sampleOccurred(SampleEvent) Method name: void process()
Number of AST nodes: 5 Number of AST nodes: 5
1
if (bshInterpreter == null) {
1
if (bshInterpreter == null) {
2
            log.error("BeanShell not found");
2
        	log.error("BeanShell not found");
3
            return;
3
        	return;
4
        }
4
        }
5
        
6
        JMeterContext jmctx = JMeterContextService.getContext();
5
        JMeterContext jmctx = JMeterContextService.getContext();
7
        JMeterVariables vars = jmctx.getVariables();
6
        JMeterVariables vars = jmctx.getVariables();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    2
    if (bshInterpreter == null)
    2
    if (bshInterpreter == null)
    3
    log.error("BeanShell not found");
    3
    log.error("BeanShell not found");
    4
    return;
    4
    return;
    4
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    4
    return;
    5
    JMeterContext jmctx = JMeterContextService.getContext();
    5
    JMeterContext jmctx = JMeterContextService.getContext();
    6
    JMeterVariables vars = jmctx.getVariables();
    6
    JMeterVariables vars = jmctx.getVariables();
    Precondition Violations (3)
    Row Violation
    1Conditional return;
    2Conditional return;
    3Clone fragment #1 returns variables jmctx, vars , while Clone fragment #2 returns variables jmctx, vars