RFR: 8295753: (fs) UnixPath::toRealPath does not return correct case when links not followed [v3]

Alan Bateman alanb at openjdk.org
Fri Nov 4 07:57:44 UTC 2022


On Thu, 3 Nov 2022 16:38:08 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>>> I think the algorithm is correct, just need to fix the strange intend at 907.
>> 
>> I assume you meant _indent(ation)_. If so, then I wonder what you'd consider as acceptable formatting here. Could `var` help not solve this problem by making 906-907 a one-liner instead? Or this would be too unusual for this class?
>
> Indentation modified in c193b3b48f56e2c581efaf212f2770c9add36a0a. There is no use of `var` in this class so far, thus although it is a good idea, `var` is not used here, either.

> If so, then I wonder what you'd consider as acceptable formatting here. Could `var` help not solve this problem by making 906-907 a one-liner instead? Or this would be too unusual for this class?

The main thing when reading this code is to satisfied that it implements the scan correctly and to see how it behaves when it can't open a directory or read the attributes of one of the entries in the directory. The issue with the version that were discussing is that it wasn't immediately obvious which code was in the try resources specification vs. try block. He's changed the indent so it is more obvious now, personally I would have put it one line and renamed it to "provider" so that it's the same name used elsewhere in this code.

-------------

PR: https://git.openjdk.org/jdk/pull/10843


More information about the nio-dev mailing list