You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/05/31 17:36:44 UTC

[GitHub] [hadoop] goiri commented on a diff in pull request #4375: HDFS-16605. Improve Code With Lambda in hadoop-hdfs-rbf moudle.

goiri commented on code in PR #4375:
URL: https://github.com/apache/hadoop/pull/4375#discussion_r885918464


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/resolver/order/TestLocalResolver.java:
##########
@@ -78,12 +77,8 @@ public void testLocalResolver() throws IOException {
     StringBuilder sb = new StringBuilder("clientX");
     LocalResolver localResolver = new LocalResolver(conf, router);
     LocalResolver spyLocalResolver = spy(localResolver);
-    doAnswer(new Answer<String>() {
-      @Override
-      public String answer(InvocationOnMock invocation) throws Throwable {
-        return sb.toString();
-      }
-    }).when(spyLocalResolver).getClientAddr();
+    doAnswer((Answer<String>) invocation ->

Review Comment:
   The line split is a little weird. Maybe better as:
   ```
   doAnswer((Answer<String>) invocation -> sb.toString()
   ).when(spyLocalResolver).getClientAddr();
   ```



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org