File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCUpdate.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 17 | Number of AST nodes: 15 | |||
1 | Commandline commandLine = new Commandline();↵ | 1 | Commandline commandLine = new Commandline();↵ | |
2 | Project aProj = getProject();↵ | 2 | Project aProj = getProject();↵ | |
3 | int result = 0;↵ | 3 | int result = 0;↵ | |
4 | // Default the viewpath to basedir if it is not specified↵ | 4 | // Default the viewpath to basedir if it is not specified↵ | |
5 | if (getViewPath() == null) {↵ | 5 | if (getViewPath() == null) {↵ | |
6 | setViewPath(aProj.getBaseDir().getPath());↵ | 6 | setViewPath(aProj.getBaseDir().getPath());↵ | |
7 | }↵ | 7 | }↵ | |
8 | // build the command line from what we got the format is↵ | 8 | // build the command line from what we got the format is↵ | |
9 | // cleartool checkout [options...] [viewpath ...]↵ | 9 | // cleartool update [options...] [viewpath ...]↵ | |
10 | // as specified in the CLEARTOOL.EXE help↵ | 10 | // as specified in the CLEARTOOL.EXE help↵ | |
11 | commandLine.setExecutable(getClearToolCommand());↵ | 11 | commandLine.setExecutable(getClearToolCommand());↵ | |
12 | commandLine.createArgument().setValue(COMMAND_CHECKOUT);↵ | 12 | commandLine.createArgument().setValue(COMMAND_UPDATE);↵ | |
13 | checkOptions(commandLine);↵ | 13 | ↵ | |
14 | /*↵ | |||
15 | * If configured to not care about whether the element is↵ | |||
16 | * already checked out to the current view.↵ | |||
17 | * Then check to see if it is checked out.↵ | |||
18 | */↵ | |||
19 | if (!getNotco() && lsCheckout()) {↵ | |||
20 | ↵ | 14 | // Check the command line options↵ | |
15 | checkOptions(commandLine);↵ | |||
16 | // For debugging↵ | |||
21 | getProject().log("Already checked out in this view: "↵ | 17 | getProject().log(↵ | |
22 | + getViewPathBasename(), Project.MSG_VERBOSE);↵ | |||
23 | return;↵ | |||
24 | }↵ | 18 | commandLine.toString(), Project.MSG_DEBUG);↵ | |
25 | if (!getFailOnErr()) {↵ | 19 | if (!getFailOnErr()) {↵ | |
26 | getProject().log("Ignoring any errors that occur for: "↵ | 20 | getProject().log("Ignoring any errors that occur for: "↵ | |
27 | + getViewPathBasename(), Project.MSG_VERBOSE);↵ | 21 | + getViewPathBasename(), Project.MSG_VERBOSE);↵ | |
28 | }↵ | 22 | }↵ | |
29 | result = run(commandLine);↵ | 23 | result = run(commandLine);↵ | |
30 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | 24 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | |
31 | String msg = "Failed executing: " + commandLine.toString();↵ | 25 | String msg = "Failed executing: " + commandLine.toString();↵ | |
32 | throw new BuildException(msg, getLocation());↵ | 26 | throw new BuildException(msg, getLocation());↵ | |
33 | } | 27 |
| |
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 72 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 3.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Commandline commandLine = new Commandline(); | 1 | Commandline commandLine = new Commandline(); | |||||||||||
2 | Project aProj = getProject(); | 2 | Project aProj = getProject(); | |||||||||||
3 | int result = 0; | 3 | int result = 0; | |||||||||||
6 | commandLine.setExecutable(getClearToolCommand()); | 6 | commandLine.setExecutable(getClearToolCommand()); | |||||||||||
7 | commandLine.createArgument().setValue(COMMAND_CHECKOUT); |
| 7 | commandLine.createArgument().setValue(COMMAND_UPDATE); | ||||||||||
8 | checkOptions(commandLine); | 8 | checkOptions(commandLine); | |||||||||||
| 9 | getProject().log(commandLine.toString(), Project.MSG_DEBUG); | ||||||||||||
9 | if (!getNotco() && lsCheckout()) | | ||||||||||||
11 | return; |
| | |||||||||||
12 | if (!getFailOnErr()) | 10 | if (!getFailOnErr()) | |||||||||||
13 | getProject().log("Ignoring any errors that occur for: " + getViewPathBasename(), Project.MSG_VERBOSE); | | ||||||||||||
14 | result = run(commandLine); | 12 | result = run(commandLine); | |||||||||||
| 13 | if (Execute.isFailure(result) && getFailOnErr()) | ||||||||||||
| 14 | String msg = "Failed executing: " + commandLine.toString(); | ||||||||||||
|
| 15 | throw new BuildException(msg, getLocation()); |
Row | Violation |
---|---|
1 | Unmatched return; |
2 | Unmatched throw new BuildException(msg,getLocation()); |
3 | Clone fragment #1 returns variables result, commandLine , while Clone fragment #2 returns variables commandLine, result |