File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/UnknownElementTest.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 4 | |||
1 | for (Iterator i = children.iterator(); i.hasNext();) {↵ | 1 | for (↵ | |
2 | UnknownElement el = (UnknownElement) i.next();↵ | |||
3 | el.maybeConfigure();↵ | |||
4 | Child child = (Child) el.getRealThing();↵ | |||
5 | child.injectParent(this↵ | 2 | int index = 0; index < files.length; ++index) {↵ | |
3 | // process the deployment descriptor in each tool↵ | |||
4 | for (Iterator i = deploymentTools.iterator(); i.hasNext();) {↵ | |||
5 | EJBDeploymentTool tool = (EJBDeploymentTool) i.next();↵ | |||
6 | );↵ | 6 | tool.processDescriptor(files[index], saxParser);↵ | |
7 | child.perform();↵ | 7 | }↵ | |
8 | } | 8 |
| |
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 | 19 |
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) | 4.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | for (Iterator i = children.iterator(); i.hasNext(); ) |
| 21 | for (Iterator i = deploymentTools.iterator(); i.hasNext(); ) | ||||||||||||||
2 | UnknownElement el = (UnknownElement)i.next(); |
| | |||||||||||||||
3 | el.maybeConfigure(); |
| | |||||||||||||||
4 | Child child = (Child)el.getRealThing(); |
| | |||||||||||||||
5 | child.injectParent(this); |
| | |||||||||||||||
6 | child.perform(); |
| | |||||||||||||||
|
| 22 | EJBDeploymentTool tool = (EJBDeploymentTool)i.next(); | |||||||||||||||
|
| 23 | tool.processDescriptor(files[index], saxParser); |
Row | Violation |
---|---|
1 | Type java.util.List of variable children does not match with type java.util.ArrayList of variable deploymentTools |
2 | Unmatched statement UnknownElement el=(UnknownElement)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement el.maybeConfigure(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement Child child=(Child)el.getRealThing(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement child.injectParent(this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement child.perform(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement EJBDeploymentTool tool=(EJBDeploymentTool)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement tool.processDescriptor(files[index],saxParser); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |