final ParserControl control = new AbstractParserControl() { public boolean isFinished(int lastOptionCode) { return (lastOptionCode == YOU_OPT); } }; final CLArgsParser parser = new CLArgsParser(ARGLIST1, options, control); assertNull(parser.getErrorString(), parser.getErrorString()); final List clOptions = parser.getArguments();
final ParserControl control1 = new AbstractParserControl() { public boolean isFinished(final int lastOptionCode) { return (lastOptionCode == CLEAR1_OPT); } }; final CLArgsParser parser1 = new CLArgsParser(ARGLIST1, options1, control1); assertNull(parser1.getErrorString(), parser1.getErrorString()); final List clOptions1 = parser1.getArguments();
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 testPartParse() Method name: void test2PartPartialParse()
Number of AST nodes: 4 Number of AST nodes: 4
1
final ParserControl control = new AbstractParserControl() {
1
final ParserControl control1 = new AbstractParserControl() {
2
            public boolean isFinished(int lastOptionCode) {
2
            public boolean isFinished(final int lastOptionCode) {
3
                return (lastOptionCode == YOU_OPT);
3
                return (lastOptionCode == CLEAR1_OPT);
4
            }
4
            }
5
        };
5
        };
6
        final CLArgsParser parser = new CLArgsParser(ARGLIST1, options, control);
6
        final CLArgsParser parser1 = new CLArgsParser(ARGLIST1, options1, control1);
7
        assertNull(parser.getErrorString(), parser.getErrorString());
7
        assertNull(parser1.getErrorString(), parser1.getErrorString());
8
        final List clOptions = parser.getArguments();
8
        final List clOptions1 = parser1.getArguments();
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    final ParserControl control = new AbstractParserControl() {...};
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                    
    3
    final ParserControl control1 = new AbstractParserControl() {...};
    3
    final CLArgsParser parser = new CLArgsParser(ARGLIST1, options, control);
    3
    final CLArgsParser parser = new CLArgsParser(ARGLIST1, options, control);
    4
    final CLArgsParser parser1 = new CLArgsParser(ARGLIST1, options1, control1);
    Differences
    Expression1Expression2Difference
    parserparser1VARIABLE_NAME_MISMATCH
    optionsoptions1VARIABLE_NAME_MISMATCH
    controlcontrol1VARIABLE_NAME_MISMATCH
    4
    final CLArgsParser parser1 = new CLArgsParser(ARGLIST1, options1, control1);
    4
    assertNull(parser.getErrorString(), parser.getErrorString());
    4
    assertNull(parser.getErrorString(), parser.getErrorString());
    5
    assertNull(parser1.getErrorString(), parser1.getErrorString());
    Differences
    Expression1Expression2Difference
    parserparser1VARIABLE_NAME_MISMATCH
    parserparser1VARIABLE_NAME_MISMATCH
    5
    assertNull(parser1.getErrorString(), parser1.getErrorString());
    5
    final List clOptions = parser.getArguments();
    5
    final List clOptions = parser.getArguments();
    6
    final List clOptions1 = parser1.getArguments();
    Differences
    Expression1Expression2Difference
    clOptionsclOptions1VARIABLE_NAME_MISMATCH
    parserparser1VARIABLE_NAME_MISMATCH
    6
    final List clOptions1 = parser1.getArguments();
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables clOptions , while Clone fragment #2 returns variables clOptions1, parser1