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());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 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
    1Clone 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[]