/** * Create the default compiler for this platform. * @return the default compiler */ public static Compiler createDefaultCompiler() { Compiler c = new Compiler(); String compilerName; compilerName = Os.isFamily("windows") ? COMPILER_MS : COMPILER_MONO; c.setValue(compilerName); return c; }
/** * Get the attribute type-value * * @param cmd containing the command line string with or * without the type-value */ private void getTypeValueCommand(Commandline cmd) { String typevl = getTypeValue(); if (typevl != null) { if (Os.isFamily("windows")) { typevl = "\\\"" + typevl + "\\\""; // Windows quoting of the value } else { typevl = "\"" + typevl + "\""; } cmd.createArgument().setValue(typevl); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/dotnet/WsdlToDotnet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkattr.java
Method name: Compiler createDefaultCompiler() Method name: void getTypeValueCommand(Commandline)
Number of AST nodes: 1 Number of AST nodes: 3
1
/**
1
/**
2
         * Create the default compiler for this platform.
2
     * Get the attribute type-value
3
         * @return the default compiler
3
     *
4
         */
4
     * @param cmd containing the command line string with or
5
        public static Compiler createDefaultCompiler() {
5
     *        without the type-value
6
            Compiler c = new Compiler();
6
     */
7
            String compilerName;
7
    private void getTypeValueCommand(Commandline cmd) {
8
            compilerName = Os.isFamily("windows") ? COMPILER_MS : COMPILER_MONO;
8
        String typevl = getTypeValue();
9
            c.setValue(compilerName);
9
10
            return c;
10
        if (typevl != null) {
11
        }
11
            if (Os.isFamily("windows")) {
12
                typevl = "\\\"" + typevl + "\\\""; // Windows quoting of the value
13
            } else {
14
                typevl = "\"" + typevl + "\"";
15
            }
16
            cmd.createArgument().setValue(typevl);
17
        }
18
    }
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score1.000
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    compilerName = Os.isFamily("windows") ? COMPILER_MS : COMPILER_MONO;
    3
    compilerName = Os.isFamily("windows") ? COMPILER_MS : COMPILER_MONO;
    3
    if (Os.isFamily("windows"))
    Differences
    Expression1Expression2Difference
    compilerNametypevlVARIABLE_NAME_MISMATCH
    compilerNametypevlVARIABLE_NAME_MISMATCH
    COMPILER_MS"\\\"" + typevl + "\\\""TYPE_COMPATIBLE_REPLACEMENT
    COMPILER_MONO"\"" + typevl + "\""TYPE_COMPATIBLE_REPLACEMENT
    3
    if (Os.isFamily("windows"))
                                                                          
    4
    typevl = "\\\"" + typevl + "\\\"";
    Differences
    Expression1Expression2Difference
    compilerNametypevlVARIABLE_NAME_MISMATCH
    COMPILER_MS"\\\"" + typevl + "\\\""TYPE_COMPATIBLE_REPLACEMENT
    4
    typevl = "\\\"" + typevl + "\\\"";
            
    else
                                                                  
    5
    typevl = "\"" + typevl + "\"";
    Differences
    Expression1Expression2Difference
    compilerNametypevlVARIABLE_NAME_MISMATCH
    COMPILER_MONO"\"" + typevl + "\""TYPE_COMPATIBLE_REPLACEMENT
    5
    typevl = "\"" + typevl + "\"";
    Precondition Violations (0)
    Row Violation