String[] sTestCmdLine = {"soscmd", "-command", "CheckOutProject", "-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()}; // Set up a sosCheckout task SOSCheckout sosCheckout = new SOSCheckout(); sosCheckout.setProject(project); sosCheckout.setVssServerPath(VSS_SERVER_PATH); sosCheckout.setSosServerPath(SOS_SERVER_PATH); sosCheckout.setProjectPath(VSS_PROJECT_PATH); sosCheckout.setUsername(SOS_USERNAME); sosCheckout.setSosHome(SOS_HOME); sosCheckout.setNoCache(true); sosCheckout.setNoCompress(false); sosCheckout.setVerbose(false); sosCheckout.setRecursive(true); commandline = sosCheckout.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline());
String[] sTestCmdLine = {"soscmd", "-command", "AddLabel", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-label", SRC_LABEL, "-verbose", "-log", SRC_COMMENT}; // Set up a sosCheckout task SOSLabel sosLabel = new SOSLabel(); sosLabel.setVssServerPath(VSS_SERVER_PATH); sosLabel.setSosServerPath(SOS_SERVER_PATH); sosLabel.setProjectPath(DS_VSS_PROJECT_PATH); sosLabel.setUsername(SOS_USERNAME); sosLabel.setSosHome(SOS_HOME); sosLabel.setComment(SRC_COMMENT); sosLabel.setLabel(SRC_LABEL); sosLabel.setNoCache(true); sosLabel.setNoCompress(false); sosLabel.setVerbose(true); commandline = sosLabel.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 testCheckoutProjectFlags() Method name: void testLabelFlags()
Number of AST nodes: 14 Number of AST nodes: 14
1
String[] sTestCmdLine = {"soscmd", "-command", "CheckOutProject",
1
String[] sTestCmdLine = {"soscmd", "-command", "
2
                "-recursive", "-server",
2
AddLabel", "-server",
3
 SOS_SERVER_PATH, "-name", SOS_USERNAME,
3
                SOS_SERVER_PATH, "-name", SOS_USERNAME,
4
                "-password", "", "-database",
4
 "-password", "", "-database",
5
 VSS_SERVER_PATH, "-project",
5
                VSS_SERVER_PATH, "-project",
6
                DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir",
6
 DS_VSS_PROJECT_PATH, "
7
                project.getBaseDir().getAbsolutePath()
7
-label",
8
};
8
                SRC_LABEL, "-verbose", "-log", SRC_COMMENT};
9
        // Set up a sosCheckout task
9
        // Set up a sosCheckout task
10
        SOSCheckout sosCheckout = new SOSCheckout();
10
        SOS
11
        sosCheckout.setProject(project);
11
Label sosLabel = new SOSLabel();
12
        sosCheckout.setVssServerPath(VSS_SERVER_PATH);
12
        sosLabel.setVssServerPath(VSS_SERVER_PATH);
13
        sosCheckout.setSosServerPath(SOS_SERVER_PATH);
13
        sosLabel.setSosServerPath(SOS_SERVER_PATH);
14
        sosCheckout.setProjectPath(VSS_PROJECT_PATH);
14
        sosLabel.setProjectPath(DS_VSS_PROJECT_PATH);
15
        sosCheckout.setUsername(SOS_USERNAME);
15
        sosLabel.setUsername(SOS_USERNAME);
16
        sosCheckout.setSosHome(SOS_HOME);
16
        sosLabel.setSosHome(SOS_HOME);
17
        sosCheckout.setNoCache(true
17
        sosLabel.setComment(SRC_COMMENT);
18
);
18
        sosLabel.setLabel(SRC_LABEL);
19
        sosCheckout.setNoCompress(false);
19
        sos
20
        sosCheckout.setVerbose
20
Label.setNoCache(true);
21
(false);
21
        sosLabel.setNoCompress(false);
22
        sosCheckout.setRecursive(true);
22
        sosLabel.setVerbose(true);
23
        commandline = sosCheckout.buildCmdLine();
23
        commandline = sosLabel.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 comparisons156
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    1
    String[] sTestCmdLine = {"soscmd", "-command", "AddLabel", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-label", SRC_LABEL, "-verbose", "-log", SRC_COMMENT};
    1
    String[] sTestCmdLine = {"soscmd", "-command", "CheckOutProject", "-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()};
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    2
    SOSCheckout sosCheckout = new SOSCheckout();
    2
    SOSCheckout sosCheckout = new SOSCheckout();
    2
    SOSLabel sosLabel = new SOSLabel();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    2
    SOSLabel sosLabel = new SOSLabel();
    3
    sosCheckout.setProject(project);
    3
    sosCheckout.setProject(project);
    14
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    Differences
    Expression1Expression2Difference
    setProjectcheckCommandLinesMETHOD_INVOCATION_NAME_MISMATCH
    sosCheckout.setProject(project)checkCommandLines(sTestCmdLine,commandline.getCommandline())ARGUMENT_NUMBER_MISMATCH
    sosCheckoutMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression sosCheckout.setProject(project) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method checkCommandLines
    Expression sosCheckout.setProject(project) is a void method call, and thus it cannot be parameterized
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    Expression sosCheckout.setProject(project) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method checkCommandLines
    Expression sosCheckout.setProject(project) is a void method call, and thus it cannot be parameterized
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    14
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    4
    sosCheckout.setVssServerPath(VSS_SERVER_PATH);
    4
    sosCheckout.setVssServerPath(VSS_SERVER_PATH);
    3
    sosLabel.setVssServerPath(VSS_SERVER_PATH);
    Differences
    Expression1Expression2Difference
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    3
    sosLabel.setVssServerPath(VSS_SERVER_PATH);
    5
    sosCheckout.setSosServerPath(SOS_SERVER_PATH);
    5
    sosCheckout.setSosServerPath(SOS_SERVER_PATH);
    4
    sosLabel.setSosServerPath(SOS_SERVER_PATH);
    Differences
    Expression1Expression2Difference
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    4
    sosLabel.setSosServerPath(SOS_SERVER_PATH);
    6
    sosCheckout.setProjectPath(VSS_PROJECT_PATH);
    6
    sosCheckout.setProjectPath(VSS_PROJECT_PATH);
    5
    sosLabel.setProjectPath(DS_VSS_PROJECT_PATH);
    Differences
    Expression1Expression2Difference
    VSS_PROJECT_PATHDS_VSS_PROJECT_PATHVARIABLE_NAME_MISMATCH
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    5
    sosLabel.setProjectPath(DS_VSS_PROJECT_PATH);
    7
    sosCheckout.setUsername(SOS_USERNAME);
    7
    sosCheckout.setUsername(SOS_USERNAME);
    6
    sosLabel.setUsername(SOS_USERNAME);
    Differences
    Expression1Expression2Difference
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    6
    sosLabel.setUsername(SOS_USERNAME);
    8
    sosCheckout.setSosHome(SOS_HOME);
    8
    sosCheckout.setSosHome(SOS_HOME);
    7
    sosLabel.setSosHome(SOS_HOME);
    Differences
    Expression1Expression2Difference
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    7
    sosLabel.setSosHome(SOS_HOME);
                                                                            
    8
    sosLabel.setComment(SRC_COMMENT);
    9
    sosCheckout.setNoCache(true);
    9
    sosCheckout.setNoCache(true);
    10
    sosLabel.setNoCache(true);
    Differences
    Expression1Expression2Difference
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    10
    sosLabel.setNoCache(true);
    10
    sosCheckout.setNoCompress(false);
    10
    sosCheckout.setNoCompress(false);
    11
    sosLabel.setNoCompress(false);
    Differences
    Expression1Expression2Difference
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    11
    sosLabel.setNoCompress(false);
    11
    sosCheckout.setVerbose(false);
    11
    sosCheckout.setVerbose(false);
    12
    sosLabel.setVerbose(true);
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    12
    sosLabel.setVerbose(true);
    12
    sosCheckout.setRecursive(true);
                                                                          
    13
    commandline = sosCheckout.buildCmdLine();
    13
    commandline = sosCheckout.buildCmdLine();
    13
    commandline = sosLabel.buildCmdLine();
    Differences
    Expression1Expression2Difference
    sosCheckoutsosLabelVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.sos.SOSCheckoutorg.apache.tools.ant.taskdefs.optional.sos.SOSLabelSUBCLASS_TYPE_MISMATCH
    13
    commandline = sosLabel.buildCmdLine();
    14
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    14
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    9
    sosLabel.setLabel(SRC_LABEL);
    Differences
    Expression1Expression2Difference
    checkCommandLinessetLabelMETHOD_INVOCATION_NAME_MISMATCH
    checkCommandLines(sTestCmdLine,commandline.getCommandline())sosLabel.setLabel(SRC_LABEL)ARGUMENT_NUMBER_MISMATCH
    sosLabelMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method checkCommandLines
    Expression sosLabel.setLabel(SRC_LABEL) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    Expression sosLabel.setLabel(SRC_LABEL) is a void method call, and thus it cannot be parameterized
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method checkCommandLines
    Expression sosLabel.setLabel(SRC_LABEL) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    Expression sosLabel.setLabel(SRC_LABEL) is a void method call, and thus it cannot be parameterized
    9
    sosLabel.setLabel(SRC_LABEL);
    Precondition Violations (17)
    Row Violation
    1Expression sosCheckout.setProject(project) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression sosCheckout.setProject(project) is a void method call, and thus it cannot be parameterized
    4Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    5Expression sosCheckout.setProject(project) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression sosCheckout.setProject(project) is a void method call, and thus it cannot be parameterized
    8Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    9Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression sosLabel.setLabel(SRC_LABEL) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    12Expression sosLabel.setLabel(SRC_LABEL) is a void method call, and thus it cannot be parameterized
    13Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression sosLabel.setLabel(SRC_LABEL) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    16Expression sosLabel.setLabel(SRC_LABEL) is a void method call, and thus it cannot be parameterized
    17Clone fragment #1 returns variable sosCheckout with type org.apache.tools.ant.taskdefs.optional.sos.SOSCheckout , while Clone fragment #2 returns variable sosLabel with type org.apache.tools.ant.taskdefs.optional.sos.SOSLabel