File path: /apache-ant-1.7.0/src/org/apache/tools/ant/PropertyHelper.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/ComponentHelper.java | |||
Method name: PropertyHelper getPropertyHelper(Project)
|
Method name: ComponentHelper getComponentHelper(Project)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | PropertyHelper helper↵ | |||
2 | = (PropertyHelper) project.getReference(MagicNames.REFID_PROPERTY_HELPER↵ | 1 | ComponentHelper ph = (ComponentHelper) project.getReference(↵ | |
3 | );↵ | 2 | COMPONENT_HELPER_REFERENCE);↵ | |
4 | if (helper != null) {↵ | 3 | if (ph != null) {↵ | |
5 | return helper;↵ | 4 | return ph;↵ | |
6 | }↵ | 5 | }↵ | |
7 | helper = new PropertyHelper();↵ | 6 | ph = new ComponentHelper();↵ | |
8 | helper.setProject(project);↵ | 7 | ph.setProject(project);↵ | |
9 | project.addReference(MagicNames.REFID_PROPERTY_HELPER, helper);↵ | 8 | project.addReference(COMPONENT_HELPER_REFERENCE, ph);↵ | |
10 | return helper; | 9 | return ph; | |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 25 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | PropertyHelper helper = (PropertyHelper)project.getReference(MagicNames.REFID_PROPERTY_HELPER); |
| | |||||||||||||||
|
| 3 | ComponentHelper ph = (ComponentHelper)project.getReference(COMPONENT_HELPER_REFERENCE); | |||||||||||||||
2 | if (helper != null) |
| 4 | if (ph != null) | ||||||||||||||
3 | return helper; |
| | |||||||||||||||
|
| 5 | return ph; | |||||||||||||||
4 | helper = new PropertyHelper(); |
| | |||||||||||||||
|
| 6 | ph = new ComponentHelper(); | |||||||||||||||
5 | helper.setProject(project); |
| 7 | ph.setProject(project); | ||||||||||||||
6 | project.addReference(MagicNames.REFID_PROPERTY_HELPER, helper); |
| | |||||||||||||||
7 | return helper; | | ||||||||||||||||
|
| 8 | project.addReference(COMPONENT_HELPER_REFERENCE, ph); | |||||||||||||||
| 9 | return ph; |
Row | Violation |
---|---|
1 | Unmatched statement PropertyHelper helper=(PropertyHelper)project.getReference(MagicNames.REFID_PROPERTY_HELPER); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement ComponentHelper ph=(ComponentHelper)project.getReference(COMPONENT_HELPER_REFERENCE); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Type org.apache.tools.ant.PropertyHelper of variable helper does not match with type org.apache.tools.ant.ComponentHelper of variable ph |
4 | Unmatched statement return helper; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return helper; |
6 | Unmatched statement return ph; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched return ph; |
8 | Unmatched statement helper=new PropertyHelper(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement ph=new ComponentHelper(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Type org.apache.tools.ant.PropertyHelper of variable helper does not match with type org.apache.tools.ant.ComponentHelper of variable ph |
11 | Unmatched statement project.addReference(MagicNames.REFID_PROPERTY_HELPER,helper); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
12 | Unmatched statement project.addReference(COMPONENT_HELPER_REFERENCE,ph); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |