He-Pin commented on code in PR #392:
URL: 
https://github.com/apache/pekko-persistence-jdbc/pull/392#discussion_r2573046001


##########
core/src/main/scala/org/apache/pekko/persistence/jdbc/testkit/internal/SchemaUtilsImpl.scala:
##########
@@ -202,7 +202,8 @@ private[jdbc] object SchemaUtilsImpl {
   @InternalApi
   private[jdbc] def fromClasspathAsString(fileName: String): String = {
     val is = getClass.getClassLoader.getResourceAsStream(fileName)
-    io.Source.fromInputStream(is).mkString
+    try io.Source.fromInputStream(is).mkString
+    finally is.close()

Review Comment:
   IIRC, we can use `using` too, not sure if`try with resource` works in Scala.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to