File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/ChainedMapper.java | |||
Method name: TestResultHolder executeAsForked(JUnitTest, ExecuteWatchdog, File)
|
Method name: String[] mapFileName(String)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | formatterArg.append(Constants.FORMATTER);↵ | |||
2 | formatterArg.append(fe.getClassname());↵ | |||
3 | File outFile = getOutput(fe, test↵ | 1 | inputs.clear();↵ | |
2 | inputs.addAll(results);↵ | |||
4 | );↵ | 3 | results.clear();↵ | |
5 | if (outFile != null) {↵ | 4 | ↵ | |
6 | formatterArg.append(","↵ | 5 | for (Iterator it = inputs.iterator(); it.hasNext();) {↵ | |
7 | );↵ | 6 | String[] mapped = mapper.mapFileName((String) (it.next()));↵ | |
8 | formatterArg.append(outFile);↵ | 7 | ↵ | |
9 | }↵ | |||
10 | cmd.createArgument().setValue(formatterArg.toString());↵ | |||
11 | formatterArg = new StringBuffer(); | 8 | if (mapped != null) {↵ | |
9 | results.addAll(Arrays.asList(mapped));↵ | |||
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 12 | String[] mapped = mapper.mapFileName((String)(it.next())); | |||||||||||||||
36 | formatterArg.append(Constants.FORMATTER); | | ||||||||||||||||
37 | formatterArg.append(fe.getClassname()); | | ||||||||||||||||
38 | File outFile = getOutput(fe, test); |
| | |||||||||||||||
39 | if (outFile != null) |
| 13 | if (mapped != null) | ||||||||||||||
| 14 | results.addAll(Arrays.asList(mapped)); | ||||||||||||||||
40 | formatterArg.append(","); | | ||||||||||||||||
41 | formatterArg.append(outFile); | | ||||||||||||||||
42 | cmd.createArgument().setValue(formatterArg.toString()); | | ||||||||||||||||
43 | formatterArg = new StringBuffer(); | |
Row | Violation |
---|---|
1 | Unmatched statement String[] mapped=mapper.mapFileName((String)(it.next())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement File outFile=getOutput(fe,test); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type java.io.File of variable outFile does not match with type java.lang.String[] of variable mapped |