File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java | |||
Method name: boolean isOutOfDate(Resource, Resource, long)
|
Method name: boolean isOutOfDate(File, File, int)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (!src.isExists()) {↵ | 1 | if (!src.exists()) {↵ | |
2 | return false;↵ | 2 | return false;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!target.isExists()) {↵ | 4 | if (!target.exists()) {↵ | |
5 | return true;↵ | 5 | return true;↵ | |
6 | }↵ | 6 | }↵ | |
7 | if ((src.getLastModified() - granularity) > target.getLastModified()) {↵ | 7 | if ((src.lastModified() - granularity) > target.lastModified()) {↵ | |
8 | return true;↵ | 8 | return true;↵ | |
9 | }↵ | 9 | }↵ | |
10 | return false; | 10 |
| |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 19 |
Number of mapped statements | 7 |
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.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!src.isExists()) |
| 1 | if (!src.exists()) | |||||||||||||||||||||||||||
2 | return false; | 2 | return false; | ||||||||||||||||||||||||||||
3 | if (!target.isExists()) |
| 3 | if (!target.exists()) | |||||||||||||||||||||||||||
4 | return true; | 4 | return true; | ||||||||||||||||||||||||||||
5 | if ((src.getLastModified() - granularity) > target.getLastModified()) |
| 5 | if ((src.lastModified() - granularity) > target.lastModified()) | |||||||||||||||||||||||||||
6 | return true; | 6 | return true; | ||||||||||||||||||||||||||||
7 | return false; | 7 | return false; |
Row | Violation |
---|---|
1 | Expression src.exists() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Type org.apache.tools.ant.types.Resource of variable src does not match with type java.io.File of variable src |
3 | Expression target.exists() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type org.apache.tools.ant.types.Resource of variable target does not match with type java.io.File of variable target |
5 | Expression src.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type org.apache.tools.ant.types.Resource of variable src does not match with type java.io.File of variable src |
7 | Type long of variable granularity does not match with type int of variable granularity |
8 | Expression target.lastModified() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Type org.apache.tools.ant.types.Resource of variable target does not match with type java.io.File of variable target |