File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/FilterSet.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java | |||
Method name: void readFiltersFromFile(File)
|
Method name: void runBuild(ClassLoader)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | while (e.hasMoreElements()) {↵ | 1 | while (e.hasMoreElements()) {↵ | |
2 | String strPropName = (String) e.nextElement();↵ | 2 | String arg = (String) e.nextElement();↵ | |
3 | String strValue = props.getProperty(strPropName);↵ | 3 | String value = ↵ | |
4 | filts.addElement(new Filter(strPropName, strV↵ | 4 | (String) definedProps.get(arg);↵ | |
5 | alue));↵ | 5 | project.setUserProperty(arg, value);↵ | |
6 | } | 6 | } | |
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 | 17 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | while (e.hasMoreElements()) | 28 | while (e.hasMoreElements()) | ||||||||||||||||
15 | String strPropName = (String)e.nextElement(); |
| 29 | String arg = (String)e.nextElement(); | |||||||||||||||
16 | String strValue = props.getProperty(strPropName); |
| 30 | String value = (String)definedProps.get(arg); | |||||||||||||||
17 | filts.addElement(new Filter(strPropName, strValue)); |
| | ||||||||||||||||
|
| 31 | project.setUserProperty(arg, value); |
Row | Violation |
---|---|
1 | Expression props.getProperty(strPropName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (String)definedProps.get(arg) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement filts.addElement(new Filter(strPropName,strValue)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement project.setUserProperty(arg,value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables strPropName, strValue , while Clone fragment #2 returns variables arg, value |