showuon commented on a change in pull request #10471:
URL: https://github.com/apache/kafka/pull/10471#discussion_r608491940



##########
File path: core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
##########
@@ -194,33 +192,18 @@ object ReassignPartitionsCommand extends Logging {
 
   def main(args: Array[String]): Unit = {
     val opts = validateAndParseArgs(args)
-    var toClose: Option[AutoCloseable] = None
     var failed = true
 
+    val props = if (opts.options.has(opts.commandConfigOpt))
+      Utils.loadProps(opts.options.valueOf(opts.commandConfigOpt))

Review comment:
       Good question. The lines I moved out of `try` block are props setup 
(which is safe), and `Admin.create`. I was trying to do try-with-resource in 
scala, but it can't. I moved the `Admin.create` back to try block. Thank you.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to