ByteArrayOutputStream should not have a new writeBytes method in Java

Stuart Marks stuart.marks at oracle.com
Wed Sep 12 21:01:03 UTC 2018


Cool, I didn't know that IntelliJ IDEA has such an inspection, but I'm not 
surprised.

Perhaps a volunteer can run this inspection over parts of the JDK code base and 
see what comes up, and possibly propose some patches. :-)

s'marks


On 9/11/18 10:34 PM, Tomasz Linkowski wrote:
> 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 <mailto:stuart.marks at oracle.com>>
>     To: "ullenboom at gmail.com <mailto:ullenboom at gmail.com>"
>     <ullenboom at gmail.com <mailto:ullenboom at gmail.com>>
>     Cc: "core-libs-dev at openjdk.java.net
>     <mailto:core-libs-dev at openjdk.java.net>" <core-libs-dev at openjdk.java.net
>     <mailto: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