Commandline cmd; attributes.log("Using gcj compiler", Project.MSG_VERBOSE); cmd = setupGCJCommand(); int firstFileName = cmd.size(); logAndAddFilesToCompile(cmd); return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
attributes.log("Using kjc compiler", Project.MSG_VERBOSE); Commandline cmd = setupKjcCommand(); cmd.setExecutable("at.dms.kjc.Main"); ExecuteJava ej = new ExecuteJava(); ej.setJavaCommand(cmd); return ej.fork(getJavac()) == 0;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Gcj.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Kjc.java
Method name: boolean execute() Method name: boolean execute()
Number of AST nodes: 6 Number of AST nodes: 6
1
Commandline cmd;
2
        attributes.log("Using gcj compiler", Project.MSG_VERBOSE);
1
attributes.log("Using kjc compiler", Project.MSG_VERBOSE);
3
        cmd = setupGCJCommand();
2
        Commandline cmd = setupKjcCommand();
4
        int firstFileName = cmd.size();
3
        
5
        logAndAddFilesToCompile
4
cmd.setExecutable("at.dms.kjc.Main");
5
        ExecuteJava ej = new ExecuteJava();
6
(cmd);
6
        ej.setJavaCommand(cmd);
7
        return
7
        return
8
            executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
8
 ej.fork(getJavac()) == 0;
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 in different classes having the same super class
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Commandline cmd;
                                          
    2
    attributes.log("Using gcj compiler", Project.MSG_VERBOSE);
    2
    attributes.log("Using gcj compiler", Project.MSG_VERBOSE);
    1
    attributes.log("Using kjc compiler", Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    "Using gcj compiler""Using kjc compiler"LITERAL_VALUE_MISMATCH
    1
    attributes.log("Using kjc compiler", Project.MSG_VERBOSE);
                                                                              
    2
    Commandline cmd = setupKjcCommand();
                                                                                    
    3
    cmd.setExecutable("at.dms.kjc.Main");
    3
    cmd = setupGCJCommand();
                                                      
                                                                            
    4
    ExecuteJava ej = new ExecuteJava();
    4
    int firstFileName = cmd.size();
                                                                    
    5
    logAndAddFilesToCompile(cmd);
    5
    logAndAddFilesToCompile(cmd);
    5
    ej.setJavaCommand(cmd);
    Differences
    Expression1Expression2Difference
    logAndAddFilesToCompilesetJavaCommandMETHOD_INVOCATION_NAME_MISMATCH
    ejMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression logAndAddFilesToCompile(cmd) is a void method call, and thus it cannot be parameterized
    Expression ej.setJavaCommand(cmd) is a void method call, and thus it cannot be parameterized
    Expression logAndAddFilesToCompile(cmd) is a void method call, and thus it cannot be parameterized
    Expression ej.setJavaCommand(cmd) is a void method call, and thus it cannot be parameterized
    5
    ej.setJavaCommand(cmd);
    6
    return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
    6
    return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
    6
    return ej.fork(getJavac()) == 0;
    Differences
    Expression1Expression2Difference
    executeExternalCompileforkMETHOD_INVOCATION_NAME_MISMATCH
    executeExternalCompile(cmd.getCommandline(),firstFileName)ej.fork(getJavac())ARGUMENT_NUMBER_MISMATCH
    ejMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression executeExternalCompile(cmd.getCommandline(),firstFileName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ej.fork(getJavac()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression executeExternalCompile(cmd.getCommandline(),firstFileName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ej.fork(getJavac()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    return ej.fork(getJavac()) == 0;
    Precondition Violations (8)
    Row Violation
    1Expression logAndAddFilesToCompile(cmd) is a void method call, and thus it cannot be parameterized
    2Expression ej.setJavaCommand(cmd) is a void method call, and thus it cannot be parameterized
    3Expression logAndAddFilesToCompile(cmd) is a void method call, and thus it cannot be parameterized
    4Expression ej.setJavaCommand(cmd) is a void method call, and thus it cannot be parameterized
    5Expression executeExternalCompile(cmd.getCommandline(),firstFileName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ej.fork(getJavac()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression executeExternalCompile(cmd.getCommandline(),firstFileName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression ej.fork(getJavac()) cannot be parameterized, because it has dependencies to/from statements that will be extracted