File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FooBarTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FooBarTest.java | |||
Method name: void testQuery()
|
Method name: void testQuery()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | while ( rs.hasNext() ) {↵ | 1 | while ( rs.hasNext() ) {↵ | |
2 | count++;↵ | 2 | count++;↵ | |
3 | Object[] row = (Object[]) rs.next();↵ | 3 | Object[] row = (Object[]) rs.next();↵ | |
4 | assertTrue( row[0] instanceof Long );↵ | 4 | assertTrue( row[0] instanceof Double );↵ | |
5 | assertTrue( row[1] instanceof FooComponent );↵ | 5 | assertTrue( row[1] instanceof ↵ | |
6 | assertTrue( row[2] instanceof Foo );↵ | 6 | String );↵ | |
7 | assertTrue( row[3] instanceof Foo );↵ | 7 | assertTrue( row[2] instanceof Long );↵ | |
8 | } | 8 |
| |
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 42 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 5.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
182 | while (rs.hasNext()) | 172 | while (rs.hasNext()) | ||||||||||||||
183 | count++; | 173 | count++; | ||||||||||||||
184 | Object[] row = (Object[])rs.next(); | 174 | Object[] row = (Object[])rs.next(); | ||||||||||||||
185 | assertTrue(row[0] instanceof Long); |
| 175 | assertTrue(row[0] instanceof Double); | |||||||||||||
186 | assertTrue(row[1] instanceof FooComponent); |
| 176 | assertTrue(row[1] instanceof String); | |||||||||||||
187 | assertTrue(row[2] instanceof Foo); |
| 177 | assertTrue(row[2] instanceof Long); | |||||||||||||
188 | assertTrue(row[3] instanceof Foo); |
| |
Row | Violation |
---|---|
1 | Expression row[0] instanceof Long cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression row[0] instanceof Double cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression row[1] instanceof FooComponent cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression row[1] instanceof String cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type boolean of variable row[1] instanceof FooComponent does not match with type boolean of variable row[1] instanceof String |
6 | Expression row[2] instanceof Foo cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression row[2] instanceof Long cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Type boolean of variable row[2] instanceof Foo does not match with type boolean of variable row[2] instanceof Long |
9 | Unmatched statement assertTrue(row[3] instanceof Foo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Clone fragment #1 returns variables row, count , while Clone fragment #2 returns variables count |