Skip to content

Commit 6381339

Browse files
committed
228: Added unchecked exception
1 parent d4935da commit 6381339

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

java/sqlcommenter-java/src/main/java/com/google/cloud/sqlcommenter/r2dbc/ConnectionFactoryAspect.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.aspectj.lang.annotation.Aspect;
88
import org.reactivestreams.Publisher;
99

10-
import io.r2dbc.spi.Connection;
1110
import reactor.core.publisher.Mono;
1211
import reactor.core.publisher.Operators;
1312

@@ -16,11 +15,11 @@ public class ConnectionFactoryAspect {
1615

1716
@Around("execution(* io.r2dbc.spi.ConnectionFactory.create(..)) ")
1817
public Object beforeSampleCreation(ProceedingJoinPoint joinPoint) throws Throwable {
19-
Publisher<? extends Connection> publisher = (Publisher<? extends Connection>) joinPoint.proceed();
18+
Object object = joinPoint.proceed();
2019

20+
@SuppressWarnings("unchecked") Publisher<Object> publisher = (Publisher<Object>) object;
2121

2222
return Mono.from(publisher)
23-
.cast(Object.class)
2423
.transform(Operators.liftPublisher((publisher1, coreSubscriber) -> new ConnectionDecorator(coreSubscriber)));
2524
}
2625

0 commit comments

Comments
 (0)