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"); }
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"); }
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 (inputHandlerClassname != null) {
1
if (loggerClassname != null) {
2
                    throw new BuildException("Only one input handler class may "
2
                    throw new BuildException("Only one logger class may "
3
                                             + "be specified.");
3
                        + " be specified.");
4
                }
4
                }
5
                try {
5
                try {
6
                    inputHandlerClassname = args[++i];
6
                    loggerClassname = 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 -inputhandler"
9
                                             + " using the -
10
                                             + " argument");
10
logger 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.5
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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    63
    if (inputHandlerClassname != null)
    63
    if (inputHandlerClassname != null)
    58
    if (loggerClassname != null)
    Differences
    Expression1Expression2Difference
    inputHandlerClassnameloggerClassnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression inputHandlerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression loggerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    58
    if (loggerClassname != null)
    64
    throw new BuildException("Only one input handler class may " + "be specified.");
    64
    throw new BuildException("Only one input handler class may " + "be specified.");
    59
    throw new BuildException("Only one logger class may " + " be specified.");
    Differences
    Expression1Expression2Difference
    "Only one input handler class may ""Only one logger class may "LITERAL_VALUE_MISMATCH
    "be specified."" be specified."LITERAL_VALUE_MISMATCH
    59
    throw new BuildException("Only one logger class may " + " be specified.");
    65
    try
    65
    try
    60
    try
    Differences
    Expression1Expression2Difference
    " using the -inputhandler"" using the -logger argument"LITERAL_VALUE_MISMATCH
    "You must specify a classname when" + " using the -inputhandler" + " argument""You must specify a classname when" + " using the -logger argument"INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    60
    try
    66
    inputHandlerClassname = args[++i];
    66
    inputHandlerClassname = args[++i];
    61
    loggerClassname = args[++i];
    Differences
    Expression1Expression2Difference
    inputHandlerClassnameloggerClassnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression inputHandlerClassname is a field being modified, and thus it cannot be parameterized
    Expression loggerClassname is a field being modified, and thus it cannot be parameterized
    61
    loggerClassname = args[++i];
    Precondition Violations (4)
    Row Violation
    1Expression inputHandlerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression loggerClassname cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression inputHandlerClassname is a field being modified, and thus it cannot be parameterized
    4Expression loggerClassname is a field being modified, and thus it cannot be parameterized