rzo1 commented on code in PR #3572:
URL: https://github.com/apache/storm/pull/3572#discussion_r1309795216


##########
storm-webapp/src/test/java/org/apache/storm/daemon/logviewer/handler/LogviewerLogSearchHandlerTest.java:
##########
@@ -333,11 +330,16 @@ public void testNextByteOffsetsAreCorrectForEachMatch() 
throws Exception {
                 dataAndExpected.add(new Tuple3<>(12, 12, null));
                 dataAndExpected.add(new Tuple3<>(13, 12, null));
 
-                dataAndExpected.forEach(Unchecked.consumer(data -> {
-                    Map<String, Object> result = 
handler.substringSearch(file.toPath(), pattern, data.v1());
-                    assertEquals(data.v3(), result.get("nextByteOffset"));
-                    assertEquals(data.v2().intValue(), ((List) 
result.get("matches")).size());
-                }));
+                dataAndExpected.forEach(data -> {
+                    Map<String, Object> result;
+                    try {
+                        result = handler.substringSearch(file.toPath(), 
pattern, data.value1);
+                        assertEquals(data.value3, 
result.get("nextByteOffset"));
+                        assertEquals(data.value2.intValue(), ((List) 
result.get("matches")).size());
+                    } catch (InvalidRequestException e) {
+                        throw new RuntimeException(e);

Review Comment:
   This is actually a unit test, so no regression here for older code. I think 
you are referring to the JOOQ removal from `Unchecked.function(...)` to 
`try-catch`. 
   
   `Unchecked.function(...)` is implemented as:
   
   ```bash
      try {
                   return function.apply(t);
               }
               catch (Throwable e) {
                   handler.accept(e);
   
                   throw new IllegalStateException("Exception handler must 
throw a RuntimeException", e);
               }
   ```
   
   so I think we are good here. The exception handler is 
`THROWABLE_TO_RUNTIME_EXCEPTION` :-)



-- 
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: dev-unsubscr...@storm.apache.org

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

Reply via email to