File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/zip/ZipLongTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/zip/ZipShortTest.java | |||
Method name: void testEquals()
|
Method name: void testEquals()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | ZipLong zl = new ZipLong(0x12345678);↵ | 1 | ZipShort zs = new ZipShort(0x1234);↵ | |
2 | ZipLong zl2 = new ZipLong(0x12345678);↵ | 2 | ZipShort zs2 = new ZipShort(0x1234);↵ | |
3 | ZipLong zl3 = new ZipLong(0x87654321);↵ | 3 | ZipShort zs3 = new ZipShort(0x5678);↵ | |
4 | assertTrue("reflexive", zl.equals(zl));↵ | 4 | assertTrue("reflexive", zs.equals(zs));↵ | |
5 | assertTrue("works", zl.equals(zl2));↵ | 5 | assertTrue("works", zs.equals(zs2));↵ | |
6 | assertTrue("works, part two", !zl.equals(zl3));↵ | 6 | assertTrue("works, part two", !zs.equals(zs3));↵ | |
7 | assertTrue("symmetric", zl2.equals(zl));↵ | 7 | assertTrue("symmetric", zs2.equals(zs));↵ | |
8 | assertTrue("null handling", !zl.equals(null));↵ | 8 | assertTrue("null handling", !zs.equals(null));↵ | |
9 | assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234))); | 9 | assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234))); | |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 81 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ZipShort zs = new ZipShort(0x1234); | |||||||||||||||||||||||
1 | ZipLong zl = new ZipLong(0x12345678); | | |||||||||||||||||||||||
| 2 | ZipShort zs2 = new ZipShort(0x1234); | |||||||||||||||||||||||
2 | ZipLong zl2 = new ZipLong(0x12345678); | | |||||||||||||||||||||||
| 3 | ZipShort zs3 = new ZipShort(0x5678); | |||||||||||||||||||||||
3 | ZipLong zl3 = new ZipLong(0x87654321); | | |||||||||||||||||||||||
4 | assertTrue("reflexive", zl.equals(zl)); |
| 4 | assertTrue("reflexive", zs.equals(zs)); | |||||||||||||||||||||
5 | assertTrue("works", zl.equals(zl2)); |
| 5 | assertTrue("works", zs.equals(zs2)); | |||||||||||||||||||||
6 | assertTrue("works, part two", !zl.equals(zl3)); |
| 6 | assertTrue("works, part two", !zs.equals(zs3)); | |||||||||||||||||||||
7 | assertTrue("symmetric", zl2.equals(zl)); |
| 7 | assertTrue("symmetric", zs2.equals(zs)); | |||||||||||||||||||||
8 | assertTrue("null handling", !zl.equals(null)); |
| 8 | assertTrue("null handling", !zs.equals(null)); | |||||||||||||||||||||
| 9 | assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234))); | |||||||||||||||||||||||
9 | assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234))); | |
Row | Violation |
---|---|
1 | Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs |
2 | Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs |
3 | Type org.apache.tools.zip.ZipLong of variable zl2 does not match with type org.apache.tools.zip.ZipShort of variable zs2 |
4 | Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs |
5 | Type org.apache.tools.zip.ZipLong of variable zl3 does not match with type org.apache.tools.zip.ZipShort of variable zs3 |
6 | Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs |
7 | Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs |
8 | Type org.apache.tools.zip.ZipLong of variable zl2 does not match with type org.apache.tools.zip.ZipShort of variable zs2 |
9 | Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs |