Commandline commandLine = new Commandline(); // first off, make sure that we've got a command and a vssdir and a label ... 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 History elements [-H] [-L] [-N] [-O] [-V] [-Y] [-#] [-?] // as specified in the SS.EXE help commandLine.setExecutable(getSSCommand()); commandLine.createArgument().setValue(COMMAND_HISTORY); // VSS items commandLine.createArgument().setValue(getVsspath()); // -I- commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF); // ignore all errors // -Vd commandLine.createArgument().setValue(getVersionDate()); // -VL commandLine.createArgument().setValue(getVersionLabel()); // -R commandLine.createArgument().setValue(getRecursive()); // -B / -D / -F- commandLine.createArgument().setValue(getStyle()); // -Y commandLine.createArgument().setValue(getLogin()); // -O commandLine.createArgument().setValue(getOutput()); 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 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;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSHISTORY.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java
Method name: Commandline buildCmdLine() Method name: Commandline buildCmdLine()
Number of AST nodes: 15 Number of AST nodes: 14
1
Commandline commandLine = new Commandline();
1
Commandline commandLine = new Commandline();
2
        // first off, make sure that we've got a command and a vssdir and a label ...
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 the format is
7
        // build the command line from what we got the format is
8
        // ss History elements [-H] [-L] [-N] [-O] [-V] [-Y] [-#] [-?]
8
        // ss Checkin VSS items [-H] [-C] [-I-] [-N] [-O] [-R] [-W] [-Y] [-?]
9
        // as specified in the SS.EXE help
9
        // as specified in the SS.EXE help
10
        commandLine.setExecutable(getSSCommand());
10
        commandLine.setExecutable(getSSCommand());
11
        commandLine.createArgument().setValue(COMMAND_HISTORY);
11
        commandLine.createArgument().setValue(COMMAND_CHECKIN);
12
        // VSS items
12
        // VSS items
13
        commandLine.createArgument().setValue(getVsspath());
13
        commandLine.createArgument().setValue(getVsspath());
14
        // -I-
14
        // -GL
15
        commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF);  // ignore all errors
15
        commandLine.createArgument().setValue(
16
        // -Vd
17
        commandLine.createArgument().setValue(getVersionDate());
16
getLocalpath());
18
        // -VL
17
        // -I- or -I-Y or -I-N
19
        commandLine.createArgument().setValue(getVersionLabel());
18
        commandLine.createArgument().setValue(getAutoresponse());
20
        // -R
19
        // -R
21
        commandLine.createArgument().setValue(getRecursive());
20
        commandLine.createArgument().setValue(getRecursive());
22
        // -B / -D / -F-
21
        // -W
23
        commandLine.createArgument().setValue(getStyle());
22
        commandLine.createArgument().setValue(getWritable());
24
        // -Y
23
        // -Y
25
        commandLine.createArgument().setValue(getLogin());
24
        commandLine.createArgument().setValue(getLogin());
26
        // -O
25
        // -C
27
        commandLine.createArgument().setValue(getOutput());
26
        commandLine.createArgument().setValue(getComment());
28
        return commandLine;
27
        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 comparisons121
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)25.8
    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_HISTORY);
    6
    commandLine.createArgument().setValue(COMMAND_HISTORY);
    Preondition Violations
    Unmatched statement commandLine.createArgument().setValue(COMMAND_HISTORY); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                        
    7
    commandLine.createArgument().setValue(getVsspath());
    7
    commandLine.createArgument().setValue(getVsspath());
    6
    commandLine.createArgument().setValue(COMMAND_CHECKIN);
    Differences
    Expression1Expression2Difference
    getVsspath()COMMAND_CHECKINTYPE_COMPATIBLE_REPLACEMENT
    6
    commandLine.createArgument().setValue(COMMAND_CHECKIN);
    8
    commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF);
    8
    commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF);
    7
    commandLine.createArgument().setValue(getVsspath());
    Differences
    Expression1Expression2Difference
    FLAG_AUTORESPONSE_DEFgetVsspath()TYPE_COMPATIBLE_REPLACEMENT
    7
    commandLine.createArgument().setValue(getVsspath());
    9
    commandLine.createArgument().setValue(getVersionDate());
    9
    commandLine.createArgument().setValue(getVersionDate());
    8
    commandLine.createArgument().setValue(getLocalpath());
    Differences
    Expression1Expression2Difference
    getVersionDategetLocalpathMETHOD_INVOCATION_NAME_MISMATCH
    8
    commandLine.createArgument().setValue(getLocalpath());
    10
    commandLine.createArgument().setValue(getVersionLabel());
    10
    commandLine.createArgument().setValue(getVersionLabel());
    9
    commandLine.createArgument().setValue(getAutoresponse());
    Differences
    Expression1Expression2Difference
    getVersionLabelgetAutoresponseMETHOD_INVOCATION_NAME_MISMATCH
    9
    commandLine.createArgument().setValue(getAutoresponse());
    11
    commandLine.createArgument().setValue(getRecursive());
    10
    commandLine.createArgument().setValue(getRecursive());
    12
    commandLine.createArgument().setValue(getStyle());
    12
    commandLine.createArgument().setValue(getStyle());
    11
    commandLine.createArgument().setValue(getWritable());
    Differences
    Expression1Expression2Difference
    getStylegetWritableMETHOD_INVOCATION_NAME_MISMATCH
    11
    commandLine.createArgument().setValue(getWritable());
    13
    commandLine.createArgument().setValue(getLogin());
    12
    commandLine.createArgument().setValue(getLogin());
    14
    commandLine.createArgument().setValue(getOutput());
    14
    commandLine.createArgument().setValue(getOutput());
    13
    commandLine.createArgument().setValue(getComment());
    Differences
    Expression1Expression2Difference
    getOutputgetCommentMETHOD_INVOCATION_NAME_MISMATCH
    13
    commandLine.createArgument().setValue(getComment());
    15
    return commandLine;
    14
    return commandLine;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement commandLine.createArgument().setValue(COMMAND_HISTORY); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variables commandLine , while Clone fragment #2 returns variables