Skip to content

Commit 687e5cd

Browse files
committed
remove unnecessary casts
1 parent 5f516cb commit 687e5cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hibernate-testing/src/main/java/org/hibernate/testing/transaction/TransactionUtil2.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class TransactionUtil2 {
2828
public static void inSession(SessionFactoryImplementor sfi, Consumer<SessionImplementor> action) {
2929
log.trace( "#inSession(SF,action)" );
3030

31-
try (SessionImplementor session = (SessionImplementor) sfi.openSession()) {
31+
try (SessionImplementor session = sfi.openSession()) {
3232
log.trace( "Session opened, calling action" );
3333
action.accept( session );
3434
log.trace( "called action" );
@@ -41,7 +41,7 @@ public static void inSession(SessionFactoryImplementor sfi, Consumer<SessionImpl
4141
public static <R> R fromSession(SessionFactoryImplementor sfi, Function<SessionImplementor,R> action) {
4242
log.trace( "#inSession(SF,action)" );
4343

44-
try (SessionImplementor session = (SessionImplementor) sfi.openSession()) {
44+
try (SessionImplementor session = sfi.openSession()) {
4545
log.trace( "Session opened, calling action" );
4646
return action.apply( session );
4747
}
@@ -54,7 +54,7 @@ public static <R> R inSessionReturn(SessionFactoryImplementor sfi, Function<Sess
5454
log.trace( "#inSession(SF,action)" );
5555

5656
R result = null;
57-
try (SessionImplementor session = (SessionImplementor) sfi.openSession()) {
57+
try (SessionImplementor session = sfi.openSession()) {
5858
log.trace( "Session opened, calling action" );
5959
result = action.apply( session );
6060
log.trace( "called action" );

0 commit comments

Comments
 (0)