Copilot commented on code in PR #4243:
URL: https://github.com/apache/streampark/pull/4243#discussion_r2111535684
##########
streampark-common/src/main/scala/org/apache/streampark/common/util/Implicits.scala:
##########
@@ -55,17 +54,25 @@ object Implicits extends ToScalaImplicits with
ToJavaImplicits with DecorateAsJa
type JavaShort = java.lang.Short
implicit class AutoCloseImplicits[T <: AutoCloseable](autoCloseable: T) {
-
- implicit def autoClose[R](func: T => R)(implicit excFunc: Throwable => R =
null): R = {
+ implicit def using[R](func: T => R)(implicit excFunc: Throwable => R =
null): R = {
+ var exception: Option[Throwable] = null
Review Comment:
Initialize 'exception' with Option.empty instead of null to avoid potential
NullPointerExceptions when calling exception.foreach.
```suggestion
var exception: Option[Throwable] = Option.empty
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]