if (loggerClassname != null) { throw new BuildException("Only one logger class may " + " be specified."); } try { loggerClassname = args[++i]; } catch (ArrayIndexOutOfBoundsException aioobe) { throw new BuildException("You must specify a classname when" + " using the -logger argument"); }
if (inputHandlerClassname != null) { throw new BuildException("Only one input handler class may " + "be specified."); } try { inputHandlerClassname = args[++i]; } catch (ArrayIndexOutOfBoundsException aioobe) { throw new BuildException("You must specify a classname when" + " using the -inputhandler" + " argument"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java
Method name: void processArgs(String[]) Method name: void processArgs(String[])
Number of AST nodes: 4 Number of AST nodes: 4
1
if (loggerClassname != null) {
1
if (inputHandlerClassname != null) {
2
                    throw new BuildException("Only one logger class may "
2
                    throw new BuildException("Only one input handler class may "
3
                        + " be specified.");
3
                                             + "be specified.");
4
                }
4
                }
5
                try {
5
                try {
6
                    loggerClassname = args[++i];
6
                    inputHandlerClassname = args[++i];
7
                } catch (ArrayIndexOutOfBoundsException aioobe) {
7
                } catch (ArrayIndexOutOfBoundsException aioobe) {
8
                    throw new BuildException("You must specify a classname when"
8
                    throw new BuildException("You must specify a classname when"
9
                                             + " using the -logger
9
                                             + " using the -inputhandler"
10
 argument");
10
                                             + " argument");
11
                }
11
                }
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.4
Clones locationClones are in the same method
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    58
    if (loggerClassname != null)
    58
    if (loggerClassname != null)
    63
    if (inputHandlerClassname != null)
    Differences
    Expression1Expression2Difference
    loggerClassnameinputHandlerClassnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression loggerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression inputHandlerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    63
    if (inputHandlerClassname != null)
    59
    throw new BuildException("Only one logger class may " + " be specified.");
    59
    throw new BuildException("Only one logger class may " + " be specified.");
    64
    throw new BuildException("Only one input handler class may " + "be specified.");
    Differences
    Expression1Expression2Difference
    "Only one logger class may ""Only one input handler class may "LITERAL_VALUE_MISMATCH
    " be specified.""be specified."LITERAL_VALUE_MISMATCH
    64
    throw new BuildException("Only one input handler class may " + "be specified.");
    60
    try
    60
    try
    65
    try
    Differences
    Expression1Expression2Difference
    " using the -logger argument"" using the -inputhandler"LITERAL_VALUE_MISMATCH
    "You must specify a classname when" + " using the -logger argument""You must specify a classname when" + " using the -inputhandler" + " argument"INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    65
    try
    61
    loggerClassname = args[++i];
    61
    loggerClassname = args[++i];
    66
    inputHandlerClassname = args[++i];
    Differences
    Expression1Expression2Difference
    loggerClassnameinputHandlerClassnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression loggerClassname is a field being modified, and thus it cannot be parameterized
    Expression inputHandlerClassname is a field being modified, and thus it cannot be parameterized
    66
    inputHandlerClassname = args[++i];
    Precondition Violations (4)
    Row Violation
    1Expression loggerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression inputHandlerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression loggerClassname is a field being modified, and thus it cannot be parameterized
    4Expression inputHandlerClassname is a field being modified, and thus it cannot be parameterized