if (vars != null) {// May be null if function is used on TestPlan
String varName = ((CompoundVariable) values[0]).execute().trim();
if (varName.length() > 0) {
vars.put(varName, machineName);
}
}
if (values.length > 1) {
String variableName = ((CompoundVariable) values[1]).execute();
if (variableName.length() > 0) {// Allow for empty name
getVariables().put(variableName, propertyValue);
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/MachineName.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/Property.java
|
Method name: String execute(SampleResult, Sampler)
|
|
Method name: String execute(SampleResult, Sampler)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (vars != null) {// May be null if function is used on TestPlan↵ | | 1 | if (va↵
|
2 | ↵ | | 2 | lues.length > 1) {↵
|
3 | String varName = ((CompoundVariable) values[0]).execute().trim();↵ | | 3 | String variableName = ((CompoundVariable) values[1]).execute()↵
|
4 | ↵ | | 4 | ;↵
|
5 | if (varName.length() > 0) {↵ | | 5 | if (variableName.length() > 0) {↵
|
6 | vars↵ | | 6 | // Allow for empty name↵
|
7 | .put(varName, machineName);↵ | | 7 | getVariables().put(variableName, ↵
|
8 | }↵ | | |
|
9 | ↵ | | 8 | propertyValue);↵
|
| | | 9 | }↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 6 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | String varName = ((CompoundVariable)values[0]).execute().trim(); | | | |
| | | 7 | String variableName = ((CompoundVariable)values[1]).execute(); |
6 | if (varName.length() > 0) | | 8 | if (variableName.length() > 0) |
7 | vars.put(varName, machineName); | | 9 | getVariables().put(variableName, propertyValue); |
Precondition Violations (0)
Row |
Violation |