NihalJain commented on code in PR #6783:
URL: https://github.com/apache/hbase/pull/6783#discussion_r2019171251


##########
hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java:
##########
@@ -1311,28 +1310,41 @@ public void stop() throws Exception {
     } catch (Exception e) {
       LOG.error("Error while stopping web app context for webapp " + 
webAppContext.getDisplayName(),
         e);
-      exception = addMultiException(exception, e);
+      exception.addSuppressed(e);
     }
 
     try {
       webServer.stop();
     } catch (Exception e) {
       LOG.error("Error while stopping web server for webapp " + 
webAppContext.getDisplayName(), e);
-      exception = addMultiException(exception, e);
+      exception.addSuppressed(e);

Review Comment:
   done



##########
hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java:
##########
@@ -1311,28 +1310,41 @@ public void stop() throws Exception {
     } catch (Exception e) {
       LOG.error("Error while stopping web app context for webapp " + 
webAppContext.getDisplayName(),
         e);
-      exception = addMultiException(exception, e);
+      exception.addSuppressed(e);
     }
 
     try {
       webServer.stop();
     } catch (Exception e) {
       LOG.error("Error while stopping web server for webapp " + 
webAppContext.getDisplayName(), e);
-      exception = addMultiException(exception, e);
+      exception.addSuppressed(e);
     }
 
     if (exception != null) {
-      exception.ifExceptionThrow();
+      ifExceptionThrow(exception);
     }
 
   }
 
-  private MultiException addMultiException(MultiException exception, Exception 
e) {
-    if (exception == null) {
-      exception = new MultiException();
+  /**
+   * Throw a {@link Throwable} as a checked {@link Exception} if it cannot be 
thrown as unchecked.
+   * <p>
+   * <b>NOTE: This method is copied from Jetty-9
+   * @param throwable The {@link Throwable} to throw or null.
+   * @throws Error     If the passed {@link Throwable} is an {@link Error}.
+   * @throws Exception Otherwise, if the passed {@link Throwable} is not null.
+   */
+  public static void ifExceptionThrow(Throwable throwable) throws Error, 
Exception {

Review Comment:
   reverted



-- 
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: [email protected]

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

Reply via email to