params.add(new CompoundVariable("1+2+3"));
function.setParameters(params);
String ret = function.execute(result, null);
assertEquals("6", ret);
params.add(new CompoundVariable(
"sampleResult.getResponseDataAsString().replaceAll('T','t')"));
function.setParameters(params);
String ret = function.execute(result, null);
assertEquals("the quick brown fox", ret);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestJexlFunction.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestJexlFunction.java
|
Method name: void testSum()
|
|
Method name: void testReplace1()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | params.add(new CompoundVariable("1+2+3↵ | | 1 | params.add(new CompoundVariable(↵
|
2 | "));↵ | | 2 | "sampleResult.getResponseDataAsString().replaceAll('T','t')"));↵
|
3 | function.setParameters(params);↵ | | 3 | function.setParameters(params);↵
|
4 | String ret = function.execute(result, null);↵ | | 4 | String ret = function.execute(result, null);↵
|
5 | assertEquals("6", ret); | | 5 | assertEquals("the quick brown fox", ret);
|
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | params.add(new CompoundVariable("1+2+3")); | | 1 | params.add(new CompoundVariable("sampleResult.getResponseDataAsString().replaceAll('T','t')")); |
2 | function.setParameters(params); | | 2 | function.setParameters(params); |
3 | String ret = function.execute(result, null); | | 3 | String ret = function.execute(result, null); |
4 | assertEquals("6", ret); | | 4 | assertEquals("the quick brown fox", ret); |
Precondition Violations (0)
Row |
Violation |