RFR: 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced [v6]
Brian Burkhalter
bpb at openjdk.java.net
Thu Mar 25 15:34:34 UTC 2021
On Sun, 21 Mar 2021 15:14:51 GMT, lyndseyBeil <github.com+81080647+lyndseyBeil at openjdk.org> wrote:
>> Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>>
>> - Merge
>> - 4833719: corrections pursuant to JDK-8263742
>> - 4833719: Corrected faux pas in correcting faux pas
>> - 4833719: Corrected faux pas in the slice(int,int) spec
>> - 4833719: Remove @apiNotes and "A similar consideration"
>> - 4833719: (bf) Views of MappedByteBuffers are not MappedByteBuffers, and cannot be forced
>
> test/jdk/java/nio/MappedByteBuffer/ForceViews.java line 48:
>
>> 46: public class ForceViews {
>> 47:
>> 48: static record Segment(int position, int length) {}
>
> I detect that this code is problematic. According to the [Bad practice (BAD_PRACTICE)](https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#bad-practice-bad-practice), [Nm: Method names should start with a lower case letter (NM_METHOD_NAMING_CONVENTION)](https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#nm-method-names-should-start-with-a-lower-case-letter-nm-method-naming-convention).
> Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
`Segment` is a `record`, not a method (cf. https://openjdk.java.net/jeps/395).
-------------
PR: https://git.openjdk.java.net/jdk/pull/2902
More information about the nio-dev
mailing list