File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/JoinedSubclassFilterTest.java | |||
Method name: void testFiltersWithUnionSubclass()
|
Method name: void testFiltersWithJoinedSubclass()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | while ( itr.hasNext() ) {↵ | 1 | while ( itr.hasNext() ) {↵ | |
2 | // find john↵ | 2 | // find john↵ | |
3 | final Person p = ( Person ) itr.next();↵ | 3 | final Person p = ( Person ) itr.next();↵ | |
4 | if ( p.getName().equals( "John Doe" ) ) {↵ | 4 | if ( p.getName().equals( "John Doe" ) ) {↵ | |
5 | Employee john = ( Employee ) p;↵ | 5 | Employee john = ( Employee ) p;↵ | |
6 | assertEquals( "Incorrect fecthed minions count", 1, john.getMinions().size() );↵ | 6 | assertEquals( "Incorrect fecthed minions count", 2, john.getMinions().size() );↵ | |
7 | break;↵ | 7 | break;↵ | |
8 | }↵ | 8 | }↵ | |
9 | } | 9 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 20 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27 | while (itr.hasNext()) | 22 | while (itr.hasNext()) | |||||||||||
28 | final Person p = (Person)itr.next(); | 23 | final Person p = (Person)itr.next(); | |||||||||||
29 | if (p.getName().equals("John Doe")) | 24 | if (p.getName().equals("John Doe")) | |||||||||||
30 | Employee john = (Employee)p; | 25 | Employee john = (Employee)p; | |||||||||||
31 | assertEquals("Incorrect fecthed minions count", 1, john.getMinions().size()); |
| 26 | assertEquals("Incorrect fecthed minions count", 2, john.getMinions().size()); | ||||||||||
32 | break; | 27 | break; |
Row | Violation |
---|