File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/AptCompilerAdapter.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/AptCompilerAdapter.java | |||
Method name: void setAptCommandlineSwitches(Apt, Commandline)
|
Method name: void setAptCommandlineSwitches(Apt, Commandline)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | File preprocessDir = apt.getPreprocessDir();↵ | 1 | Path factoryPath = apt.getFactoryPath();↵ | |
2 | if (preprocessDir != null) {↵ | 2 | if (factoryPath != null) {↵ | |
3 | cmd.createArgument().setValue("-s");↵ | 3 | cmd.createArgument().setValue("-factorypath");↵ | |
4 | cmd.createArgument().setFile(preprocessDir);↵ | 4 | cmd.createArgument().setPath(factoryPath);↵ | |
5 | }↵ | 5 | }↵ | |
6 | // Process the processor options↵ | 6 | ↵ | |
7 | Vector options = apt.getOptions(); | 7 | File preprocessDir = apt.getPreprocessDir(); | |
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 13 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 7 | Path factoryPath = apt.getFactoryPath(); | |||||||||||||||||
11 | File preprocessDir = apt.getPreprocessDir(); | 11 | File preprocessDir = apt.getPreprocessDir(); | ||||||||||||||||
12 | if (preprocessDir != null) |
| 8 | if (factoryPath != null) | |||||||||||||||
13 | cmd.createArgument().setValue("-s"); |
| 9 | cmd.createArgument().setValue("-factorypath"); | |||||||||||||||
|
| 10 | cmd.createArgument().setPath(factoryPath); | ||||||||||||||||
14 | cmd.createArgument().setFile(preprocessDir); |
| | ||||||||||||||||
15 | Vector options = apt.getOptions(); | |
Row | Violation |
---|---|
1 | Expression preprocessDir cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Type java.io.File of variable preprocessDir does not match with type org.apache.tools.ant.types.Path of variable factoryPath |
3 | Unmatched statement cmd.createArgument().setPath(factoryPath); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement cmd.createArgument().setFile(preprocessDir); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |