File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/FixedMillisecondTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/YearTests.java | |||
Method name: void testHashcode()
|
Method name: void testHashcode()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | FixedMillisecond m1 = new FixedMillisecond(500000L);↵ | |||
2 | FixedMillisecond m2 = new FixedMillisecond(500000L↵ | 1 | Year y1 = new Year(1988);↵ | |
3 | );↵ | 2 | Year y2 = new Year(1988);↵ | |
4 | assertTrue(m1.equals(m2));↵ | 3 | assertTrue(y1.equals(y2));↵ | |
5 | int h1 = m1.hashCode();↵ | 4 | int h1 = y1.hashCode();↵ | |
6 | int h2 = m2.hashCode();↵ | 5 | int h2 = y2.hashCode();↵ | |
7 | assertEquals(h1, h2); | 6 |
| |
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 | 19 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | FixedMillisecond m1 = new FixedMillisecond(500000L); |
| 1 | Year y1 = new Year(1988); | ||||||||||||||||||||||||||||
2 | FixedMillisecond m2 = new FixedMillisecond(500000L); |
| 2 | Year y2 = new Year(1988); | ||||||||||||||||||||||||||||
3 | assertTrue(m1.equals(m2)); |
| 3 | assertTrue(y1.equals(y2)); | ||||||||||||||||||||||||||||
4 | int h1 = m1.hashCode(); |
| 4 | int h1 = y1.hashCode(); | ||||||||||||||||||||||||||||
5 | int h2 = m2.hashCode(); |
| 5 | int h2 = y2.hashCode(); | ||||||||||||||||||||||||||||
6 | assertEquals(h1, h2); | 6 | assertEquals(h1, h2); |
Row | Violation |
---|---|
1 | Expression new FixedMillisecond(500000L) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new Year(1988) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type long of variable 500000L does not match with type int of variable 1988 |
4 | Expression new FixedMillisecond(500000L) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression new Year(1988) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type long of variable 500000L does not match with type int of variable 1988 |