ByteArrayOutputStream should not have a new writeBytes method in Java

Tomasz Linkowski t.linkowski at gmail.com
Wed Sep 12 05:34:34 UTC 2018


Hello Stuart,

I'm not sure whether you're aware that IntelliJ IDEA has an automatic
inspection named "C-style array declaration":
- description:
https://github.com/JetBrains/intellij-community/blob/master/plugins/InspectionGadgets/src/inspectionDescriptions/CStyleArrayDeclaration.html
- logic:
https://github.com/JetBrains/intellij-community/blob/master/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/CStyleArrayDeclarationInspection.java

You can run such single inspection over the entire project as described
here:
https://www.jetbrains.com/help/idea/running-inspection-by-name.html

It will fix all such C-style array declarations for you automatically.

-- 
Regards,
Tomasz Linkowski


From: Stuart Marks <stuart.marks at oracle.com>
> To: "ullenboom at gmail.com" <ullenboom at gmail.com>
> Cc: "core-libs-dev at openjdk.java.net" <core-libs-dev at openjdk.java.net>
> Bcc:
> Date: Tue, 11 Sep 2018 13:23:41 -0700
> Subject: Re: ByteArrayOutputStream should not have a new writeBytes method
> in Java 11



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 volunteers to clean this up?


> An interesting exercise would be to write a detector for this declaration
> style.


> s'marks


More information about the core-libs-dev mailing list