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