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", "CheckInFile", "-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, "-log", SRC_COMMENT}; // Set up a SOSCheckin task SOSCheckin sosCheckin = new SOSCheckin(); sosCheckin.setProject(project); sosCheckin.setVssServerPath(VSS_SERVER_PATH); sosCheckin.setSosServerPath(SOS_SERVER_PATH); sosCheckin.setProjectPath(VSS_PROJECT_PATH); sosCheckin.setFile(SRC_FILE); sosCheckin.setComment(SRC_COMMENT); sosCheckin.setUsername(SOS_USERNAME); sosCheckin.setPassword(SOS_PASSWORD); sosCheckin.setLocalPath(new Path(project, LOCAL_PATH)); sosCheckin.setNoCache(true); sosCheckin.setNoCompress(true); sosCheckin.setVerbose(true); sosCheckin.setRecursive(true); commandline = sosCheckin.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 testCheckinFileFlags()
Number of AST nodes: 17 Number of AST nodes: 17
1
String[] sTestCmdLine = {"soscmd", "-command", "GetFile", "-file",
1
String[] sTestCmdLine = {"soscmd", "-command", "CheckInFile", "-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, "-project",
4
                "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress",
4
                DS_VSS_PROJECT_PATH, "-verbose", "-nocompress",
5
 
5
 "-nocache",
6
               "-nocache", "-workdir", project.getBaseDir().getAbsolutePath()
6
                "-workdir", project.getBaseDir().getAbsolutePath()
7
                 + File.separator + LOCAL_PATH
7
 + File.separator
8
};
8
                 + LOCAL_PATH, "-log", SRC_COMMENT};
9
        // Set up a SOSGet task
9
        // Set up a SOSCheckin task
10
        SOSGet sosGet = new SOSGet();
10
        SOSCheckin sosCheckin = new SOSCheckin();
11
        sosGet.setProject(project);
11
        sosCheckin.setProject(project);
12
        sosGet.setVssServerPath(VSS_SERVER_PATH);
12
        sosCheckin.setVssServerPath(VSS_SERVER_PATH);
13
        sosGet.setSosServerPath(SOS_SERVER_PATH);
13
        sosCheckin.setSosServerPath(SOS_SERVER_PATH);
14
        sosGet.setProjectPath(VSS_PROJECT_PATH);
14
        sosCheckin.setProjectPath(VSS_PROJECT_PATH);
15
        sosGet.setFile(SRC_FILE);
15
        sosCheckin.setFile(SRC_FILE);
16
        sosGet
16
        sosCheckin.setComment(SRC_COMMENT);
17
.setUsername(SOS_USERNAME);
17
        sosCheckin.setUsername(SOS_USERNAME);
18
        sosGet.setPassword(SOS_PASSWORD);
18
        sosCheckin.setPassword(SOS_PASSWORD);
19
        sosGet.setVersion(VERSION);
19
        sos
20
        sosGet.setLocalPath(new Path(project, LOCAL_PATH));
20
Checkin.setLocalPath(new Path(project, LOCAL_PATH));
21
        sosGet.setNoCache(true);
21
        sosCheckin.setNoCache(true);
22
        sosGet.setNoCompress(true);
22
        sosCheckin.setNoCompress(true);
23
        sosGet.setVerbose(true);
23
        sosCheckin.setVerbose(true);
24
        sosGet.setRecursive(true);
24
        sosCheckin.setRecursive(true);
25
        commandline = sosGet.buildCmdLine();
25
        commandline = sosCheckin.buildCmdLine();
26
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
26
        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 comparisons229
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    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
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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};
    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};
    1
    String[] sTestCmdLine = {"soscmd", "-command", "CheckInFile", "-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, "-log", SRC_COMMENT};
    Differences
    Expression1Expression2Difference
    "GetFile""CheckInFile"LITERAL_VALUE_MISMATCH
    "-revision""-server"LITERAL_VALUE_MISMATCH
    "007"SOS_SERVER_PATHTYPE_COMPATIBLE_REPLACEMENT
    "-server""-name"LITERAL_VALUE_MISMATCH
    SOS_SERVER_PATHSOS_USERNAMEVARIABLE_NAME_MISMATCH
    "-name""-password"LITERAL_VALUE_MISMATCH
    SOS_USERNAMESOS_PASSWORDVARIABLE_NAME_MISMATCH
    "-password""-database"LITERAL_VALUE_MISMATCH
    SOS_PASSWORDVSS_SERVER_PATHVARIABLE_NAME_MISMATCH
    "-database""-project"LITERAL_VALUE_MISMATCH
    VSS_SERVER_PATHDS_VSS_PROJECT_PATHVARIABLE_NAME_MISMATCH
    "-project""-verbose"LITERAL_VALUE_MISMATCH
    DS_VSS_PROJECT_PATH"-nocompress"TYPE_COMPATIBLE_REPLACEMENT
    "-verbose""-nocache"LITERAL_VALUE_MISMATCH
    "-nocompress""-workdir"LITERAL_VALUE_MISMATCH
    "-nocache"project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATHTYPE_COMPATIBLE_REPLACEMENT
    "-workdir""-log"LITERAL_VALUE_MISMATCH
    project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATHSRC_COMMENTTYPE_COMPATIBLE_REPLACEMENT
    1
    String[] sTestCmdLine = {"soscmd", "-command", "CheckInFile", "-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, "-log", SRC_COMMENT};
    2
    SOSGet sosGet = new SOSGet();
    2
    SOSGet sosGet = new SOSGet();
    2
    SOSCheckin sosCheckin = new SOSCheckin();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    2
    SOSCheckin sosCheckin = new SOSCheckin();
    3
    sosGet.setProject(project);
    3
    sosGet.setProject(project);
    3
    sosCheckin.setProject(project);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    3
    sosCheckin.setProject(project);
    4
    sosGet.setVssServerPath(VSS_SERVER_PATH);
    4
    sosGet.setVssServerPath(VSS_SERVER_PATH);
    4
    sosCheckin.setVssServerPath(VSS_SERVER_PATH);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    4
    sosCheckin.setVssServerPath(VSS_SERVER_PATH);
    5
    sosGet.setSosServerPath(SOS_SERVER_PATH);
    5
    sosGet.setSosServerPath(SOS_SERVER_PATH);
    5
    sosCheckin.setSosServerPath(SOS_SERVER_PATH);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    5
    sosCheckin.setSosServerPath(SOS_SERVER_PATH);
    6
    sosGet.setProjectPath(VSS_PROJECT_PATH);
    6
    sosGet.setProjectPath(VSS_PROJECT_PATH);
    6
    sosCheckin.setProjectPath(VSS_PROJECT_PATH);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    6
    sosCheckin.setProjectPath(VSS_PROJECT_PATH);
    7
    sosGet.setFile(SRC_FILE);
    7
    sosGet.setFile(SRC_FILE);
    7
    sosCheckin.setFile(SRC_FILE);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sosGet cannot be unified with expression sosCheckin , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public final void setFile(java.lang.String)
    7
    sosCheckin.setFile(SRC_FILE);
    8
    sosGet.setUsername(SOS_USERNAME);
    8
    sosGet.setUsername(SOS_USERNAME);
    9
    sosCheckin.setUsername(SOS_USERNAME);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    9
    sosCheckin.setUsername(SOS_USERNAME);
    9
    sosGet.setPassword(SOS_PASSWORD);
    9
    sosGet.setPassword(SOS_PASSWORD);
    10
    sosCheckin.setPassword(SOS_PASSWORD);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    10
    sosCheckin.setPassword(SOS_PASSWORD);
    10
    sosGet.setVersion(VERSION);
    10
    sosGet.setVersion(VERSION);
    8
    sosCheckin.setComment(SRC_COMMENT);
    Differences
    Expression1Expression2Difference
    setVersionsetCommentMETHOD_INVOCATION_NAME_MISMATCH
    VERSIONSRC_COMMENTVARIABLE_NAME_MISMATCH
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sosGet.setVersion(VERSION) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sosCheckin.setComment(SRC_COMMENT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sosGet.setVersion(VERSION) is a void method call, and thus it cannot be parameterized
    Expression sosCheckin.setComment(SRC_COMMENT) is a void method call, and thus it cannot be parameterized
    8
    sosCheckin.setComment(SRC_COMMENT);
    11
    sosGet.setLocalPath(new Path(project, LOCAL_PATH));
    11
    sosGet.setLocalPath(new Path(project, LOCAL_PATH));
    11
    sosCheckin.setLocalPath(new Path(project, LOCAL_PATH));
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    11
    sosCheckin.setLocalPath(new Path(project, LOCAL_PATH));
    12
    sosGet.setNoCache(true);
    12
    sosGet.setNoCache(true);
    12
    sosCheckin.setNoCache(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    12
    sosCheckin.setNoCache(true);
    13
    sosGet.setNoCompress(true);
    13
    sosGet.setNoCompress(true);
    13
    sosCheckin.setNoCompress(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    13
    sosCheckin.setNoCompress(true);
    14
    sosGet.setVerbose(true);
    14
    sosGet.setVerbose(true);
    14
    sosCheckin.setVerbose(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    14
    sosCheckin.setVerbose(true);
    15
    sosGet.setRecursive(true);
    15
    sosGet.setRecursive(true);
    15
    sosCheckin.setRecursive(true);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sosGet cannot be unified with expression sosCheckin , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public void setRecursive(boolean)
    15
    sosCheckin.setRecursive(true);
    16
    commandline = sosGet.buildCmdLine();
    16
    commandline = sosGet.buildCmdLine();
    16
    commandline = sosCheckin.buildCmdLine();
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    16
    commandline = sosCheckin.buildCmdLine();
    17
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    17
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    Precondition Violations (6)
    Row Violation
    1Expression sosGet cannot be unified with expression sosCheckin , 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.setVersion(VERSION) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression sosCheckin.setComment(SRC_COMMENT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression sosGet.setVersion(VERSION) is a void method call, and thus it cannot be parameterized
    5Expression sosCheckin.setComment(SRC_COMMENT) is a void method call, and thus it cannot be parameterized
    6Expression sosGet cannot be unified with expression sosCheckin , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public void setRecursive(boolean)