Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-07-09 Thread Paul Sandoz
On Jul 8, 2015, at 8:55 PM, Martin Buchholz marti...@google.com wrote: On Wed, Jul 8, 2015 at 12:59 AM, Paul Sandoz paul.san...@oracle.com wrote: The comment remains correct even if 6260652 is fixed. I can't think up a clearly better one. I would recommend at least removing the

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-07-08 Thread Paul Sandoz
HI Martin, Sorry the late reply. On Jun 30, 2015, at 7:04 PM, Martin Buchholz marti...@google.com wrote: The comment remains correct even if 6260652 is fixed. I can't think up a clearly better one. I would recommend at least removing the issue id (since that refers specifically to

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-07-08 Thread Martin Buchholz
On Wed, Jul 8, 2015 at 12:59 AM, Paul Sandoz paul.san...@oracle.com wrote: The comment remains correct even if 6260652 is fixed. I can't think up a clearly better one. I would recommend at least removing the issue id (since that refers specifically to Arrays.asList rather than something

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-30 Thread Martin Buchholz
On Tue, Jun 30, 2015 at 3:02 AM, Paul Sandoz paul.san...@oracle.com wrote: On Jun 26, 2015, at 11:54 PM, Martin Buchholz marti...@google.com wrote: 10 years later ... still asking for approval to commit. https://bugs.openjdk.java.net/browse/JDK-6260652

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-30 Thread Paul Sandoz
On Jun 26, 2015, at 11:54 PM, Martin Buchholz marti...@google.com wrote: 10 years later ... still asking for approval to commit. https://bugs.openjdk.java.net/browse/JDK-6260652 http://cr.openjdk.java.net/~martin/webrevs/openjdk9/Arrays.asList.toArray/ +1. This is probably why there is

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-27 Thread Remi Forax
oh, doh, you're right :) I still think that the right type is Class? extends T[]. RĂ©mi On 06/27/2015 01:04 AM, Martin Buchholz wrote: On Fri, Jun 26, 2015 at 3:46 PM, Remi Forax fo...@univ-mlv.fr mailto:fo...@univ-mlv.fr wrote: as a matter of style, i prefer to always have curly

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-27 Thread Ivan Gerasimov
Hi Martin! Would it make sense to add a simple regression test with this fix? I guess, something like the following should suffice: import java.util.Arrays; public class Test { public static void main(String[] args) throws Throwable {

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-27 Thread Martin Buchholz
Ivan, Thanks for reminding me that I had already written a test for this, back before the beginning of time. Webrev updated. On Sat, Jun 27, 2015 at 6:43 AM, Ivan Gerasimov ivan.gerasi...@oracle.com wrote: Hi Martin! Would it make sense to add a simple regression test with this fix? I

RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-26 Thread Martin Buchholz
10 years later ... still asking for approval to commit. https://bugs.openjdk.java.net/browse/JDK-6260652 http://cr.openjdk.java.net/~martin/webrevs/openjdk9/Arrays.asList.toArray/

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-26 Thread Remi Forax
On 06/26/2015 11:54 PM, Martin Buchholz wrote: 10 years later ... still asking for approval to commit. https://bugs.openjdk.java.net/browse/JDK-6260652 http://cr.openjdk.java.net/~martin/webrevs/openjdk9/Arrays.asList.toArray/ +1 I was bitten once by the dubious implementation of toArray(),

Re: RFR: 6260652: (coll) Arrays.asList(x).toArray().getClass() should be Object[].class

2015-06-26 Thread Martin Buchholz
On Fri, Jun 26, 2015 at 3:46 PM, Remi Forax fo...@univ-mlv.fr wrote: as a matter of style, i prefer to always have curly braces after an 'if' Community opinion is moving your way, but I am holding out. and i think that the cast to (ClassT[]) is no longer needed (and false if one day