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: 10 | Number of AST nodes: 9 | |||
1 | FormatterElement fe = feArray[i];↵ | |||
2 | if (fe.shouldUse(this)) {↵ | |||
3 | formatterArg.append(Constants.FORMATTER);↵ | |||
4 | formatterArg.append(fe.getClassname());↵ | |||
5 | File outFile = getOutput(fe, test↵ | 1 | mapper = (FileNameMapper) (mIter.next());↵ | |
2 | if (mapper != null) {↵ | |||
3 | inputs.clear();↵ | |||
4 | inputs.addAll(results);↵ | |||
6 | );↵ | 5 | results.clear();↵ | |
7 | if (outFile != null) {↵ | 6 | ↵ | |
8 | formatterArg.append(","↵ | 7 | for (Iterator it = inputs.iterator(); it.hasNext();) {↵ | |
9 | );↵ | 8 | String[] mapped = mapper.mapFileName((String) (it.next()));↵ | |
10 | formatterArg.append(outFile);↵ | 9 | ↵ | |
11 | ↵ | 10 | if (mapped != null) {↵ | |
12 | }↵ | 11 | ↵ | |
13 | cmd.createArgument().setValue(formatterArg.toString());↵ | 12 | ↵ | |
14 | formatterArg = new StringBuffer();↵ | 13 | results.addAll(Arrays.asList(mapped));↵ | |
14 | }↵ | |||
15 | }↵ | |||
15 | } | 16 |
| |
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 | 11 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 5 |
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); | |
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 |