try { // Add variables for access to context and variables bshInterpreter.set("ctx", jmctx);//$NON-NLS-1$ bshInterpreter.set("vars", vars);//$NON-NLS-1$ bshInterpreter.set("prev", prev);//$NON-NLS-1$ bshInterpreter.set("data", prev.getResponseData());//$NON-NLS-1$ processFileOrScript(bshInterpreter); } catch (JMeterException e) { log.warn("Problem in BeanShell script "+e); }
try { // Add variables for access to context and variables bshInterpreter.set("ctx", jmctx);//$NON-NLS-1$ bshInterpreter.set("vars", vars);//$NON-NLS-1$ bshInterpreter.set("sampler", sam);//$NON-NLS-1$ bshInterpreter.set("prev", prev);//$NON-NLS-1$ processFileOrScript(bshInterpreter); } catch (JMeterException e) { log.warn("Problem in BeanShell script "+e); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/extractor/BeanShellPostProcessor.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/modifiers/BeanShellPreProcessor.java
Method name: void process() Method name: void process()
Number of AST nodes: 6 Number of AST nodes: 6
1
try {
1
try {
2
            // Add variables for access to context and variables
2
            // Add variables for access to context and variables
3
            bshInterpreter.set("ctx", jmctx);//$NON-NLS-1$
3
            bshInterpreter.set("ctx", jmctx);//$NON-NLS-1$
4
            bshInterpreter.set("vars", vars);//$NON-NLS-1$
4
            bshInterpreter.set("vars", vars);//$NON-NLS-1$
5
            bshInterpreter.set("prev", prev);//$NON-NLS-1$
5
            bshInterpreter.set("sampler", sam);//$NON-NLS-1$
6
            bshInterpreter.set("data", prev.getResponseData());//$NON-NLS-1$
6
            bshInterpreter.set("prev", prev);//$NON-NLS-1$
7
            
7
            processFileOrScript(bshInterpreter);
8
            processFileOrScript(bshInterpreter);
8
        } catch (JMeterException e) {
9
        } catch (JMeterException e) {
9
            log.warn("Problem in BeanShell script "+e);
10
            log.warn("Problem in BeanShell script "+e);
10
        }
11
        }
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    try
    9
    try
    9
    bshInterpreter.set("ctx", jmctx);
    10
    bshInterpreter.set("ctx", jmctx);
    10
    bshInterpreter.set("vars", vars);
    11
    bshInterpreter.set("vars", vars);
                                                                                
    12
    bshInterpreter.set("sampler", sam);
    Preondition Violations
    Unmatched statement bshInterpreter.set("sampler",sam); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    12
    bshInterpreter.set("sampler", sam);
    11
    bshInterpreter.set("prev", prev);
    13
    bshInterpreter.set("prev", prev);
    12
    bshInterpreter.set("data", prev.getResponseData());
    12
    bshInterpreter.set("data", prev.getResponseData());
    Preondition Violations
    Unmatched statement bshInterpreter.set("data",prev.getResponseData()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                
    13
    processFileOrScript(bshInterpreter);
    14
    processFileOrScript(bshInterpreter);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement bshInterpreter.set("sampler",sam); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2Unmatched statement bshInterpreter.set("data",prev.getResponseData()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted