String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_LABEL, DS_VSS_PROJECT_PATH, MSVSS.FLAG_COMMENT + SRC_COMMENT, MSVSS.FLAG_AUTORESPONSE_YES, MSVSS.FLAG_LABEL + SRC_LABEL, MSVSS.FLAG_VERSION + VERSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD}; // Set up a VSSLabel task MSVSSLABEL vssLabel = new MSVSSLABEL(); vssLabel.setProject(project); vssLabel.setComment(SRC_COMMENT); vssLabel.setLogin(VSS_USERNAME + "," + VSS_PASSWORD); vssLabel.setVersion(VERSION); vssLabel.setAutoresponse("Y"); vssLabel.setLabel(SRC_LABEL); vssLabel.setVsspath(VSS_PROJECT_PATH); commandline = vssLabel.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline());
String[] sTestCmdLine = {SS_DIR + File.separator + MSVSS.SS_EXE, MSVSS.COMMAND_ADD, project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH, MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_RECURSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD, MSVSS.FLAG_COMMENT + "-"}; // Set up a VSSAdd task MSVSSADD vssAdd = new MSVSSADD(); vssAdd.setProject(project); vssAdd.setLogin(VSS_USERNAME + "," + VSS_PASSWORD); vssAdd.setVsspath(DS_VSS_PROJECT_PATH); vssAdd.setRecursive(true); vssAdd.setSsdir(SS_DIR); vssAdd.setWritable(false); vssAdd.setLocalpath(new Path(project, LOCAL_PATH)); commandline = vssAdd.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/vss/MSVSSTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java
Method name: void testLabelCommandLine1() Method name: void testAddCommandLine()
Number of AST nodes: 11 Number of AST nodes: 11
1
String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_LABEL, DS_VSS_PROJECT_PATH,
1
String[] sTestCmdLine = {SS_DIR + File.separator + MSVSS.SS_EXE, MSVSS.COMMAND_
2
                MSVSS.FLAG_COMMENT + SRC_COMMENT, MSVSS.FLAG_AUTORESPONSE_YES
2
ADD,
3
,
3
                project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH,
4
                MSVSS.FLAG_LABEL + SRC_LABEL, MSVSS.FLAG_VERSION + VERSION, MSVSS.FLAG_LOGIN
4
                MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_RECURSION,
5
                 + VSS_USERNAME + "," + VSS_PASSWORD};
5
                MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD, MSVSS.FLAG_COMMENT + "-"};
6
        // Set up a VSSLabel task
6
        // Set up a VSSAdd task
7
        MSVSSLABEL vssLabel = new MSVSSLABEL();
7
        MSVSSADD vssAdd = new MSVSSADD();
8
        vssLabel.setProject(project);
8
        vssAdd.setProject(project);
9
        vssLabel.setComment(SRC_COMMENT);
9
        vss
10
        vssLabel.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
10
Add.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
11
        vssLabel.setVersion(VERSION);
11
        vssAdd.setVsspath(DS_VSS_PROJECT_PATH);
12
        vssLabel.setAutoresponse("Y");
12
        vss
13
        vssLabel.setLabel(SRC_LABEL
13
Add.setRecursive(true);
14
);
14
        vssAdd.setSsdir(SS_DIR);
15
        vssLabel.setVsspath(VSS_PROJECT
15
        vssAdd.setWritable(false);
16
_PATH);
16
        vssAdd.setLocalpath(new Path(project, LOCAL_PATH));
17
        commandline = vssLabel.buildCmdLine();
17
        commandline = vssAdd.buildCmdLine();
18
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
18
        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 comparisons89
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    1
    String[] sTestCmdLine = {SS_DIR + File.separator + MSVSS.SS_EXE, MSVSS.COMMAND_ADD, project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH, MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_RECURSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD, MSVSS.FLAG_COMMENT + "-"};
    1
    String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_LABEL, DS_VSS_PROJECT_PATH, MSVSS.FLAG_COMMENT + SRC_COMMENT, MSVSS.FLAG_AUTORESPONSE_YES, MSVSS.FLAG_LABEL + SRC_LABEL, MSVSS.FLAG_VERSION + VERSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD};
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    2
    MSVSSLABEL vssLabel = new MSVSSLABEL();
    2
    MSVSSLABEL vssLabel = new MSVSSLABEL();
    2
    MSVSSADD vssAdd = new MSVSSADD();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    vssLabelvssAddVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    2
    MSVSSADD vssAdd = new MSVSSADD();
    3
    vssLabel.setProject(project);
    3
    vssLabel.setProject(project);
    3
    vssAdd.setProject(project);
    Differences
    Expression1Expression2Difference
    vssLabelvssAddVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    3
    vssAdd.setProject(project);
    4
    vssLabel.setComment(SRC_COMMENT);
    4
    vssLabel.setComment(SRC_COMMENT);
    5
    vssAdd.setVsspath(DS_VSS_PROJECT_PATH);
    Differences
    Expression1Expression2Difference
    setCommentsetVsspathMETHOD_INVOCATION_NAME_MISMATCH
    SRC_COMMENTDS_VSS_PROJECT_PATHVARIABLE_NAME_MISMATCH
    vssLabelvssAddVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression vssLabel.setComment(SRC_COMMENT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression vssAdd.setVsspath(DS_VSS_PROJECT_PATH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression vssLabel.setComment(SRC_COMMENT) is a void method call, and thus it cannot be parameterized
    Expression vssAdd.setVsspath(DS_VSS_PROJECT_PATH) is a void method call, and thus it cannot be parameterized
    5
    vssAdd.setVsspath(DS_VSS_PROJECT_PATH);
    5
    vssLabel.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
    5
    vssLabel.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
    4
    vssAdd.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
    Differences
    Expression1Expression2Difference
    vssLabelvssAddVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    4
    vssAdd.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);
                                                              
    6
    vssAdd.setRecursive(true);
    6
    vssLabel.setVersion(VERSION);
    6
    vssLabel.setVersion(VERSION);
    7
    vssAdd.setSsdir(SS_DIR);
    Differences
    Expression1Expression2Difference
    setVersionsetSsdirMETHOD_INVOCATION_NAME_MISMATCH
    VERSIONSS_DIRVARIABLE_NAME_MISMATCH
    vssLabelvssAddVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression vssLabel.setVersion(VERSION) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression vssAdd.setSsdir(SS_DIR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression vssLabel.setVersion(VERSION) is a void method call, and thus it cannot be parameterized
    Expression vssAdd.setSsdir(SS_DIR) is a void method call, and thus it cannot be parameterized
    7
    vssAdd.setSsdir(SS_DIR);
                                                              
    8
    vssAdd.setWritable(false);
    7
    vssLabel.setAutoresponse("Y");
    7
    vssLabel.setAutoresponse("Y");
    11
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    Differences
    Expression1Expression2Difference
    setAutoresponsecheckCommandLinesMETHOD_INVOCATION_NAME_MISMATCH
    vssLabel.setAutoresponse("Y")checkCommandLines(sTestCmdLine,commandline.getCommandline())ARGUMENT_NUMBER_MISMATCH
    vssLabelMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression vssLabel.setAutoresponse("Y") 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 vssLabel.setAutoresponse("Y") 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 vssLabel.setAutoresponse("Y") 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 vssLabel.setAutoresponse("Y") 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
    11
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    8
    vssLabel.setLabel(SRC_LABEL);
                                                                    
    9
    vssLabel.setVsspath(VSS_PROJECT_PATH);
                                                                                      
    10
    commandline = vssLabel.buildCmdLine();
    10
    commandline = vssLabel.buildCmdLine();
    10
    commandline = vssAdd.buildCmdLine();
    Differences
    Expression1Expression2Difference
    vssLabelvssAddVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABELorg.apache.tools.ant.taskdefs.optional.vss.MSVSSADDSUBCLASS_TYPE_MISMATCH
    10
    commandline = vssAdd.buildCmdLine();
    11
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    11
    checkCommandLines(sTestCmdLine, commandline.getCommandline());
    9
    vssAdd.setLocalpath(new Path(project, LOCAL_PATH));
    Differences
    Expression1Expression2Difference
    checkCommandLinessetLocalpathMETHOD_INVOCATION_NAME_MISMATCH
    checkCommandLines(sTestCmdLine,commandline.getCommandline())vssAdd.setLocalpath(new Path(project,LOCAL_PATH))ARGUMENT_NUMBER_MISMATCH
    vssAddMISSING_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 vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) 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 vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) 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 vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) 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 vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) is a void method call, and thus it cannot be parameterized
    9
    vssAdd.setLocalpath(new Path(project, LOCAL_PATH));
    Precondition Violations (25)
    Row Violation
    1Expression vssLabel.setComment(SRC_COMMENT) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression vssAdd.setVsspath(DS_VSS_PROJECT_PATH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression vssLabel.setComment(SRC_COMMENT) is a void method call, and thus it cannot be parameterized
    4Expression vssAdd.setVsspath(DS_VSS_PROJECT_PATH) is a void method call, and thus it cannot be parameterized
    5Expression vssLabel.setVersion(VERSION) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression vssAdd.setSsdir(SS_DIR) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression vssLabel.setVersion(VERSION) is a void method call, and thus it cannot be parameterized
    8Expression vssAdd.setSsdir(SS_DIR) is a void method call, and thus it cannot be parameterized
    9Expression vssLabel.setAutoresponse("Y") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression vssLabel.setAutoresponse("Y") is a void method call, and thus it cannot be parameterized
    12Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    13Expression vssLabel.setAutoresponse("Y") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression vssLabel.setAutoresponse("Y") is a void method call, and thus it cannot be parameterized
    16Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    17Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    20Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) is a void method call, and thus it cannot be parameterized
    21Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized
    24Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) is a void method call, and thus it cannot be parameterized
    25Clone fragment #1 returns variable vssLabel with type org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL , while Clone fragment #2 returns variable vssAdd with type org.apache.tools.ant.taskdefs.optional.vss.MSVSSADD