StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)</html>,$1$)}"
+ "${__regexFunction(<html>(.*o)(.*o)(.*)</html>," + "$1$$3$)}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("hello worldhellorld", newProp.getStringValue());
StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>,"
+ "$1$)}${__regexFunction(<html>(.*o)(.*o)(.*)" + "</html>,$1$$3$)}");
JMeterProperty newProp = transformer.transformValue(prop);
newProp.setRunningVersion(true);
assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());
assertEquals("hello worldhellorld", newProp.getStringValue());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/engine/util/PackageTest.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/engine/util/PackageTest.java
|
Method name: void testParseExample3()
|
|
Method name: void testNestedExample1()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)</html>,$1$)}"↵ | | 1 | StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(${my_regex})</html>,"↵
|
2 | + "${__regexFunction(<html>(.*o)(.*o)(.*)</html>," + "$1$$3$)}");↵ | | 2 | + "$1$)}${__regexFunction(<html>(.*o)(.*o)(.*)" + "</html>,$1$$3$)}");↵
|
3 | JMeterProperty newProp = transformer.transformValue(prop);↵ | | 3 | JMeterProperty newProp = transformer.transformValue(prop);↵
|
4 | newProp.setRunningVersion(true);↵ | | 4 | newProp.setRunningVersion(true);↵
|
5 | assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());↵ | | 5 | assertEquals("org.apache.jmeter.testelement.property.FunctionProperty", newProp.getClass().getName());↵
|
6 | assertEquals("hello worldhellorld", newProp.getStringValue()); | | 6 | assertEquals("hello worldhellorld", newProp.getStringValue());
|
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 | 11 |
-
{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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | StringProperty prop = new StringProperty("html", "${__regexFunction(<html>(.*)</html>,$1$)}" + "${__regexFunction(<html>(.*o)(.*o)(.*)</html>," + "$1$$3$)}"); | |