Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/16116#discussion_r90604612
--- Diff:
repl/src/test/scala/org/apache/spark/repl/ExecutorClassLoaderSuite.scala ---
@@ -118,8 +115,17 @@ class ExecutorClassLoaderSuite
val resourceName: String = parentResourceNames.head
val is = classLoader.getResourceAsStream(resourceName)
assert(is != null, s"Resource $resourceName not found")
- val content = Source.fromInputStream(is, "UTF-8").getLines().next()
- assert(content.contains("resource"), "File doesn't contain 'resource'")
+
+ var bufferedSource: BufferedSource = null
+ Utils.tryWithSafeFinally {
+ bufferedSource = Source.fromInputStream(is, "UTF-8")
--- End diff --
Can this line be outside the try block? if it fails, there's nothing to
clean up. Then you don't need a var
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]