String[] sTestCmdLine = {"soscmd", "-command", "GetFile", "-file", SRC_FILE, "-revision", "007", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache", "-workdir", project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH}; // Set up a SOSGet task SOSGet sosGet = new SOSGet(); sosGet.setProject(project); sosGet.setVssServerPath(VSS_SERVER_PATH); sosGet.setSosServerPath(SOS_SERVER_PATH); sosGet.setProjectPath(VSS_PROJECT_PATH); sosGet.setFile(SRC_FILE); sosGet.setUsername(SOS_USERNAME); sosGet.setPassword(SOS_PASSWORD); sosGet.setVersion(VERSION); sosGet.setLocalPath(new Path(project, LOCAL_PATH)); sosGet.setNoCache(true); sosGet.setNoCompress(true); sosGet.setVerbose(true); sosGet.setRecursive(true); commandline = sosGet.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline());
String[] sTestCmdLine = {"soscmd", "-command", "CheckOutFile", "-file", SRC_FILE, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache", "-workdir", project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH}; // Set up a SOSCheckout task SOSCheckout sosCheckout = new SOSCheckout(); sosCheckout.setProject(project); sosCheckout.setVssServerPath(VSS_SERVER_PATH); sosCheckout.setSosServerPath(SOS_SERVER_PATH); sosCheckout.setProjectPath(DS_VSS_PROJECT_PATH); sosCheckout.setFile(SRC_FILE); sosCheckout.setUsername(SOS_USERNAME); sosCheckout.setPassword(SOS_PASSWORD); sosCheckout.setLocalPath(new Path(project, LOCAL_PATH)); sosCheckout.setNoCache(true); sosCheckout.setNoCompress(true); sosCheckout.setVerbose(true); sosCheckout.setRecursive(true); commandline = sosCheckout.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/sos/SOSTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/sos/SOSTest.java
Method name: void testGetFileFlags() Method name: void testCheckoutFileFlags()
Number of AST nodes: 17 Number of AST nodes: 16
1
String[] sTestCmdLine = {"soscmd", "-command", "GetFile", "-file",
1
String[] sTestCmdLine = {"soscmd", "-command", "CheckOutFile", "-file",
2
                SRC_FILE, "-revision", "007", "-server", SOS_SERVER_PATH, "-name",
2
                SRC_FILE, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME,
3
                SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH,
3
                "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH,
4
 
4
 "-project",
5
               "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress",
5
                DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache",
6
                "-nocache", "-workdir", project.getBaseDir().getAbsolutePath()
6
                "-workdir", project.getBaseDir().getAbsolutePath()
7
                 + File.separator + LOCAL_PATH};
7
                 + File.separator + LOCAL_PATH};
8
        // Set up a SOSGet task
8
        // Set up a SOSCheckout task
9
        SOSGet sosGet = new SOSGet();
9
        SOSCheckout sosCheckout = new SOSCheckout();
10
        sosGet.setProject(project);
10
        sosCheckout.setProject(project);
11
        sosGet.setVssServerPath(VSS_SERVER_PATH);
11
        sosCheckout.setVssServerPath(VSS_SERVER_PATH);
12
        sosGet.setSosServerPath(SOS_SERVER_PATH);
12
        sosCheckout.setSosServerPath(SOS_SERVER_PATH);
13
        sosGet.setProjectPath(VSS_PROJECT_PATH);
13
        sosCheckout.setProjectPath(DS_VSS_PROJECT_PATH);
14
        sosGet.setFile(SRC_FILE);
14
        sosCheckout.setFile(SRC_FILE);
15
        sosGet.setUsername(SOS_USERNAME);
15
        sosCheckout.setUsername(SOS_USERNAME);
16
        sosGet.setPassword(SOS_PASSWORD);
16
        sosCheckout.setPassword(SOS_PASSWORD);
17
        sosGet.setVersion(VERSION);
17
        sos
18
        sosGet.setLocalPath(new Path(project, LOCAL_PATH));
18
Checkout.setLocalPath(new Path(project, LOCAL_PATH));
19
        sosGet.setNoCache(true);
19
        sosCheckout.setNoCache(true);
20
        sosGet.setNoCompress(true);
20
        sosCheckout.setNoCompress(true);
21
        sosGet.setVerbose(true);
21
        sosCheckout.setVerbose(true);
22
        sosGet.setRecursive(true);
22
        sosCheckout.setRecursive(true);
23
        commandline = sosGet.buildCmdLine();
23
        commandline = sosCheckout.buildCmdLine();
24
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
24
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
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 declared in the same class
Number of node comparisons216
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    1
    String[] sTestCmdLine = {"soscmd", "-command", "CheckOutFile", "-file", SRC_FILE, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache", "-workdir", project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH};
    1
    String[] sTestCmdLine = {"soscmd", "-command", "GetFile", "-file", SRC_FILE, "-revision", "007", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache", "-workdir", project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH};
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    2
    SOSGet sosGet = new SOSGet();
    2
    SOSGet sosGet = new SOSGet();
    2
    SOSCheckout sosCheckout = new SOSCheckout();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    2
    SOSCheckout sosCheckout = new SOSCheckout();
    3
    sosGet.setProject(project);
    3
    sosGet.setProject(project);
    3
    sosCheckout.setProject(project);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    3
    sosCheckout.setProject(project);
    4
    sosGet.setVssServerPath(VSS_SERVER_PATH);
    4
    sosGet.setVssServerPath(VSS_SERVER_PATH);
    4
    sosCheckout.setVssServerPath(VSS_SERVER_PATH);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    4
    sosCheckout.setVssServerPath(VSS_SERVER_PATH);
    5
    sosGet.setSosServerPath(SOS_SERVER_PATH);
    5
    sosGet.setSosServerPath(SOS_SERVER_PATH);
    5
    sosCheckout.setSosServerPath(SOS_SERVER_PATH);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    5
    sosCheckout.setSosServerPath(SOS_SERVER_PATH);
    6
    sosGet.setProjectPath(VSS_PROJECT_PATH);
    6
    sosGet.setProjectPath(VSS_PROJECT_PATH);
    6
    sosCheckout.setProjectPath(DS_VSS_PROJECT_PATH);
    Differences
    Expression1Expression2Difference
    VSS_PROJECT_PATHDS_VSS_PROJECT_PATHVARIABLE_NAME_MISMATCH
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    6
    sosCheckout.setProjectPath(DS_VSS_PROJECT_PATH);
    7
    sosGet.setFile(SRC_FILE);
    7
    sosGet.setFile(SRC_FILE);
    7
    sosCheckout.setFile(SRC_FILE);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sosGet cannot be unified with expression sosCheckout , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public final void setFile(java.lang.String)
    7
    sosCheckout.setFile(SRC_FILE);
    8
    sosGet.setUsername(SOS_USERNAME);
    8
    sosGet.setUsername(SOS_USERNAME);
    8
    sosCheckout.setUsername(SOS_USERNAME);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    8
    sosCheckout.setUsername(SOS_USERNAME);
    9
    sosGet.setPassword(SOS_PASSWORD);
    9
    sosGet.setPassword(SOS_PASSWORD);
    9
    sosCheckout.setPassword(SOS_PASSWORD);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    9
    sosCheckout.setPassword(SOS_PASSWORD);
    10
    sosGet.setVersion(VERSION);
                                                                  
    11
    sosGet.setLocalPath(new Path(project, LOCAL_PATH));
    11
    sosGet.setLocalPath(new Path(project, LOCAL_PATH));
    10
    sosCheckout.setLocalPath(new Path(project, LOCAL_PATH));
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    10
    sosCheckout.setLocalPath(new Path(project, LOCAL_PATH));
    12
    sosGet.setNoCache(true);
    12
    sosGet.setNoCache(true);
    11
    sosCheckout.setNoCache(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    11
    sosCheckout.setNoCache(true);
    13
    sosGet.setNoCompress(true);
    13
    sosGet.setNoCompress(true);
    12
    sosCheckout.setNoCompress(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    12
    sosCheckout.setNoCompress(true);
    14
    sosGet.setVerbose(true);
    14
    sosGet.setVerbose(true);
    13
    sosCheckout.setVerbose(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    13
    sosCheckout.setVerbose(true);
    15
    sosGet.setRecursive(true);
    15
    sosGet.setRecursive(true);
    14
    sosCheckout.setRecursive(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sosGet cannot be unified with expression sosCheckout , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public void setRecursive(boolean)
    14
    sosCheckout.setRecursive(true);
    16
    commandline = sosGet.buildCmdLine();
    16
    commandline = sosGet.buildCmdLine();
    15
    commandline = sosCheckout.buildCmdLine();
    Differences
    Expression1Expression2Difference
    sosGetsosCheckoutVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutSUBCLASS_TYPE_MISMATCH
    15
    commandline = sosCheckout.buildCmdLine();
    17
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    16
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    Precondition Violations (3)
    Row Violation
    1Expression sosGet cannot be unified with expression sosCheckout , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public final void setFile(java.lang.String)
    2Expression sosGet cannot be unified with expression sosCheckout , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public void setRecursive(boolean)
    3Clone fragment #1 returns variables sosGet , while Clone fragment #2 returns variables