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.ma...@oracle.com
<mailto:stuart.ma...@oracle.com>>
To: "ullenb...@gmail.com <mailto:ullenb...@gmail.com>"
<ullenb...@gmail.com <mailto:ullenb...@gmail.com>>
Cc: "core-libs-dev@openjdk.java.net
<mailto:core-libs-dev@openjdk.java.net>" <core-libs-dev@openjdk.java.net
<mailto:core-libs-dev@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