File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/EchoProperties.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/EchoProperties.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | if (destfile.exists() && destfile.isDirectory()) {↵ | 1 | if (inFile.exists() && inFile.isDirectory()) {↵ | |
2 | String message = "destfile is a directory!";↵ | 2 | String message = "srcfile is a directory!";↵ | |
3 | if (failonerror) {↵ | 3 | if (failonerror) {↵ | |
4 | throw new BuildException(message, getLocation());↵ | 4 | throw new BuildException(message, getLocation());↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | log(message, Project.MSG_ERR);↵ | 6 | log(message, Project.MSG_ERR);↵ | |
7 | }↵ | 7 | ↵ | |
8 | ↵ | 8 | }↵ | |
9 | return;↵ | 9 | return;↵ | |
10 | }↵ | 10 | ↵ | |
11 | ↵ | 11 | }↵ | |
12 | if (destfile.exists() && !destfile.canWrite()) {↵ | 12 | if (inFile.exists() && !inFile.canRead()) {↵ | |
13 | String message =↵ | 13 | String message =↵ | |
14 | "Can not write to the specified destfile!";↵ | 14 | "Can not read from the specified srcfile!";↵ | |
15 | if (failonerror) {↵ | 15 | if (failonerror) {↵ | |
16 | throw new BuildException(message, getLocation());↵ | 16 | throw new BuildException(message, getLocation());↵ | |
17 | } else {↵ | 17 | } else {↵ | |
18 | log(message, Project.MSG_ERR);↵ | 18 | log(message, Project.MSG_ERR);↵ | |
19 | }↵ | 19 | ↵ | |
20 | ↵ | 20 | }↵ | |
21 | return;↵ | 21 | return;↵ | |
22 | } | 22 |
| |
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.9 |
Clones location | Clones are in the same method |
Number of node comparisons | 48 |
Number of mapped statements | 12 |
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) | 11.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35 | if (destfile.exists() && destfile.isDirectory()) |
| 7 | if (inFile.exists() && inFile.isDirectory()) | ||||||||||||||||||
36 | String message = "destfile is a directory!"; |
| 8 | String message = "srcfile is a directory!"; | ||||||||||||||||||
37 | if (failonerror) | 9 | if (failonerror) | |||||||||||||||||||
38 | throw new BuildException(message, getLocation()); | 10 | throw new BuildException(message, getLocation()); | |||||||||||||||||||
else | else | |||||||||||||||||||||
39 | log(message, Project.MSG_ERR); | 11 | log(message, Project.MSG_ERR); | |||||||||||||||||||
40 | return; |
| 12 | return; | ||||||||||||||||||
41 | if (destfile.exists() && !destfile.canWrite()) |
| 13 | if (inFile.exists() && !inFile.canRead()) | ||||||||||||||||||
42 | String message = "Can not write to the specified destfile!"; |
| 14 | String message = "Can not read from the specified srcfile!"; | ||||||||||||||||||
43 | if (failonerror) | 15 | if (failonerror) | |||||||||||||||||||
44 | throw new BuildException(message, getLocation()); | 16 | throw new BuildException(message, getLocation()); | |||||||||||||||||||
else | else | |||||||||||||||||||||
45 | log(message, Project.MSG_ERR); | 17 | log(message, Project.MSG_ERR); | |||||||||||||||||||
46 | return; |
| 18 | return; |
Row | Violation |
---|---|
1 | Conditional return; |
2 | Conditional return; |
3 | Expression destfile.canWrite() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression inFile.canRead() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Conditional return; |
6 | Conditional return; |