File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSSHISTORY.java | |||
Method name: Commandline buildCmdLine()
|
Method name: Commandline buildCmdLine()
|
|||
Number of AST nodes: 16 | Number of AST nodes: 15 | |||
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 and a label ...↵ | |
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 Checkout VSS items [-G] [-C] [-H] [-I-] [-N] [-O] [-R] [-V] [-Y] [-?]↵ | 8 | // ss History elements [-H] [-L] [-N] [-O] [-V] [-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_CHECKOUT);↵ | 11 | commandLine.createArgument().setValue(COMMAND_HISTORY);↵ | |
12 | // VSS items↵ | 12 | // VSS items↵ | |
13 | commandLine.createArgument().setValue(getVsspath());↵ | 13 | commandLine.createArgument().setValue(getVsspath());↵ | |
14 | // -GL↵ | 14 | // -I-↵ | |
15 | commandLine.createArgument().setValue(getLocalpath());↵ | 15 | commandLine.createArgument().setValue(↵ | |
16 | // -I- or -I-Y or -I-N↵ | |||
17 | commandLine.createArgument().setValue(getAutoresponse());↵ | 16 | FLAG_AUTORESPONSE_DEF); // ignore all errors↵ | |
18 | // -R↵ | 17 | // -Vd↵ | |
19 | commandLine.createArgument().setValue(getRecursive());↵ | 18 | commandLine.createArgument().setValue(getVersionDate());↵ | |
20 | // -V↵ | 19 | // -VL↵ | |
21 | commandLine.createArgument().setValue(getVersionDateLabel());↵ | 20 | commandLine.createArgument().setValue(getVersionLabel());↵ | |
22 | // -Y↵ | 21 | // -R↵ | |
23 | commandLine.createArgument().setValue(getLogin());↵ | 22 | commandLine.createArgument().setValue(getRecursive());↵ | |
24 | // -G↵ | 23 | // -B / -D / -F-↵ | |
25 | commandLine.createArgument().setValue(getFileTimeStamp());↵ | 24 | commandLine.createArgument().setValue(getStyle());↵ | |
26 | // -GWS or -GWR↵ | 25 | // -Y↵ | |
27 | commandLine.createArgument().setValue(getWritableFiles());↵ | 26 | commandLine.createArgument().setValue(getLogin());↵ | |
28 | // -G-↵ | 27 | // -O↵ | |
29 | commandLine.createArgument().setValue(getGetLocalCopy());↵ | 28 | commandLine.createArgument().setValue(getOutput());↵ | |
30 | return commandLine; | 29 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 143 |
Number of mapped statements | 15 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 30.4 |
Clone type | Type 3 |
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_CHECKOUT); |
| 6 | commandLine.createArgument().setValue(COMMAND_HISTORY); | ||||||||||
7 | commandLine.createArgument().setValue(getVsspath()); | 7 | commandLine.createArgument().setValue(getVsspath()); | |||||||||||
8 | commandLine.createArgument().setValue(getLocalpath()); |
| 8 | commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF); | ||||||||||
9 | commandLine.createArgument().setValue(getAutoresponse()); |
| 9 | commandLine.createArgument().setValue(getVersionDate()); | ||||||||||
10 | commandLine.createArgument().setValue(getRecursive()); |
| 10 | commandLine.createArgument().setValue(getVersionLabel()); | ||||||||||
11 | commandLine.createArgument().setValue(getVersionDateLabel()); |
| 11 | commandLine.createArgument().setValue(getRecursive()); | ||||||||||
12 | commandLine.createArgument().setValue(getLogin()); |
| 12 | commandLine.createArgument().setValue(getStyle()); | ||||||||||
13 | commandLine.createArgument().setValue(getFileTimeStamp()); |
| 13 | commandLine.createArgument().setValue(getLogin()); | ||||||||||
14 | commandLine.createArgument().setValue(getWritableFiles()); |
| 14 | commandLine.createArgument().setValue(getOutput()); | ||||||||||
15 | commandLine.createArgument().setValue(getGetLocalCopy()); | | ||||||||||||
16 | return commandLine; | 15 | return commandLine; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables commandLine , while Clone fragment #2 returns variables |