[ https://issues.apache.org/jira/browse/HIVE-25692?focusedWorklogId=680820&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-680820 ]
ASF GitHub Bot logged work on HIVE-25692: ----------------------------------------- Author: ASF GitHub Bot Created on: 12/Nov/21 13:59 Start Date: 12/Nov/21 13:59 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on a change in pull request #2782: URL: https://github.com/apache/hive/pull/2782#discussion_r748306930 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ExceptionHandler.java ########## @@ -55,13 +54,48 @@ public static ExceptionHandler handleException(Exception e) { /** * Throws if the input exception is the instance of the one in the input classes */ - public <T extends Exception> ExceptionHandler - throwIfInstance(Class ...te) throws T { - if (te != null) { - for (Class<T> t : te) { - throwIfInstance(t); - } - } + public <T1 extends Exception, + T2 extends Exception> + ExceptionHandler throwIfInstance( + Class<T1> te1, + Class<T2> te2) throws T1, T2 { + throwIfInstance(te1); + throwIfInstance(te2); + return this; + } + + /** + * Throws if the input exception is the instance of the one in the input classes + */ + public <T1 extends Exception, + T2 extends Exception, + T3 extends Exception> + ExceptionHandler throwIfInstance( + Class<T1> te1, + Class<T2> te2, + Class<T3> te3) throws T1, T2, T3 { + throwIfInstance(te1); + throwIfInstance(te2); + throwIfInstance(te3); + return this; + } + + /** + * Throws if the input exception is the instance of the one in the input classes + */ + public <T1 extends Exception, + T2 extends Exception, + T3 extends Exception, + T4 extends Exception> + ExceptionHandler throwIfInstance( Review comment: you are right - when I suspected this issue I changed one of the call sites which already had 3 arguments ...but then undone that change... removed -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 680820) Time Spent: 50m (was: 40m) > ExceptionHandler may mask checked exceptions > -------------------------------------------- > > Key: HIVE-25692 > URL: https://issues.apache.org/jira/browse/HIVE-25692 > Project: Hive > Issue Type: Bug > Reporter: Zoltan Haindrich > Assignee: Zoltan Haindrich > Priority: Major > Labels: pull-request-available > Time Spent: 50m > Remaining Estimate: 0h > > HIVE-25055 have changed the way exceptions as rethrowed - but one of the > methods may let checked exception out without them being declared on the > method (and avoid the compile time error for it) > testcase for: > org.apache.hadoop.hive.metastore.TestExceptionHandler > {code} > @Test > public void testInvalid() throws MetaException { > try { > throw new IOException("IOException test"); > } catch (Exception e) { > throw handleException(e).throwIfInstance(AccessControlException.class, > IOException.class).defaultMetaException(); > } > } > {code} > this testcase should not compile - as it may throw IOException or > AccessControlException as well -- This message was sent by Atlassian Jira (v8.20.1#820001)