final CLOptionDescriptor[] options = { test };
final CLArgsParser parser = new CLArgsParser(args, options);
assertNull(parser.getErrorString(), parser.getErrorString());
final CLOption optionByID = parser.getArgumentById('n');
assertNotNull(optionByID);
assertEquals('n', optionByID.getDescriptor().getId());
final CLOptionDescriptor[] options = { test };
final CLArgsParser parser = new CLArgsParser(args, options);
assertNull(parser.getErrorString(), parser.getErrorString());
final CLOption optionByID = parser.getArgumentById('n');
assertNotNull(optionByID);
assertEquals('n', optionByID.getDescriptor().getId());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java
|
|
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java
|
Method name: void testNullLongForm()
|
|
Method name: void testNullDescription()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | final CLOptionDescriptor[] options = { test };↵ | | 1 | final CLOptionDescriptor[] options = { test };↵
|
2 | final CLArgsParser parser = new CLArgsParser(args, options);↵ | | 2 | final CLArgsParser parser = new CLArgsParser(args, options);↵
|
|
3 | assertNull(parser.getErrorString(), parser.getErrorString());↵ | | 3 | assertNull(parser.getErrorString(), parser.getErrorString());↵
|
|
4 | final CLOption optionByID = parser.getArgumentById('n');↵ | | 4 | final CLOption optionByID = parser.getArgumentById('n');↵
|
5 | assertNotNull(optionByID);↵ | | 5 | assertNotNull(optionByID);↵
|
6 | assertEquals('n', optionByID.getDescriptor().getId()); | | 6 | assertEquals('n', optionByID.getDescriptor().getId());
|
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | final CLOptionDescriptor[] options = {test}; | | 3 | final CLOptionDescriptor[] options = {test}; |
4 | final CLArgsParser parser = new CLArgsParser(args, options); | | 4 | final CLArgsParser parser = new CLArgsParser(args, options); |
5 | assertNull(parser.getErrorString(), parser.getErrorString()); | | 5 | assertNull(parser.getErrorString(), parser.getErrorString()); |
6 | final CLOption optionByID = parser.getArgumentById('n'); | | 6 | final CLOption optionByID = parser.getArgumentById('n'); |
7 | assertNotNull(optionByID); | | 7 | assertNotNull(optionByID); |
8 | assertEquals('n', optionByID.getDescriptor().getId()); | | 8 | assertEquals('n', optionByID.getDescriptor().getId()); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variable parser with type org.apache.commons.cli.avalon.CLArgsParser , while Clone fragment #2 returns variable options with type org.apache.commons.cli.avalon.CLOptionDescriptor[] |