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: 7 | Number of AST nodes: 7 | |||
1 | f = (ZipFileSet)getInstance();↵ | 1 | f = (TarFileSet)getInstance();↵ | |
2 | f.setSrc(new File("example.zip"));↵ | 2 | f.setSrc(new File("example.tar"));↵ | |
3 | f.setPrefix("/examples");↵ | 3 | f.setPrefix("/examples");↵ | |
4 | try {↵ | 4 | try {↵ | |
5 | f.setFullpath("/doc/manual/index.html");↵ | 5 | f.setFullpath("/doc/manual/index.html");↵ | |
6 | fail("Can add fullpath to "↵ | 6 | fail("Can add fullpath to "↵ | |
7 | + f.getDataTypeName()↵ | 7 | + f.getDataTypeName()↵ | |
8 | + " when a prefix is already present");↵ | 8 | + " when a prefix is already present");↵ | |
9 | } catch (BuildException be) {↵ | 9 | } catch (BuildException be) {↵ | |
10 | assertEquals("Cannot set both fullpath and prefix attributes", be.getMessage());↵ | 10 | assertEquals("Cannot set both fullpath and prefix attributes", be.getMessage());↵ | |
11 | }↵ | 11 | }↵ | |
12 | f = (ZipFileSet)getInstance(); | 12 | f = (TarFileSet)getInstance(); | |
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 | 25 |
Number of mapped statements | 7 |
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) | 39.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | f = (ZipFileSet)getInstance(); |
| 11 | f = (TarFileSet)getInstance(); | |||||||||||||
12 | f.setSrc(new File("example.zip")); |
| 12 | f.setSrc(new File("example.tar")); | |||||||||||||
13 | f.setPrefix("/examples"); |
| 13 | f.setPrefix("/examples"); | |||||||||||||
14 | try | 14 | try | ||||||||||||||
15 | f.setFullpath("/doc/manual/index.html"); |
| 15 | f.setFullpath("/doc/manual/index.html"); | |||||||||||||
16 | fail("Can add fullpath to " + f.getDataTypeName() + " when a prefix is already present"); |
| 16 | fail("Can add fullpath to " + f.getDataTypeName() + " when a prefix is already present"); | |||||||||||||
17 | f = (ZipFileSet)getInstance(); |
| 17 | f = (TarFileSet)getInstance(); |
Row | Violation |
---|---|
1 | 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 |