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/modifiers/BeanShellPreProcessor.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/BeanShellListener.java
|
Method name: void process()
|
|
Method name: void sampleOccurred(SampleEvent)
|
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 | ↵
|
5 | JMeterContext jmctx = JMeterContextService.getContext();↵ | | 6 | JMeterContext jmctx = JMeterContextService.getContext();↵
|
6 | JMeterVariables vars = jmctx.getVariables(); | | 7 | JMeterVariables vars = jmctx.getVariables();
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 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 | | | 4 | |
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 |
1 | Conditional return; |
2 | Conditional return; |
3 | Clone fragment #1 returns variables jmctx, vars , while Clone fragment #2 returns variables jmctx, vars |