Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments [v3]

2020-10-28 Thread Mandy Chung
On Wed, 28 Oct 2020 15:00:59 GMT, Jorn Vernee wrote: >> Hi, >> >> Currently, if MethodHandles::permuteArguments is used with a reorder array >> that is the wrong size, or one of the indexes in it is out of bounds of the >> new type, we simply get the exception message: >> >> bad reorder

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments [v3]

2020-10-28 Thread Chris Hegarty
On Wed, 28 Oct 2020 14:30:30 GMT, Chris Hegarty wrote: >> I've added some negative tests that test for the different failure >> conditions. > > Thanks for adding additional test coverage @JornVernee. > > Writing a tight implementation of assertThrows is non-trivial - I'm not sure > that the

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments [v3]

2020-10-28 Thread Jorn Vernee
> Hi, > > Currently, if MethodHandles::permuteArguments is used with a reorder array > that is the wrong size, or one of the indexes in it is out of bounds of the > new type, we simply get the exception message: > > bad reorder array [...] > > I think we can improve the exception message

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments [v3]

2020-10-28 Thread Chris Hegarty
On Wed, 28 Oct 2020 14:57:44 GMT, Jorn Vernee wrote: >> Hi, >> >> Currently, if MethodHandles::permuteArguments is used with a reorder array >> that is the wrong size, or one of the indexes in it is out of bounds of the >> new type, we simply get the exception message: >> >> bad reorder

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments [v2]

2020-10-28 Thread Chris Hegarty
On Wed, 28 Oct 2020 13:32:19 GMT, Jorn Vernee wrote: >>> >>> >>> Seems like a reasonable change. Is there an already existing test for "bad" >>> permute args that could be expanded to discern the new exception message? >> >> There are several tests for permuteArguments, but none that

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments [v2]

2020-10-28 Thread Jorn Vernee
On Wed, 28 Oct 2020 11:52:17 GMT, Jorn Vernee wrote: >> Seems like a reasonable change. Is there an already existing test for "bad" >> permute args that could be expanded to discern the new exception message? > >> >> >> Seems like a reasonable change. Is there an already existing test for

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments [v2]

2020-10-28 Thread Jorn Vernee
> Hi, > > Currently, if MethodHandles::permuteArguments is used with a reorder array > that is the wrong size, or one of the indexes in it is out of bounds of the > new type, we simply get the exception message: > > bad reorder array [...] > > I think we can improve the exception message

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments

2020-10-28 Thread Jorn Vernee
On Wed, 28 Oct 2020 09:20:54 GMT, Aleksey Shipilev wrote: > > > This looks okay to me. Someone from core-libs should take a look as well. > > As the follow-up, maybe reconcile that method returns normally only with > `true`, and throws exceptions otherwise. There are some uses like >

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments

2020-10-28 Thread Jorn Vernee
On Wed, 28 Oct 2020 10:19:58 GMT, Chris Hegarty wrote: > > > Seems like a reasonable change. Is there an already existing test for "bad" > permute args that could be expanded to discern the new exception message? There are several tests for permuteArguments, but none that explicitly test

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments

2020-10-28 Thread Chris Hegarty
On Wed, 28 Oct 2020 09:20:54 GMT, Aleksey Shipilev wrote: >> Hi, >> >> Currently, if MethodHandles::permuteArguments is used with a reorder array >> that is the wrong size, or one of the indexes in it is out of bounds of the >> new type, we simply get the exception message: >> >> bad

Re: RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments

2020-10-28 Thread Aleksey Shipilev
On Tue, 27 Oct 2020 12:43:47 GMT, Jorn Vernee wrote: > Hi, > > Currently, if MethodHandles::permuteArguments is used with a reorder array > that is the wrong size, or one of the indexes in it is out of bounds of the > new type, we simply get the exception message: > > bad reorder array

RFR: 8255449: Improve the exception message of MethodHandles::permuteArguments

2020-10-27 Thread Jorn Vernee
Hi, Currently, if MethodHandles::permuteArguments is used with a reorder array that is the wrong size, or one of the indexes in it is out of bounds of the new type, we simply get the exception message: bad reorder array [...] I think we can improve the exception message by splitting these