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: 6 | Number of AST nodes: 6 | |||
1 | if (inFile.exists() && !inFile.canRead()) {↵ | 1 | if (destfile.exists() && !destfile.canWrite()) {↵ | |
2 | String message =↵ | 2 | String message =↵ | |
3 | "Can not read from the specified srcfile!";↵ | 3 | "Can not write to the specified destfile!";↵ | |
4 | if (failonerror) {↵ | 4 | if (failonerror) {↵ | |
5 | throw new BuildException(message, getLocation());↵ | 5 | throw new BuildException(message, getLocation());↵ | |
6 | } else {↵ | 6 | } else {↵ | |
7 | log(message, Project.MSG_ERR);↵ | 7 | log(message, Project.MSG_ERR);↵ | |
8 | }↵ | 8 | ↵ | |
9 | }↵ | |||
9 | return;↵ | 10 | return;↵ | |
10 | } | 11 | } | |
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 the same method |
Number of node comparisons | 18 |
Number of mapped statements | 6 |
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) | 10.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | if (inFile.exists() && !inFile.canRead()) |
| 41 | if (destfile.exists() && !destfile.canWrite()) | ||||||||||||||||||
14 | String message = "Can not read from the specified srcfile!"; |
| 42 | String message = "Can not write to the specified destfile!"; | ||||||||||||||||||
15 | if (failonerror) | 43 | if (failonerror) | |||||||||||||||||||
16 | throw new BuildException(message, getLocation()); | 44 | throw new BuildException(message, getLocation()); | |||||||||||||||||||
else | else | |||||||||||||||||||||
17 | log(message, Project.MSG_ERR); | 45 | log(message, Project.MSG_ERR); | |||||||||||||||||||
18 | return; |
| 46 | return; |
Row | Violation |
---|---|
1 | Expression inFile.canRead() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression destfile.canWrite() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Conditional return; |
4 | Conditional return; |