RFR: 8263233: Update java.net and java.nio to use instanceof pattern variable [v3]

Chris Hegarty chegar at openjdk.java.net
Wed Mar 10 09:38:12 UTC 2021


On Tue, 9 Mar 2021 20:52:19 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:

>> The disadvantage is that it would add another level of braces.
>
> maybe ... I find it would provide an easier flow to code  ... an "easy on the eye" call flow linkage - the variable is declared and then used  .... instead of the disconnect of throwing an exception or non immediate use of the variable. 
> 
> but sure,  isn't code somewhat idiosyncratic!!

The first few times I looked at this pattern, I did stumble over it somewhat. But since then, I find it natural enough and easy to follow. Maybe the concern is transient in nature, until the instanceof pattern matching feature is more widely used.

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

PR: https://git.openjdk.java.net/jdk/pull/2890


More information about the net-dev mailing list