String[] sTestCmdLine = {"soscmd", "-command", "GetProject", "-recursive", "-label", SRC_LABEL, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath()}; // Set up a SOSGet task SOSGet sosGet = new SOSGet(); sosGet.setProject(project); sosGet.setVssServerPath(VSS_SERVER_PATH); sosGet.setSosServerPath(SOS_SERVER_PATH); sosGet.setProjectPath(DS_VSS_PROJECT_PATH); sosGet.setLabel(SRC_LABEL); sosGet.setUsername(SOS_USERNAME); sosGet.setSosHome(SOS_HOME); sosGet.setNoCache(true); sosGet.setNoCompress(false); sosGet.setVerbose(false);
String[] sTestCmdLine = {"soscmd", "-command", "CheckInProject", "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath(), "-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(DS_VSS_PROJECT_PATH); sosCheckin.setComment(SRC_COMMENT); sosCheckin.setUsername(SOS_USERNAME); sosCheckin.setSosHome(SOS_HOME); sosCheckin.setNoCache(true); sosCheckin.setNoCompress(false); sosCheckin.setVerbose(false);
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 testGetProjectFlags() Method name: void testCheckinProjectFlags()
Number of AST nodes: 12 Number of AST nodes: 12
1
String[] sTestCmdLine = {"soscmd", "-command", "GetProject", "-recursive",
1
String[] sTestCmdLine = {"soscmd", "-command", "CheckInProject",
2
                "-label", SRC_LABEL, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME,
2
                "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME,
3
                "-password", "", "-database", VSS_SERVER_PATH, "-project",
3
                "-password", "", "-database", VSS_SERVER_PATH, "-project",
4
                DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir",
4
                DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir",
5
                project.getBaseDir().getAbsolutePath()};
5
                project.getBaseDir().getAbsolutePath(), "-log", SRC_COMMENT,};
6
        // Set up a SOSGet task
6
        // Set up a SOSCheckin task
7
        SOSGet sosGet = new SOSGet();
7
        SOSCheckin sosCheckin = new SOSCheckin();
8
        sosGet.setProject(project);
8
        sosCheckin.setProject(project);
9
        sosGet.setVssServerPath(VSS_SERVER_PATH);
9
        sosCheckin.setVssServerPath(VSS_SERVER_PATH);
10
        sosGet.setSosServerPath(SOS_SERVER_PATH);
10
        sosCheckin.setSosServerPath(SOS_SERVER_PATH);
11
        sosGet.setProjectPath(DS_VSS_PROJECT_PATH);
11
        sosCheckin.setProjectPath(DS_VSS_PROJECT_PATH);
12
        sosGet.setLabel(SRC_LABEL);
12
        sosCheckin.setComment(SRC_COMMENT);
13
        sosGet.setUsername(SOS_USERNAME);
13
        sosCheckin.setUsername(SOS_USERNAME);
14
        sosGet.setSosHome(SOS_HOME);
14
        sosCheckin.setSosHome(SOS_HOME);
15
        sosGet.setNoCache(true);
15
        sosCheckin.setNoCache(true);
16
        sosGet.setNoCompress(false);
16
        sosCheckin.setNoCompress(false);
17
        sosGet.setVerbose(false);
17
        sosCheckin.setVerbose(false);
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 comparisons122
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    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", "GetProject", "-recursive", "-label", SRC_LABEL, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath()};
    1
    String[] sTestCmdLine = {"soscmd", "-command", "GetProject", "-recursive", "-label", SRC_LABEL, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath()};
    1
    String[] sTestCmdLine = {"soscmd", "-command", "CheckInProject", "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath(), "-log", SRC_COMMENT};
    Differences
    Expression1Expression2Difference
    "GetProject""CheckInProject"LITERAL_VALUE_MISMATCH
    "-label""-server"LITERAL_VALUE_MISMATCH
    SRC_LABELSOS_SERVER_PATHVARIABLE_NAME_MISMATCH
    "-server""-name"LITERAL_VALUE_MISMATCH
    SOS_SERVER_PATHSOS_USERNAMEVARIABLE_NAME_MISMATCH
    "-name""-password"LITERAL_VALUE_MISMATCH
    SOS_USERNAME""TYPE_COMPATIBLE_REPLACEMENT
    "-password""-database"LITERAL_VALUE_MISMATCH
    ""VSS_SERVER_PATHTYPE_COMPATIBLE_REPLACEMENT
    "-database""-project"LITERAL_VALUE_MISMATCH
    VSS_SERVER_PATHDS_VSS_PROJECT_PATHVARIABLE_NAME_MISMATCH
    "-project"""LITERAL_VALUE_MISMATCH
    DS_VSS_PROJECT_PATH""TYPE_COMPATIBLE_REPLACEMENT
    """-soshome"LITERAL_VALUE_MISMATCH
    ""SOS_HOMETYPE_COMPATIBLE_REPLACEMENT
    "-soshome""-workdir"LITERAL_VALUE_MISMATCH
    SOS_HOMEproject.getBaseDir().getAbsolutePath()TYPE_COMPATIBLE_REPLACEMENT
    "-workdir""-log"LITERAL_VALUE_MISMATCH
    project.getBaseDir().getAbsolutePath()SRC_COMMENTTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression project.getBaseDir().getAbsolutePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression project.getBaseDir().getAbsolutePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    String[] sTestCmdLine = {"soscmd", "-command", "CheckInProject", "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath(), "-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(DS_VSS_PROJECT_PATH);
    6
    sosGet.setProjectPath(DS_VSS_PROJECT_PATH);
    6
    sosCheckin.setProjectPath(DS_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(DS_VSS_PROJECT_PATH);
    7
    sosGet.setLabel(SRC_LABEL);
    7
    sosGet.setLabel(SRC_LABEL);
    7
    sosCheckin.setComment(SRC_COMMENT);
    Differences
    Expression1Expression2Difference
    SRC_LABELSRC_COMMENTVARIABLE_NAME_MISMATCH
    setLabelsetCommentMETHOD_INVOCATION_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.setLabel(SRC_LABEL) 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.setLabel(SRC_LABEL) 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
    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 setLabel(java.lang.String) , public void setComment(java.lang.String)
    7
    sosCheckin.setComment(SRC_COMMENT);
    8
    sosGet.setUsername(SOS_USERNAME);
    8
    sosGet.setUsername(SOS_USERNAME);
    8
    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
    8
    sosCheckin.setUsername(SOS_USERNAME);
    9
    sosGet.setSosHome(SOS_HOME);
    9
    sosGet.setSosHome(SOS_HOME);
    9
    sosCheckin.setSosHome(SOS_HOME);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    9
    sosCheckin.setSosHome(SOS_HOME);
    10
    sosGet.setNoCache(true);
    10
    sosGet.setNoCache(true);
    10
    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
    10
    sosCheckin.setNoCache(true);
    11
    sosGet.setNoCompress(false);
    11
    sosGet.setNoCompress(false);
    11
    sosCheckin.setNoCompress(false);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    11
    sosCheckin.setNoCompress(false);
    12
    sosGet.setVerbose(false);
    12
    sosGet.setVerbose(false);
    12
    sosCheckin.setVerbose(false);
    Differences
    Expression1Expression2Difference
    sosGetsosCheckinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSGetorg.apache.tools.ant.taskdefs.optional.sos.SOSCheckinSUBCLASS_TYPE_MISMATCH
    12
    sosCheckin.setVerbose(false);
    Precondition Violations (8)
    Row Violation
    1Expression project.getBaseDir().getAbsolutePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression project.getBaseDir().getAbsolutePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression sosGet.setLabel(SRC_LABEL) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression sosCheckin.setComment(SRC_COMMENT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression sosGet.setLabel(SRC_LABEL) is a void method call, and thus it cannot be parameterized
    6Expression sosCheckin.setComment(SRC_COMMENT) is a void method call, and thus it cannot be parameterized
    7Expression 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 setLabel(java.lang.String) , public void setComment(java.lang.String)
    8Clone fragment #1 returns variables sosGet, sTestCmdLine , while Clone fragment #2 returns variables sosCheckin, sTestCmdLine