File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | NestedElement nestedElement = (NestedElement) i.next();↵ | 1 | Attribute attribute = (Attribute) i.next();↵ | |
2 | if (nestedElement.name == null) {↵ | 2 | if (attribute.name == null) {↵ | |
3 | throw new BuildException("scriptdef <element> elements "↵ | 3 | throw new BuildException("scriptdef <attribute> elements "↵ | |
4 | + "must specify an element name");↵ | 4 | + "must specify an attribute name");↵ | |
5 | }↵ | 5 | }↵ | |
6 | if (nestedElementMap.containsKey(nestedElement.name)) {↵ | 6 | if (attributeSet.contains(attribute.name)) {↵ | |
7 | throw new BuildException("scriptdef <" + name + "> declares "↵ | 7 | throw new BuildException("scriptdef <" + name + "> declares "↵ | |
8 | + "the " + nestedElement.name + " nested element more "↵ | 8 | + "the " + ↵ | |
9 | + "than once");↵ | 9 | attribute.name + " attribute more than once");↵ | |
10 | } | 10 |
| |
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.7 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |
Number of mapped statements | 2 |
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) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 10 | Attribute attribute = (Attribute)i.next(); | |||||||||||||||||
18 | NestedElement nestedElement = (NestedElement)i.next(); |
| | |||||||||||||||||
19 | if (nestedElement.name == null) |
| 11 | if (attribute.name == null) | ||||||||||||||||
20 | throw new BuildException("scriptdef <element> elements " + "must specify an element name"); |
| 12 | throw new BuildException("scriptdef <attribute> elements " + "must specify an attribute name"); |
Row | Violation |
---|---|
1 | Unmatched statement Attribute attribute=(Attribute)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement NestedElement nestedElement=(NestedElement)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression nestedElement.name cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression attribute.name cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type java.lang.String of variable nestedElement.name does not match with type java.lang.String of variable attribute.name |