@@ -293,38 +293,32 @@ protected CompletionStage<Void> cleanDb() {
293
293
}
294
294
295
295
protected static CompletionStage <Void > closeSession (Object closable ) {
296
- if ( closable instanceof CompletionStage <?> ) {
297
- CompletionStage <?> closableStage = (CompletionStage <?>) closable ;
296
+ if ( closable instanceof CompletionStage <?> closableStage ) {
298
297
return closableStage .thenCompose ( BaseReactiveTest ::closeSession );
299
298
}
300
- if ( closable instanceof Uni <?> ) {
301
- Uni <?> closableUni = (Uni <?>) closable ;
299
+ if ( closable instanceof Uni <?> closableUni ) {
302
300
return closableUni .subscribeAsCompletionStage ()
303
301
.thenCompose ( BaseReactiveTest ::closeSession );
304
302
}
305
- if ( closable instanceof ReactiveConnection ) {
306
- return ( ( ReactiveConnection ) closable ) .close ();
303
+ if ( closable instanceof ReactiveConnection reactiveConnection ) {
304
+ return reactiveConnection .close ();
307
305
}
308
- if ( closable instanceof Mutiny .Session ) {
309
- Mutiny .Session mutiny = (Mutiny .Session ) closable ;
306
+ if ( closable instanceof Mutiny .Session mutiny ) {
310
307
if ( mutiny .isOpen () ) {
311
308
return mutiny .close ().subscribeAsCompletionStage ();
312
309
}
313
310
}
314
- if ( closable instanceof Stage .Session ) {
315
- Stage .Session stage = (Stage .Session ) closable ;
311
+ if ( closable instanceof Stage .Session stage ) {
316
312
if ( stage .isOpen () ) {
317
313
return stage .close ();
318
314
}
319
315
}
320
- if ( closable instanceof Mutiny .StatelessSession ) {
321
- Mutiny .StatelessSession mutiny = (Mutiny .StatelessSession ) closable ;
316
+ if ( closable instanceof Mutiny .StatelessSession mutiny ) {
322
317
if ( mutiny .isOpen () ) {
323
318
return mutiny .close ().subscribeAsCompletionStage ();
324
319
}
325
320
}
326
- if ( closable instanceof Stage .StatelessSession ) {
327
- Stage .StatelessSession stage = (Stage .StatelessSession ) closable ;
321
+ if ( closable instanceof Stage .StatelessSession stage ) {
328
322
if ( stage .isOpen () ) {
329
323
return stage .close ();
330
324
}
0 commit comments