File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/Rpm.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java | |||
Method name: void execute()
|
Method name: void runCommand()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | if (Execute.isFailure(returncode)) {↵ | 1 | if (Execute.isFailure(err)) {↵ | |
2 | String msg = "'" + toExecute.getExecutable()↵ | |||
3 | + "' failed with exit code " + returncode;↵ | |||
4 | if (failOnError) {↵ | 2 | if (failOnError) {↵ | |
5 | throw new BuildException(msg);↵ | 3 | throw new BuildException(title + " returned: " + err, owner.getLocation());↵ | |
6 | } else {↵ | 4 | } else {↵ | |
7 | log(msg, Project.MSG_ERR);↵ | 5 | owner.log(title + " Result: " + err, Project.MSG_ERR);↵ | |
8 | }↵ | 6 | }↵ | |
9 | } | 7 |
| |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 4 |
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) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40 | if (Execute.isFailure(returncode)) |
| 11 | if (Execute.isFailure(err)) | |||||||||||||||
41 | String msg = "'" + toExecute.getExecutable() + "' failed with exit code " + returncode; | | |||||||||||||||||
42 | if (failOnError) | 12 | if (failOnError) | ||||||||||||||||
43 | throw new BuildException(msg); |
| 13 | throw new BuildException(title + " returned: " + err, owner.getLocation()); | |||||||||||||||
else | else | ||||||||||||||||||
44 | log(msg, Project.MSG_ERR); |
| 14 | owner.log(title + " Result: " + err, Project.MSG_ERR); |
Row | Violation |
---|---|
1 | Expression log(msg,Project.MSG_ERR) is a void method call, and thus it cannot be parameterized |
2 | Expression owner.log(title + " Result: " + err,Project.MSG_ERR) is a void method call, and thus it cannot be parameterized |