File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/AbstractFileSetTest.java | |||
Method name: void testEmptyElementIfIsReference()
|
Method name: void testEmptyElementIfIsReference()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | try {↵ | 1 | try {↵ | |
2 | f.setRefid(new Reference("dummyref"));↵ | 2 | f.setRefid(new Reference("dummyref"));↵ | |
3 | fail("Can add reference to "↵ | 3 | fail("Can add reference to "↵ | |
4 | + f.getDataTypeName()↵ | 4 | + f.getDataTypeName()↵ | |
5 | + " with elements from setIncludes");↵ | 5 | + " with nested patternset element.");↵ | |
6 | } catch (BuildException be) {↵ | 6 | } catch (BuildException be) {↵ | |
7 | assertEquals("You must not specify more than one attribute "↵ | 7 | assertEquals("You must not specify nested elements when "↵ | |
8 | + "when using refid", be.getMessage());↵ | 8 | + "using refid", be.getMessage());↵ | |
9 | }↵ | 9 | }↵ | |
10 | f = getInstance();↵ | 10 | f = getInstance();↵ | |
11 | f.createPatternSet();↵ | 11 | f.createInclude();↵ | |
12 | try {↵ | 12 | try {↵ | |
13 | f.setRefid(new Reference("dummyref"));↵ | 13 | f.setRefid(new Reference("dummyref"));↵ | |
14 | fail("Can add reference to "↵ | 14 | fail("Can add reference to "↵ | |
15 | + f.getDataTypeName()↵ | 15 | + f.getDataTypeName()↵ | |
16 | + " with nested patternset element.");↵ | 16 | + " with nested include element.");↵ | |
17 | } catch (BuildException be) {↵ | 17 | } catch (BuildException be) {↵ | |
18 | assertEquals("You must not specify nested elements when "↵ | 18 | assertEquals("You must not specify more than one attribute "↵ | |
19 | + "using refid", be.getMessage());↵ | 19 | + "when using refid", be.getMessage());↵ | |
20 | }↵ | 20 | }↵ | |
21 | f = getInstance(); | 21 |
| |
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.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 34 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 1 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | try | 13 | try | |||||||||||
4 | f.setRefid(new Reference("dummyref")); | 14 | f.setRefid(new Reference("dummyref")); | |||||||||||
5 | fail("Can add reference to " + f.getDataTypeName() + " with elements from setIncludes"); |
| 15 | fail("Can add reference to " + f.getDataTypeName() + " with nested include element."); | ||||||||||
6 | f = getInstance(); | 11 | f = getInstance(); | |||||||||||
7 | f.createPatternSet(); |
| | |||||||||||
8 | try | 8 | try | |||||||||||
9 | f.setRefid(new Reference("dummyref")); | 9 | f.setRefid(new Reference("dummyref")); | |||||||||||
10 | fail("Can add reference to " + f.getDataTypeName() + " with nested patternset element."); | 10 | fail("Can add reference to " + f.getDataTypeName() + " with nested patternset element."); | |||||||||||
11 | f = getInstance(); | 11 | f = getInstance(); | |||||||||||
| 12 | f.createInclude(); | ||||||||||||
| 16 | f = getInstance(); |
Row | Violation |
---|---|
1 | Unmatched statement f.createPatternSet(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |