srowen commented on a change in pull request #24241: 
[SPARK-27323][CORE][SQL][STREAMING] Use Single-Abstract-Method support in Scala 
2.12 to simplify code
URL: https://github.com/apache/spark/pull/24241#discussion_r270986495
 
 

 ##########
 File path: 
core/src/test/scala/org/apache/spark/deploy/worker/DriverRunnerTest.scala
 ##########
 @@ -57,11 +56,9 @@ class DriverRunnerTest extends SparkFunSuite {
       superviseRetry: Boolean) = {
     val runner = createDriverRunner()
     runner.setSleeper(mock(classOf[Sleeper]))
-    doAnswer(new Answer[Int] {
-      def answer(invocation: InvocationOnMock): Int = {
-        runner.runCommandWithRetry(processBuilder, p => (), supervise = 
superviseRetry)
-      }
-    }).when(runner).prepareAndRunDriver()
+    doAnswer((_: InvocationOnMock) =>
 
 Review comment:
   I can change it. I don't have a strong preference. I default to not using 
blocks where not necessary, but for non-trivial blocks it's probably clearer to 
use them anyway

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


With regards,
Apache Git Services

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

Reply via email to