JEP proposed to target JDK 12: 325: Switch Expressions (Preview)

Brian Goetz brian.goetz at
Wed Aug 29 00:21:12 UTC 2018

I think there's a lot of misunderstanding about what Preview is, and is 
for, floating around.

A Preview language feature still needs to be Done, to the same level of 
Done, as a permanent feature.  The difference is that we have a (short) 
"grace period" where we have a chance to correct serious errors that 
have leaked past the usual process, without having to pay the 
Incompatibility Penalty.  With our new cadence, I expect that most 
non-trivial language features will go through the Preview mechanism 
going forward.  This does not mean they are experimental, or of lower 
quality, or have had less thought put into them.  But, it does sometimes 
happen that we discover unexpected interactions only after things have 
been tried by a broader audience, and for this, Preview gives us a short 
window to correct such issues if they are found early enough.

As to "but this is really just a foundation for a bigger feature", I 
think that will also be true of many more features in this new world, 
because the rapid cadence encourages us to break things down into 
smaller chunks where possible.  This feature did "sediment out" from the 
broader pattern match effort for earlier delivery (and we actually 
narrowed the scope several times during the sedimentation process) but, 
while it is clearly needed by pattern matching, it is also darn useful 
on its own!

So, I don't think there's anything unfortunate at all here -- this is 
just the New World, where we deliver smaller features, more often, and 
vet them through a Preview process where we have an opportunity to take 
a mulligan if we really borked things up (but we expect most of the 
time, we won't need this parachute.)

On 8/28/2018 7:51 PM, Ben Evans wrote:
> The only other point I wanted to make is that I think it is rather
> unfortunate that the first Preview language feature we're getting is
> this one, as it is so obviously a foundational feature for something
> much more far-reaching. I worry that, far from being an area where we
> can change course based on experience, once this has shipped in 12 it
> will basically become an invitation for Sunk Cost Fallacy reasoning,
> regardless of how usable the feature is in practice. I guess we'll
> find out in March...

More information about the jdk-dev mailing list