File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkbl.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCLock.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
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 checkin [options...] [viewpath ...]↵ | 9 | // cleartool lock [options...]↵ | |
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_MKBL);↵ | 12 | commandLine.createArgument().setValue(COMMAND_LOCK);↵ | |
13 | checkOptions(commandLine↵ | 13 | // Check the command line options↵ | |
14 | checkOptions(commandLine);↵ | |||
15 | // For debugging↵ | |||
14 | );↵ | 16 | // System.out.println(commandLine.toString());↵ | |
15 | if (!getFailOnErr()) {↵ | 17 | if (!getFailOnErr()) {↵ | |
16 | getProject().log("Ignoring any errors that occur for: "↵ | 18 | getProject().log("Ignoring any errors that occur for: "↵ | |
17 | + getBaselineRootName(), Project.MSG_VERBOSE);↵ | 19 | + getOpType(), Project.MSG_VERBOSE);↵ | |
18 | }↵ | 20 | }↵ | |
19 | result = run(commandLine);↵ | 21 | result = run(commandLine);↵ | |
20 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | 22 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | |
21 | String msg = "Failed executing: " + commandLine.toString();↵ | 23 | String msg = "Failed executing: " + commandLine.toString();↵ | |
22 | throw new BuildException(msg, getLocation());↵ | 24 | throw new BuildException(msg, getLocation());↵ | |
23 | } | 25 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 61 |
Number of mapped statements | 14 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 2 |
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; | |||||||||||
4 | if (getViewPath() == null) | 4 | if (getViewPath() == null) | |||||||||||
5 | setViewPath(aProj.getBaseDir().getPath()); | 5 | setViewPath(aProj.getBaseDir().getPath()); | |||||||||||
6 | commandLine.setExecutable(getClearToolCommand()); | 6 | commandLine.setExecutable(getClearToolCommand()); | |||||||||||
7 | commandLine.createArgument().setValue(COMMAND_MKBL); |
| 7 | commandLine.createArgument().setValue(COMMAND_LOCK); | ||||||||||
8 | checkOptions(commandLine); | 8 | checkOptions(commandLine); | |||||||||||
9 | if (!getFailOnErr()) | 9 | if (!getFailOnErr()) | |||||||||||
10 | getProject().log("Ignoring any errors that occur for: " + getBaselineRootName(), Project.MSG_VERBOSE); |
| 10 | getProject().log("Ignoring any errors that occur for: " + getOpType(), Project.MSG_VERBOSE); | ||||||||||
11 | result = run(commandLine); | 11 | result = run(commandLine); | |||||||||||
12 | if (Execute.isFailure(result) && getFailOnErr()) | 12 | if (Execute.isFailure(result) && getFailOnErr()) | |||||||||||
13 | String msg = "Failed executing: " + commandLine.toString(); | 13 | String msg = "Failed executing: " + commandLine.toString(); | |||||||||||
14 | throw new BuildException(msg, getLocation()); | 14 | throw new BuildException(msg, getLocation()); |
Row | Violation |
---|