Re: ByteArrayOutputStream should not have a new writeBytes method in Java 11

2018-09-12 Thread Stuart Marks
On 9/11/18 10:36 PM, Michael Rasmussen wrote: Can a language syntax/feature be deprecated to produce a warning in javac? Perhaps this one should. We haven't reached the point of formally deprecating language features, but certain features like this one (and others) are certainly frowned

Re: ByteArrayOutputStream should not have a new writeBytes method in Java 11

2018-09-11 Thread Michael Rasmussen
> I noticed a few others nearby. It's startling that a new occurrence has crept > it. At least I haven't seen it on return types, like: public byte toArray() [] { ... } > An interesting exercise would be to write a detector for this declaration > style. Can a language syntax/feature be

Re: ByteArrayOutputStream should not have a new writeBytes method in Java 11

2018-09-11 Thread Martin Buchholz
It's an errorprone warning, for "easy" removal ... __IF__ you can run errorprone on the head sources. I think it's http://errorprone.info/bugpattern/MixedArrayDimensions On Tue, Sep 11, 2018 at 2:35 PM, Brian Burkhalter wrote: > > On Sep 11, 2018, at 1:23 PM, Stuart Marks wrote: > >>> 2. even

Re: ByteArrayOutputStream should not have a new writeBytes method in Java 11

2018-09-11 Thread Brian Burkhalter
On Sep 11, 2018, at 1:23 PM, Stuart Marks wrote: >> 2. even if, it should not be byte b[] but byte[] b > > Yeah we need to clean occurrences of this anachronistic array declaration > from the JDK. I noticed a few others nearby. It's startling that a new > occurrence has crept it. (Or maybe

Re: ByteArrayOutputStream should not have a new writeBytes method in Java 11

2018-09-11 Thread Stuart Marks
2. even if, it should not be byte b[] but byte[] b Yeah we need to clean occurrences of this anachronistic array declaration from the JDK. I noticed a few others nearby. It's startling that a new occurrence has crept it. (Or maybe not, perhaps it was done to conform to the nearby code.) Any

Re: ByteArrayOutputStream should not have a new writeBytes method in Java 11

2018-09-11 Thread Michael Rasmussen
See the comments here https://bugs.openjdk.java.net/browse/JDK-8180410 /Michael From: core-libs-dev on behalf of Christian Ullenboom Sent: 11 September 2018 01:18:42 To: core-libs-dev@openjdk.java.net Subject: ByteArrayOutputStream should not have a new

ByteArrayOutputStream should not have a new writeBytes method in Java 11

2018-09-11 Thread Christian Ullenboom
1. There is write(byte[]) already 2. even if, it should not be byte b[] but byte[] b