File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copyfile.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copydir.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | log("DEPRECATED - The copyfile task is deprecated. Use copy instead.");↵ | 1 | log("DEPRECATED - The copydir task is deprecated. Use copy instead.");↵ | |
2 | if (srcFile == null) {↵ | 2 | if (srcDir == null) {↵ | |
3 | throw new BuildException("The src attribute must be present.",↵ | 3 | throw new BuildException("src attribute must be set!",↵ | |
4 | getLocation());↵ | 4 | getLocation());↵ | |
5 | }↵ | 5 | }↵ | |
6 | if (!srcFile.exists()) {↵ | 6 | if (!srcDir.exists()) {↵ | |
7 | throw new BuildException("src " + srcFile.toString()↵ | 7 | throw new BuildException("srcdir " + srcDir.toString()↵ | |
8 | + " does not exist.", getLocation());↵ | 8 | + " does not exist!", getLocation());↵ | |
9 | }↵ | 9 | }↵ | |
10 | if (destFile == null) {↵ | 10 | if (destDir == null) {↵ | |
11 | throw new BuildException("The dest attribute must be present.",↵ | 11 | throw new BuildException("The dest attribute must be set.",↵ | |
12 | getLocation());↵ | 12 | getLocation());↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (srcFile.equals(destFile)) {↵ | 14 | if (srcDir.equals(destDir)) {↵ | |
15 | log("Warning: src == dest", Project.MSG_WARN);↵ | 15 | log("Warning: src == dest", Project.MSG_WARN);↵ | |
16 | } | 16 |
| |
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 | 35 |
Number of mapped statements | 9 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | log("DEPRECATED - The copyfile task is deprecated. Use copy instead."); |
| 1 | log("DEPRECATED - The copydir task is deprecated. Use copy instead."); | ||||||||||||||||
2 | if (srcFile == null) |
| 2 | if (srcDir == null) | ||||||||||||||||
3 | throw new BuildException("The src attribute must be present.", getLocation()); |
| 3 | throw new BuildException("src attribute must be set!", getLocation()); | ||||||||||||||||
4 | if (!srcFile.exists()) |
| 4 | if (!srcDir.exists()) | ||||||||||||||||
5 | throw new BuildException("src " + srcFile.toString() + " does not exist.", getLocation()); |
| 5 | throw new BuildException("srcdir " + srcDir.toString() + " does not exist!", getLocation()); | ||||||||||||||||
6 | if (destFile == null) |
| 6 | if (destDir == null) | ||||||||||||||||
7 | throw new BuildException("The dest attribute must be present.", getLocation()); |
| 7 | throw new BuildException("The dest attribute must be set.", getLocation()); | ||||||||||||||||
8 | if (srcFile.equals(destFile)) |
| 8 | if (srcDir.equals(destDir)) | ||||||||||||||||
9 | log("Warning: src == dest", Project.MSG_WARN); | 9 | log("Warning: src == dest", Project.MSG_WARN); |
Row | Violation |
---|