File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/TypeSelector.java | |||
Method name: File[] getFiles()
|
Method name: void setParameters(Parameter[])
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | for (int j = 0; j < f.length; j++) {↵ | 1 | for (int i = 0; i < parameters.length; i++) {↵ | |
2 | String pathname = f[j];↵ | 2 | String paramname = ↵ | |
3 | if (pathname.endsWith(".xml"↵ | 3 | parameters[i].getName();↵ | |
4 | )) {↵ | 4 | if (TYPE_KEY.equalsIgnoreCase(paramname)) {↵ | |
5 | File file = new File(ds.getBasedir(), pathname);↵ | 5 | FileType t = new File↵ | |
6 | file = getProject().resolveFile(file.getPath());↵ | |||
7 | v.addElement(fil↵ | 6 | Type();↵ | |
7 | t.setValue(parameters[i].getValue());↵ | |||
8 | setType(t);↵ | |||
9 | } else {↵ | |||
8 | e);↵ | 10 | setError("Invalid parameter " + paramname);↵ | |
9 | }↵ | 11 | }↵ | |
10 | } | 12 |
| |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 26 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | for (int j = 0; j < f.length; j++) |
| 3 | for (int i = 0; i < parameters.length; i++) | |||||||||||||||||||||||
9 | String pathname = f[j]; |
| 4 | String paramname = parameters[i].getName(); | |||||||||||||||||||||||
10 | if (pathname.endsWith(".xml")) |
| 5 | if (TYPE_KEY.equalsIgnoreCase(paramname)) | |||||||||||||||||||||||
|
| 6 | FileType t = new FileType(); | ||||||||||||||||||||||||
|
| 7 | t.setValue(parameters[i].getValue()); | ||||||||||||||||||||||||
|
| 8 | setType(t); | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||
|
| 9 | setError("Invalid parameter " + paramname); | ||||||||||||||||||||||||
11 | File file = new File(ds.getBasedir(), pathname); |
| | ||||||||||||||||||||||||
12 | file = getProject().resolveFile(file.getPath()); | | |||||||||||||||||||||||||
13 | v.addElement(file); |
| |
Row | Violation |
---|---|
1 | Type java.lang.String[] of variable f does not match with type org.apache.tools.ant.types.Parameter[] of variable parameters |
2 | Expression pathname cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression paramname cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression f[j] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression parameters[i].getName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression pathname.endsWith(".xml") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression TYPE_KEY.equalsIgnoreCase(paramname) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression paramname cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression pathname cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Unmatched statement FileType t=new FileType(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement t.setValue(parameters[i].getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
12 | Unmatched statement setType(t); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
13 | Unmatched statement setError("Invalid parameter " + paramname); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
14 | Unmatched statement File file=new File(ds.getBasedir(),pathname); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
15 | Unmatched statement v.addElement(file); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
16 | Clone fragment #1 returns variables pathname , while Clone fragment #2 returns variables i, paramname |