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/MSVSSCP.java | |||
Method name: Commandline buildCmdLine()
|
Method name: Commandline buildCmdLine()
|
|||
Number of AST nodes: 15 | Number of AST nodes: 10 | |||
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 CP VSS items [-H] [-I-] [-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_CP);↵ | |
12 | // VSS items↵ | 12 | // VSS items↵ | |
13 | commandLine.createArgument().setValue(getVsspath());↵ | 13 | commandLine.createArgument().setValue(getVsspath());↵ | |
14 | // -I-↵ | 14 | // -I-↵ | |
15 | commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF); // ignore all errors↵ | |||
16 | // -Vd↵ | |||
17 | commandLine.createArgument().setValue(getVersionDate());↵ | |||
18 | // -VL↵ | |||
19 | commandLine.createArgument().setValue(getVersionLabel());↵ | |||
20 | // -R↵ | |||
21 | commandLine.createArgument().setValue(getRecursive());↵ | |||
22 | // -B / -D / -F-↵ | |||
23 | commandLine.createArgument().setValue(getStyle());↵ | |||
24 | // -Y↵ | |||
25 | commandLine.createArgument().setValue(getLogin());↵ | |||
26 | // -O↵ | |||
27 | commandLine.createArgument().setValue(getOutput↵ | 15 | or -I-Y or -I-N↵ | |
16 | commandLine.createArgument().setValue(getAutoresponse());↵ | |||
17 | // -Y↵ | |||
28 | ());↵ | 18 | commandLine.createArgument().setValue(getLogin());↵ | |
29 | return commandLine; | 19 |
| |
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 | 81 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 13.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_HISTORY); |
| 6 | commandLine.createArgument().setValue(COMMAND_CP); | ||||||||||
7 | commandLine.createArgument().setValue(getVsspath()); | 7 | commandLine.createArgument().setValue(getVsspath()); | |||||||||||
8 | commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF); |
| 8 | commandLine.createArgument().setValue(getAutoresponse()); | ||||||||||
9 | commandLine.createArgument().setValue(getVersionDate()); |
| 9 | commandLine.createArgument().setValue(getLogin()); | ||||||||||
10 | commandLine.createArgument().setValue(getVersionLabel()); | | ||||||||||||
11 | commandLine.createArgument().setValue(getRecursive()); | | ||||||||||||
12 | commandLine.createArgument().setValue(getStyle()); | | ||||||||||||
13 | commandLine.createArgument().setValue(getLogin()); | | ||||||||||||
14 | commandLine.createArgument().setValue(getOutput()); | | ||||||||||||
15 | return commandLine; | 10 | return commandLine; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables commandLine , while Clone fragment #2 returns variables |