xushiyan commented on a change in pull request #2112:
URL: https://github.com/apache/hudi/pull/2112#discussion_r495449296



##########
File path: 
hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestCommitsCommand.java
##########
@@ -76,17 +76,19 @@ public void init() throws IOException {
         "", TimelineLayoutVersion.VERSION_1, 
"org.apache.hudi.common.model.HoodieAvroPayload");
   }
 
-  private LinkedHashMap<String, Integer[]> generateData() {
+  private LinkedHashMap<String, Integer[]> generateData() throws Exception {
     // generate data and metadata
     LinkedHashMap<String, Integer[]> data = new LinkedHashMap<>();
     data.put("102", new Integer[] {15, 10});
     data.put("101", new Integer[] {20, 10});
     data.put("100", new Integer[] {15, 15});
 
-    data.forEach((key, value) -> {
+    for (Map.Entry<String, Integer[]> entry : data.entrySet()) {

Review comment:
       @yanghua In 
`HoodieTestCommitMetadataGenerator#createCommitFileWithMetadata` (refer to the 
comment above), I removed the try catch block by declaring the exception hence 
the callers need to declare it too. The callers' `forEach` force it to be 
caught therefore changed to for-loop. I'm trying to adopt a preference of 
declaring Exception over catching them and for-loop over Stream#forEach to 
avoid noisy try-catch. Please share your thoughts. 




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