if (memoryInitialSize != null) { if (!attributes.isForkedJavac()) { attributes.log("Since fork is false, ignoring " + "memoryInitialSize setting.", Project.MSG_WARN); } else { cmd.createArgument().setValue(memoryParameterPrefix + "ms" + memoryInitialSize); } }
if (memoryMaximumSize != null) { if (!attributes.isForkedJavac()) { attributes.log("Since fork is false, ignoring " + "memoryMaximumSize setting.", Project.MSG_WARN); } else { cmd.createArgument().setValue(memoryParameterPrefix + "mx" + memoryMaximumSize); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Method name: Commandline setupJavacCommandlineSwitches(Commandline, boolean) Method name: Commandline setupJavacCommandlineSwitches(Commandline, boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (memoryInitialSize != null) {
1
if (memoryMaximumSize != null) {
2
            if (!attributes.isForkedJavac()) {
2
            if (!attributes.isForkedJavac()) {
3
                attributes.log("Since fork is false, ignoring "
3
                attributes.log("Since fork is false, ignoring "
4
                               + "memoryInitialSize setting.",
4
                               + "memoryMaximumSize setting.",
5
                               Project.MSG_WARN);
5
                               Project.MSG_WARN);
6
            } else {
6
            } else {
7
                cmd.createArgument().setValue(memoryParameterPrefix
7
                cmd.createArgument().setValue(memoryParameterPrefix
8
                                              + "ms" + memoryInitialSize);
8
                                              + "mx" + memoryMaximumSize);
9
            }
9
            }
10
        }
10
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in the same method
Number of node comparisons10
  1. {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)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    if (memoryInitialSize != null)
    7
    if (memoryInitialSize != null)
    11
    if (memoryMaximumSize != null)
    Differences
    Expression1Expression2Difference
    memoryInitialSizememoryMaximumSizeVARIABLE_NAME_MISMATCH
    11
    if (memoryMaximumSize != null)
    8
    if (!attributes.isForkedJavac())
    12
    if (!attributes.isForkedJavac())
    9
    attributes.log("Since fork is false, ignoring " + "memoryInitialSize setting.", Project.MSG_WARN);
    9
    attributes.log("Since fork is false, ignoring " + "memoryInitialSize setting.", Project.MSG_WARN);
    13
    attributes.log("Since fork is false, ignoring " + "memoryMaximumSize setting.", Project.MSG_WARN);
    Differences
    Expression1Expression2Difference
    "memoryInitialSize setting.""memoryMaximumSize setting."LITERAL_VALUE_MISMATCH
    13
    attributes.log("Since fork is false, ignoring " + "memoryMaximumSize setting.", Project.MSG_WARN);
    else
    else
    10
    cmd.createArgument().setValue(memoryParameterPrefix + "ms" + memoryInitialSize);
    10
    cmd.createArgument().setValue(memoryParameterPrefix + "ms" + memoryInitialSize);
    14
    cmd.createArgument().setValue(memoryParameterPrefix + "mx" + memoryMaximumSize);
    Differences
    Expression1Expression2Difference
    memoryInitialSizememoryMaximumSizeVARIABLE_NAME_MISMATCH
    "ms""mx"LITERAL_VALUE_MISMATCH
    14
    cmd.createArgument().setValue(memoryParameterPrefix + "mx" + memoryMaximumSize);
    Precondition Violations (0)
    Row Violation