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: 6 | Number of AST nodes: 6 | |||
1 | try {↵ | 1 | try {↵ | |
2 | f.setIncludes("**/*.java");↵ | 2 | f.setExcludes("**/*.java");↵ | |
3 | fail("Can set includes in "↵ | 3 | fail("Can set excludes in "↵ | |
4 | + f.getDataTypeName()↵ | 4 | + f.getDataTypeName()↵ | |
5 | + " that is a reference.");↵ | 5 | + " that is a reference.");↵ | |
6 | } catch (BuildException be) {↵ | 6 | } catch (BuildException be) {↵ | |
7 | assertEquals("You must not specify more than one attribute "↵ | 7 | assertEquals("You must not specify more than one attribute "↵ | |
8 | + "when using refid", be.getMessage());↵ | 8 | + "when using refid", be.getMessage());↵ | |
9 | }↵ | 9 | }↵ | |
10 | try {↵ | 10 | try {↵ | |
11 | f.setIncludesfile(new File("/a"));↵ | 11 | f.setExcludesfile(new File("/a"));↵ | |
12 | fail("Can set includesfile in "↵ | 12 | fail("Can set excludesfile in "↵ | |
13 | + f.getDataTypeName()↵ | 13 | + f.getDataTypeName()↵ | |
14 | + " that is a reference.");↵ | 14 | + " that is a reference.");↵ | |
15 | } catch (BuildException be) {↵ | 15 | } catch (BuildException be) {↵ | |
16 | assertEquals("You must not specify more than one attribute "↵ | 16 | assertEquals("You must not specify more than one attribute "↵ | |
17 | + "when using refid", be.getMessage());↵ | 17 | + "when using refid", be.getMessage());↵ | |
18 | } | 18 |
| |
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 | 28 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18 | try | 24 | try | |||||||||||||||
19 | f.setIncludes("**/*.java"); |
| 25 | f.setExcludes("**/*.java"); | ||||||||||||||
20 | fail("Can set includes in " + f.getDataTypeName() + " that is a reference."); |
| 26 | fail("Can set excludes in " + f.getDataTypeName() + " that is a reference."); | ||||||||||||||
21 | try | 27 | try | |||||||||||||||
22 | f.setIncludesfile(new File("/a")); |
| 28 | f.setExcludesfile(new File("/a")); | ||||||||||||||
23 | fail("Can set includesfile in " + f.getDataTypeName() + " that is a reference."); |
| 29 | fail("Can set excludesfile in " + f.getDataTypeName() + " that is a reference."); |
Row | Violation |
---|---|
1 | Expression f.setIncludes("**/*.java") is a void method call, and thus it cannot be parameterized |
2 | Expression f.setExcludes("**/*.java") is a void method call, and thus it cannot be parameterized |
3 | Expression f.setIncludesfile(new File("/a")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression f.setExcludesfile(new File("/a")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression f.setIncludesfile(new File("/a")) is a void method call, and thus it cannot be parameterized |
6 | Expression f.setExcludesfile(new File("/a")) is a void method call, and thus it cannot be parameterized |