File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklabel.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklbtype.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 16 | Number of AST nodes: 13 | |||
1 | Commandline commandLine = new Commandline();↵ | 1 | Commandline commandLine = new Commandline();↵ | |
2 | Project aProj = getProject();↵ | |||
3 | int result = 0;↵ | 2 | int result = 0;↵ | |
4 | // Check for required attributes↵ | 3 | // Check for required attributes↵ | |
5 | if (getTypeName() == null) {↵ | 4 | if (getTypeName() == null) {↵ | |
6 | throw new BuildException("Required attribute TypeName not specified");↵ | 5 | throw new BuildException("Required attribute TypeName not specified");↵ | |
7 | }↵ | 6 | }↵ | |
8 | // Default the viewpath to basedir if it is not specified↵ | |||
9 | if (getViewPath() == null) {↵ | |||
10 | setViewPath(aProj.getBaseDir().getPath());↵ | |||
11 | }↵ | |||
12 | // build the command line from what we got. the format is↵ | 7 | // build the command line from what we got. the format is↵ | |
13 | // cleartool mklabel [options...] [viewpath ...]↵ | 8 | // cleartool mklbtype [options...] type-selector...↵ | |
14 | // as specified in the CLEARTOOL help↵ | 9 | // as specified in the CLEARTOOL help↵ | |
15 | commandLine.setExecutable(getClearToolCommand());↵ | 10 | commandLine.setExecutable(getClearToolCommand());↵ | |
16 | commandLine.createArgument().setValue(COMMAND_MKLABEL);↵ | 11 | commandLine.createArgument().setValue(COMMAND_MKLBTYPE);↵ | |
17 | checkOptions(commandLine);↵ | 12 | checkOptions(commandLine);↵ | |
18 | if (!getFailOnErr()) {↵ | 13 | if (!getFailOnErr()) {↵ | |
19 | getProject().log("Ignoring any errors that occur for: "↵ | 14 | getProject().log("Ignoring any errors that occur for: "↵ | |
20 | + getViewPathBasename(), Project.MSG_VERBOSE);↵ | 15 | + getTypeSpecifier(), Project.MSG_VERBOSE);↵ | |
21 | }↵ | 16 | }↵ | |
22 | result = run(commandLine);↵ | 17 | result = run(commandLine);↵ | |
23 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | 18 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | |
24 | String msg = "Failed executing: " + commandLine.toString();↵ | 19 | String msg = "Failed executing: " + commandLine.toString();↵ | |
25 | throw new BuildException(msg, getLocation());↵ | 20 | throw new BuildException(msg, getLocation());↵ | |
26 | } | 21 |
| |
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 61 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Commandline commandLine = new Commandline(); | 1 | Commandline commandLine = new Commandline(); | |||||||||||
2 | Project aProj = getProject(); | | ||||||||||||
3 | int result = 0; | 2 | int result = 0; | |||||||||||
4 | if (getTypeName() == null) | 3 | if (getTypeName() == null) | |||||||||||
5 | throw new BuildException("Required attribute TypeName not specified"); | 4 | throw new BuildException("Required attribute TypeName not specified"); | |||||||||||
6 | if (getViewPath() == null) | | ||||||||||||
7 | setViewPath(aProj.getBaseDir().getPath()); | | ||||||||||||
8 | commandLine.setExecutable(getClearToolCommand()); | 5 | commandLine.setExecutable(getClearToolCommand()); | |||||||||||
9 | commandLine.createArgument().setValue(COMMAND_MKLABEL); |
| 6 | commandLine.createArgument().setValue(COMMAND_MKLBTYPE); | ||||||||||
10 | checkOptions(commandLine); | 7 | checkOptions(commandLine); | |||||||||||
11 | if (!getFailOnErr()) | 8 | if (!getFailOnErr()) | |||||||||||
12 | getProject().log("Ignoring any errors that occur for: " + getViewPathBasename(), Project.MSG_VERBOSE); |
| 9 | getProject().log("Ignoring any errors that occur for: " + getTypeSpecifier(), Project.MSG_VERBOSE); | ||||||||||
13 | result = run(commandLine); | 10 | result = run(commandLine); | |||||||||||
14 | if (Execute.isFailure(result) && getFailOnErr()) | 11 | if (Execute.isFailure(result) && getFailOnErr()) | |||||||||||
15 | String msg = "Failed executing: " + commandLine.toString(); | 12 | String msg = "Failed executing: " + commandLine.toString(); | |||||||||||
16 | throw new BuildException(msg, getLocation()); | 13 | throw new BuildException(msg, getLocation()); |
Row | Violation |
---|