try { Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN)); exe.setAntRun(getProject()); exe.setWorkingDirectory(getProject().getBaseDir()); exe.setCommandline(cmd.getCommandline()); exe.setVMLauncher(false); // Use the OS VM launcher so we get environment variables return exe.execute(); } catch (java.io.IOException e) { throw new BuildException(e, getLocation()); }
try { Execute exe = new Execute(handler); exe.setAntRun(getProject()); exe.setWorkingDirectory(getProject().getBaseDir()); exe.setCommandline(cmd.getCommandline()); return exe.execute(); } catch (java.io.IOException e) { throw new BuildException(e, getLocation()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java
Method name: int run(Commandline) Method name: int run(Commandline, ExecuteStreamHandler)
Number of AST nodes: 7 Number of AST nodes: 6
1
try {
1
try {
2
            Execute exe = new Execute(new LogStreamHandler(this,
2
            Execute exe = new Execute(
3
                    Project.MSG_INFO,
4
                    Project.MSG_WARN));
3
handler);
5
            exe.setAntRun(getProject());
4
            exe.setAntRun(getProject());
6
            exe.setWorkingDirectory(getProject().getBaseDir());
5
            exe.setWorkingDirectory(getProject().getBaseDir());
7
            exe.setCommandline(cmd.getCommandline());
6
            exe.setCommandline(cmd.getCommandline());
8
            exe.setVMLauncher(false);  // Use the OS VM launcher so we get environment variables
9
            return exe.execute();
7
            return exe.execute();
10
        } catch (java.io.IOException e) {
8
        } catch (java.io.IOException e) {
11
            throw new BuildException(e, getLocation());
9
            throw new BuildException(e, getLocation());
12
        }
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 different classes having the same super class
Number of node comparisons42
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
                                                                            
    2
    Execute exe = new Execute(handler);
    2
    Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN));
                                                                                                                                                                                      
    3
    exe.setAntRun(getProject());
    3
    exe.setAntRun(getProject());
    4
    exe.setWorkingDirectory(getProject().getBaseDir());
    4
    exe.setWorkingDirectory(getProject().getBaseDir());
    5
    exe.setCommandline(cmd.getCommandline());
    5
    exe.setCommandline(cmd.getCommandline());
    6
    exe.setVMLauncher(false);
                                                            
    7
    return exe.execute();
    6
    return exe.execute();
    Precondition Violations (0)
    Row Violation