RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE

2023-03-29 Thread Mandy Chung
A simple fix to `Method::invoke` which wraps IAE with `InvocationTargetException` twice if it's thrown by a caller-sensitive method which has no adapter. - Commit messages: - 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE Changes

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE

2023-03-29 Thread Joe Darcy
On Wed, 29 Mar 2023 21:26:24 GMT, Mandy Chung wrote: > A simple fix to `Method::invoke` which wraps IAE with > `InvocationTargetException` twice if it's thrown by a caller-sensitive method > which has no adapter. Looks fine. - Marked as reviewed by darcy (Reviewer). PR Review: h

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE

2023-03-29 Thread Chen Liang
On Wed, 29 Mar 2023 21:26:24 GMT, Mandy Chung wrote: > A simple fix to `Method::invoke` which wraps IAE with > `InvocationTargetException` twice if it's thrown by a caller-sensitive method > which has no adapter. test/jdk/java/lang/reflect/Method/CallerSensitiveMethodInvoke.java line 56: > 54

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE

2023-03-29 Thread Mandy Chung
On Wed, 29 Mar 2023 23:58:59 GMT, Chen Liang wrote: >> A simple fix to `Method::invoke` which wraps IAE with >> `InvocationTargetException` twice if it's thrown by a caller-sensitive >> method which has no adapter. > > test/jdk/java/lang/reflect/Method/CallerSensitiveMethodInvoke.java line 56:

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE

2023-03-29 Thread Chen Liang
On Thu, 30 Mar 2023 00:40:46 GMT, Mandy Chung wrote: >> test/jdk/java/lang/reflect/Method/CallerSensitiveMethodInvoke.java line 56: >> >>> 54: Method m = Field.class.getDeclaredMethod("get", >>> Object.class); >>> 55: m.invoke(f, new Object()); >>> 56: } catch (I

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE

2023-03-29 Thread Mandy Chung
On Thu, 30 Mar 2023 00:50:11 GMT, Chen Liang wrote: >> not following what you mean. Can you elaborate? > > Though very unlikely, I recommend adding a line of `Assertions.fail("Should > not reach here");` after the `m.invoke` and before the catch to ensure the > invocation always throw `Invocat

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE [v2]

2023-03-29 Thread Mandy Chung
> A simple fix to `Method::invoke` which wraps IAE with > `InvocationTargetException` twice if it's thrown by a caller-sensitive method > which has no adapter. Mandy Chung has updated the pull request incrementally with one additional commit since the last revision: the test should fail if M

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE [v2]

2023-03-29 Thread Jaikiran Pai
On Thu, 30 Mar 2023 01:15:33 GMT, Mandy Chung wrote: >> A simple fix to `Method::invoke` which wraps IAE with >> `InvocationTargetException` twice if it's thrown by a caller-sensitive >> method which has no adapter. > > Mandy Chung has updated the pull request incrementally with one additional

Re: RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE [v2]

2023-03-30 Thread Alan Bateman
On Thu, 30 Mar 2023 01:15:33 GMT, Mandy Chung wrote: >> A simple fix to `Method::invoke` which wraps IAE with >> `InvocationTargetException` twice if it's thrown by a caller-sensitive >> method which has no adapter. > > Mandy Chung has updated the pull request incrementally with one additional