File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/connections/AggressiveReleaseTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/unionsubclass/UnionSubclassTest.java | |||
Method name: void testBorrowedConnections()
|
Method name: void testUnionSubclass()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 6 | |||
1 | prepare();↵ | |||
2 | Session s = getSessionUnderTest();↵ | |||
3 | Connection conn = s.connection↵ | 1 | for ( Iterator iter = beings.iterator(); iter.hasNext(); ) {↵ | |
4 | ();↵ | 2 | Being b = (Being) iter.next();↵ | |
5 | assertTrue( ( ( SessionImpl ) s ).getJDBCContext().getConnectionManager().hasBorrowedConnection() );↵ | 3 | assertTrue( Hibernate.isInitialized( b.getLocation() ) );↵ | |
6 | conn.close();↵ | 4 | ↵ | |
7 | assertFalse( ( ( SessionImpl ) s ).getJDBCContext().getConnectionManager().hasBorrowedConnection↵ | 5 | assertNotNull( b.getLocation().getName() );↵ | |
8 | () );↵ | 6 | assertNotNull( b.getIdentity() );↵ | |
9 | release( s );↵ | 7 | ↵ | |
10 | done(); | 8 | assertNotNull( b.getSpecies() );↵ | |
9 |
| |||
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 | 40 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | prepare(); |
| 32 | assertNotNull(b.getLocation().getName()); | ||||||||||||||||||||||
2 | Session s = getSessionUnderTest(); | | ||||||||||||||||||||||||
3 | Connection conn = s.connection(); | | ||||||||||||||||||||||||
|
| 30 | Being b = (Being)iter.next(); | |||||||||||||||||||||||
4 | assertTrue(((SessionImpl)s).getJDBCContext().getConnectionManager().hasBorrowedConnection()); |
| 31 | assertTrue(Hibernate.isInitialized(b.getLocation())); | ||||||||||||||||||||||
5 | conn.close(); | | ||||||||||||||||||||||||
6 | assertFalse(((SessionImpl)s).getJDBCContext().getConnectionManager().hasBorrowedConnection()); | | ||||||||||||||||||||||||
7 | release(s); | | ||||||||||||||||||||||||
8 | done(); |
| 33 | assertNotNull(b.getIdentity()); | ||||||||||||||||||||||
| 34 | assertNotNull(b.getSpecies()); |
Row | Violation |
---|---|
1 | Expression assertNotNull(b.getLocation().getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression prepare() is a void method call, and thus it cannot be parameterized |
3 | Expression assertNotNull(b.getLocation().getName()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertNotNull(b.getLocation().getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression prepare() is a void method call, and thus it cannot be parameterized |
6 | Expression assertNotNull(b.getLocation().getName()) is a void method call, and thus it cannot be parameterized |
7 | Unmatched statement Being b=(Being)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Expression ((SessionImpl)s).getJDBCContext().getConnectionManager().hasBorrowedConnection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression Hibernate.isInitialized(b.getLocation()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression assertNotNull(b.getIdentity()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression done() is a void method call, and thus it cannot be parameterized |
12 | Expression assertNotNull(b.getIdentity()) is a void method call, and thus it cannot be parameterized |
13 | Expression assertNotNull(b.getIdentity()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression done() is a void method call, and thus it cannot be parameterized |
15 | Expression assertNotNull(b.getIdentity()) is a void method call, and thus it cannot be parameterized |