File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java | |||
Method name: void testAttributes()
|
Method name: void testAttributes()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | f.setPrefix("/examples");↵ | 1 | f.setFullpath("/doc/manual/index.html");↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | f.setFullpath("/doc/manual/index.html");↵ | 3 | f.setPrefix("/examples");↵ | |
4 | fail("Can add fullpath to "↵ | 4 | fail("Can add prefix to "↵ | |
5 | + f.getDataTypeName()↵ | 5 | + f.getDataTypeName()↵ | |
6 | + " when a prefix is already present");↵ | 6 | + " when a fullpath is already present");↵ | |
7 | } catch (BuildException be) {↵ | 7 | } catch (BuildException be) {↵ | |
8 | assertEquals("Cannot set both fullpath and prefix attributes", be.getMessage());↵ | 8 | assertEquals("Cannot set both fullpath and prefix attributes", be.getMessage());↵ | |
9 | }↵ | 9 | }↵ | |
10 | // check that reference tarfilesets cannot have specific attributes↵ | |||
10 | f = (ZipFileSet)getInstance();↵ | 11 | f = (TarFileSet)getInstance();↵ | |
11 | f.setSrc(new File("example.zip")); | 12 | f.setRefid(new Reference("test")); | |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
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) | 95.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | f.setPrefix("/examples"); |
| 19 | f.setFullpath("/doc/manual/index.html"); | ||||||||||||||||||||||||
14 | try | 20 | try | |||||||||||||||||||||||||
15 | f.setFullpath("/doc/manual/index.html"); |
| 21 | f.setPrefix("/examples"); | ||||||||||||||||||||||||
16 | fail("Can add fullpath to " + f.getDataTypeName() + " when a prefix is already present"); |
| 22 | fail("Can add prefix to " + f.getDataTypeName() + " when a fullpath is already present"); | ||||||||||||||||||||||||
17 | f = (ZipFileSet)getInstance(); |
| 23 | f = (TarFileSet)getInstance(); | ||||||||||||||||||||||||
18 | f.setSrc(new File("example.zip")); |
| 24 | f.setRefid(new Reference("test")); |
Row | Violation |
---|---|
1 | Expression f.setPrefix("/examples") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression f.setFullpath("/doc/manual/index.html") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression f.setPrefix("/examples") is a void method call, and thus it cannot be parameterized |
4 | Expression f.setFullpath("/doc/manual/index.html") is a void method call, and thus it cannot be parameterized |
5 | Expression f.setFullpath("/doc/manual/index.html") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression f.setPrefix("/examples") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression f.setFullpath("/doc/manual/index.html") is a void method call, and thus it cannot be parameterized |
8 | Expression f.setPrefix("/examples") is a void method call, and thus it cannot be parameterized |
9 | Type java.io.File does not match with type org.apache.tools.ant.types.Reference |
10 | Expression f.setSrc(new File("example.zip")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression f.setRefid(new Reference("test")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression f.setSrc(new File("example.zip")) is a void method call, and thus it cannot be parameterized |
13 | Expression f.setRefid(new Reference("test")) is a void method call, and thus it cannot be parameterized |
14 | Clone fragment #1 returns variable f with type org.apache.tools.ant.types.ZipFileSet , while Clone fragment #2 returns variable f with type org.apache.tools.ant.types.TarFileSet |