File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java | |||
Method name: NestedCreator getNestedCreator(Project, String, Object, String, UnknownElement)
|
Method name: NestedCreator getNestedCreator(Project, String, Object, String, UnknownElement)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 5 | |||
1 | if (nc == null && parent instanceof DynamicElementNS) {↵ | 1 | if (nc == null && parent instanceof DynamicElement) {↵ | |
2 | DynamicElementNS dc = (DynamicElementNS) parent;↵ | 2 | DynamicElement dc = (DynamicElement) parent;↵ | |
3 | String qName = (child == null ? name : child.getQName());↵ | 3 | ↵ | |
4 | final Object nestedElement =↵ | |||
5 | dc.createDynamicElement(↵ | |||
6 | (child == null ? "" : child.getNamespace()),↵ | |||
7 | name, qName↵ | 4 | final Object nestedElement =↵ | |
8 | );↵ | 5 | dc.createDynamicElement(name.toLowerCase(Locale.US));↵ | |
9 | if (nestedElement != null) {↵ | 6 | if (nestedElement != null) {↵ | |
10 | nc = new NestedCreator(null) {↵ | 7 | nc = new NestedCreator(null) {↵ | |
11 | Object create(↵ | 8 | Object create(↵ | |
12 | Project project, Object parent, Object ignore) {↵ | 9 | Project project, Object parent, Object ignore) {↵ | |
13 | return nestedElement;↵ | 10 | return nestedElement;↵ | |
14 | }↵ | 11 | }↵ | |
15 | };↵ | 12 | };↵ | |
16 | }↵ | 13 | }↵ | |
17 | } | 14 |
| |
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 the same method |
Number of node comparisons | 16 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12 | if (nc == null && parent instanceof DynamicElementNS) |
| 18 | if (nc == null && parent instanceof DynamicElement) | |||||||||||
13 | DynamicElementNS dc = (DynamicElementNS)parent; | | |||||||||||||
14 | String qName = (child == null ? name : child.getQName()); | | |||||||||||||
15 | final Object nestedElement = dc.createDynamicElement((child == null ? "" : child.getNamespace()), name, qName); | | |||||||||||||
| 19 | DynamicElement dc = (DynamicElement)parent; | |||||||||||||
| 20 | final Object nestedElement = dc.createDynamicElement(name.toLowerCase(Locale.US)); | |||||||||||||
16 | if (nestedElement != null) | 21 | if (nestedElement != null) | ||||||||||||
17 | nc = new NestedCreator(null) {...}; | 22 | nc = new NestedCreator(null) {...}; |
Row | Violation |
---|---|
1 | Type boolean of variable parent instanceof DynamicElementNS does not match with type boolean of variable parent instanceof DynamicElement |