Commandline commandLine = new Commandline(); // first off, make sure that we've got a command and a vssdir ... if (getVsspath() == null) { String msg = "vsspath attribute must be set!"; throw new BuildException(msg, getLocation()); } // build the command line from what we got the format is // ss Checkin VSS items [-H] [-C] [-I-] [-N] [-O] [-R] [-W] [-Y] [-?] // as specified in the SS.EXE help commandLine.setExecutable(getSSCommand()); commandLine.createArgument().setValue(COMMAND_CHECKIN); // VSS items commandLine.createArgument().setValue(getVsspath()); // -GL commandLine.createArgument().setValue(getLocalpath()); // -I- or -I-Y or -I-N commandLine.createArgument().setValue(getAutoresponse()); // -R commandLine.createArgument().setValue(getRecursive()); // -W commandLine.createArgument().setValue(getWritable()); // -Y commandLine.createArgument().setValue(getLogin()); // -C commandLine.createArgument().setValue(getComment()); return commandLine;
Commandline commandLine = new Commandline(); // first off, make sure that we've got a command and a vssdir... if (getVsspath() == null) { String msg = "vsspath attribute must be set!"; throw new BuildException(msg, getLocation()); } // build the command line from what we got // the format is: // ss Create VSS items [-C] [-H] [-I-] [-N] [-O] [-S] [-Y] [-?] // as specified in the SS.EXE help commandLine.setExecutable(getSSCommand()); commandLine.createArgument().setValue(COMMAND_CREATE); // VSS items commandLine.createArgument().setValue(getVsspath()); // -C commandLine.createArgument().setValue(getComment()); // -I- or -I-Y or -I-N commandLine.createArgument().setValue(getAutoresponse()); // -O- commandLine.createArgument().setValue(getQuiet()); // -Y commandLine.createArgument().setValue(getLogin()); return commandLine;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCREATE.java
Method name: Commandline buildCmdLine() Method name: Commandline buildCmdLine()
Number of AST nodes: 14 Number of AST nodes: 12
1
Commandline commandLine = new Commandline();
1
Commandline commandLine = new Commandline();
2
        // first off, make sure that we've got a command and a vssdir ...
2
        // first off, make sure that we've got a command and a vssdir...
3
        if (getVsspath() == null) {
3
        if (getVsspath() == null) {
4
            String msg = "vsspath attribute must be set!";
4
            String msg = "vsspath attribute must be set!";
5
            throw new BuildException(msg, getLocation());
5
            throw new BuildException(msg, getLocation());
6
        }
6
        }
7
        // build the command line from what we got
7
        // build the command line from what we got
8
 the format is
8
        // the format is:
9
        // ss Checkin VSS items [-H] [-C] [-I-] [-N] [-O] [-R] [-W] [-Y] [-?]
9
        // ss Create VSS items [-C] [-H] [-I-] [-N] [-O] [-S] [-Y] [-?]
10
        // as specified in the SS.EXE help
10
        // as specified in the SS.EXE help
11
        commandLine.setExecutable(getSSCommand());
11
        commandLine.setExecutable(getSSCommand());
12
        commandLine.createArgument().setValue(COMMAND_CHECKIN);
12
        commandLine.createArgument().setValue(COMMAND_CREATE);
13
        // VSS items
13
        // VSS items
14
        commandLine.createArgument().setValue(getVsspath());
14
        commandLine.createArgument().setValue(getVsspath());
15
        // -GL
15
        // -C
16
        commandLine.createArgument().setValue(getLocalpath());
16
        commandLine.createArgument().setValue(getComment());
17
        // -I- or -I-Y or -I-N
17
        // -I- or -I-Y or -I-N
18
        commandLine.createArgument().setValue(getAutoresponse());
18
        commandLine.createArgument().setValue(getAutoresponse());
19
        // -R
19
        // -O-
20
        commandLine.createArgument().setValue(getRecursive());
20
        commandLine.createArgument().setValue(get
21
        // -W
22
        commandLine.createArgument().setValue(getWritable());
23
        // -Y
24
        commandLine.createArgument().setValue(getLogin());
25
        // -C
26
        commandLine.createArgument().setValue(getComment
21
Quiet());
22
        // -Y
27
());
23
        commandLine.createArgument().setValue(getLogin());
28
        return commandLine;
24
        return commandLine;
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons92
  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 fragment0
    Time elapsed for statement mapping (ms)16.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Commandline commandLine = new Commandline();
    1
    Commandline commandLine = new Commandline();
    2
    if (getVsspath() == null)
    2
    if (getVsspath() == null)
    3
    String msg = "vsspath attribute must be set!";
    3
    String msg = "vsspath attribute must be set!";
    4
    throw new BuildException(msg, getLocation());
    4
    throw new BuildException(msg, getLocation());
    5
    commandLine.setExecutable(getSSCommand());
    5
    commandLine.setExecutable(getSSCommand());
    6
    commandLine.createArgument().setValue(COMMAND_CHECKIN);
    6
    commandLine.createArgument().setValue(COMMAND_CHECKIN);
    6
    commandLine.createArgument().setValue(COMMAND_CREATE);
    Differences
    Expression1Expression2Difference
    COMMAND_CHECKINCOMMAND_CREATEVARIABLE_NAME_MISMATCH
    6
    commandLine.createArgument().setValue(COMMAND_CREATE);
    7
    commandLine.createArgument().setValue(getVsspath());
    7
    commandLine.createArgument().setValue(getVsspath());
    8
    commandLine.createArgument().setValue(getLocalpath());
    8
    commandLine.createArgument().setValue(getLocalpath());
    8
    commandLine.createArgument().setValue(getComment());
    Differences
    Expression1Expression2Difference
    getLocalpathgetCommentMETHOD_INVOCATION_NAME_MISMATCH
    8
    commandLine.createArgument().setValue(getComment());
    9
    commandLine.createArgument().setValue(getAutoresponse());
    9
    commandLine.createArgument().setValue(getAutoresponse());
    10
    commandLine.createArgument().setValue(getRecursive());
    10
    commandLine.createArgument().setValue(getRecursive());
    10
    commandLine.createArgument().setValue(getQuiet());
    Differences
    Expression1Expression2Difference
    getRecursivegetQuietMETHOD_INVOCATION_NAME_MISMATCH
    10
    commandLine.createArgument().setValue(getQuiet());
    11
    commandLine.createArgument().setValue(getWritable());
    11
    commandLine.createArgument().setValue(getWritable());
    11
    commandLine.createArgument().setValue(getLogin());
    Differences
    Expression1Expression2Difference
    getWritablegetLoginMETHOD_INVOCATION_NAME_MISMATCH
    11
    commandLine.createArgument().setValue(getLogin());
    12
    commandLine.createArgument().setValue(getLogin());
                                                                                                                
    13
    commandLine.createArgument().setValue(getComment());
                                                                                                                    
    14
    return commandLine;
    12
    return commandLine;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables commandLine , while Clone fragment #2 returns variables