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();
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();
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 test2PartPartialParse() Method name: void testPartParse()
Number of AST nodes: 4 Number of AST nodes: 4
1
final ParserControl control1 = new AbstractParserControl() {
1
final ParserControl control = new AbstractParserControl() {
2
            public boolean isFinished(final int lastOptionCode) {
2
            public boolean isFinished(int lastOptionCode) {
3
                return (lastOptionCode == CLEAR1_OPT);
3
                return (lastOptionCode == YOU_OPT);
4
            }
4
            }
5
        };
5
        };
6
        final CLArgsParser parser1 = new CLArgsParser(ARGLIST1, options1, control1);
6
        final CLArgsParser parser = new CLArgsParser(ARGLIST1, options, control);
7
        assertNull(parser1.getErrorString(), parser1.getErrorString());
7
        assertNull(parser.getErrorString(), parser.getErrorString());
8
        final List clOptions1 = parser1.getArguments();
8
        final List clOptions = parser.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() {...};
                                                                                                                                                                                                                                                                                                                                                    
    4
    final CLArgsParser parser1 = new CLArgsParser(ARGLIST1, options1, control1);
    4
    final CLArgsParser parser1 = new CLArgsParser(ARGLIST1, options1, control1);
    3
    final CLArgsParser parser = new CLArgsParser(ARGLIST1, options, control);
    Differences
    Expression1Expression2Difference
    parser1parserVARIABLE_NAME_MISMATCH
    options1optionsVARIABLE_NAME_MISMATCH
    control1controlVARIABLE_NAME_MISMATCH
    3
    final CLArgsParser parser = new CLArgsParser(ARGLIST1, options, control);
    5
    assertNull(parser1.getErrorString(), parser1.getErrorString());
    5
    assertNull(parser1.getErrorString(), parser1.getErrorString());
    4
    assertNull(parser.getErrorString(), parser.getErrorString());
    Differences
    Expression1Expression2Difference
    parser1parserVARIABLE_NAME_MISMATCH
    parser1parserVARIABLE_NAME_MISMATCH
    4
    assertNull(parser.getErrorString(), parser.getErrorString());
    6
    final List clOptions1 = parser1.getArguments();
    6
    final List clOptions1 = parser1.getArguments();
    5
    final List clOptions = parser.getArguments();
    Differences
    Expression1Expression2Difference
    clOptions1clOptionsVARIABLE_NAME_MISMATCH
    parser1parserVARIABLE_NAME_MISMATCH
    5
    final List clOptions = parser.getArguments();
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables clOptions1, parser1 , while Clone fragment #2 returns variables clOptions