File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PathTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PathTest.java | |||
Method name: void testEmptyElementIfIsReference()
|
Method name: void testEmptyElementIfIsReference()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | try {↵ | 1 | try {↵ | |
2 | p.addFileset(new FileSet());↵ | 2 | p.addFilelist(new FileList());↵ | |
3 | fail("Can add nested FileSet in Path that is a reference.");↵ | 3 | fail("Can add nested FileList in Path that is a reference.");↵ | |
4 | } catch (BuildException be) {↵ | 4 | } catch (BuildException be) {↵ | |
5 | assertEquals("You must not specify nested elements when using refid",↵ | 5 | assertEquals("You must not specify nested elements when using refid",↵ | |
6 | be.getMessage());↵ | 6 | be.getMessage());↵ | |
7 | }↵ | 7 | }↵ | |
8 | try {↵ | 8 | try {↵ | |
9 | p.addFilelist(new FileList());↵ | 9 | p.addDirset(new DirSet());↵ | |
10 | fail("Can add nested FileList in Path that is a reference.");↵ | 10 | fail("Can add nested Dirset in Path that is a reference.");↵ | |
11 | } catch (BuildException be) {↵ | 11 | } catch (BuildException be) {↵ | |
12 | assertEquals("You must not specify nested elements when using refid",↵ | 12 | assertEquals("You must not specify nested elements when using refid",↵ | |
13 | be.getMessage());↵ | 13 | be.getMessage());↵ | |
14 | } | 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.4 |
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) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26 | try | 29 | try | ||||||||||||||||||
27 | p.addFileset(new FileSet()); |
| 30 | p.addFilelist(new FileList()); | |||||||||||||||||
28 | fail("Can add nested FileSet in Path that is a reference."); |
| 31 | fail("Can add nested FileList in Path that is a reference."); | |||||||||||||||||
29 | try | 32 | try | ||||||||||||||||||
30 | p.addFilelist(new FileList()); |
| 33 | p.addDirset(new DirSet()); | |||||||||||||||||
31 | fail("Can add nested FileList in Path that is a reference."); |
| 34 | fail("Can add nested Dirset in Path that is a reference."); |
Row | Violation |
---|---|
1 | Expression p.addFileset(new FileSet()) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression p.addFilelist(new FileList()) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
3 | Expression p.addFileset(new FileSet()) is a void method call, and thus it cannot be parameterized |
4 | Expression p.addFilelist(new FileList()) is a void method call, and thus it cannot be parameterized |
5 | Expression p.addFilelist(new FileList()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression p.addDirset(new DirSet()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression p.addFilelist(new FileList()) is a void method call, and thus it cannot be parameterized |
8 | Expression p.addDirset(new DirSet()) is a void method call, and thus it cannot be parameterized |