JDK 12 roadmap: Java 12 gets first targeted feature Couleur

JDK 12 roadmap: Java 12 gets first targeted feature

While Java Development Kit (JDK) 11 won’t arrive for another month, work proceeds on its successor, JDK 12, with a switch expressions capability lined up for the release, expected in March 2019. Simplified coding is a goal of this capability.

Switch expressions, which will be in beta state in JDK 12, extends the switch statement so it can be used as either a statement or an expression. This would enable both forms to use either “traditional” or “ simplified” scoping and control flow behavior. These changes would result in simplified “everyday” coding and prepare the way for use of pattern matching in switch.

As Java builders move to support pattern matching, existing irregularities of the existing switch statement become impediments. These include the default control flow behavior of switch blocks; default scoping of switch blocks, in which the block is treated as one single scope; and switch working only as a statement. The current design of Java’s switch statement follows closely languages such as C++ and, by default, supports fallthrough semantics. This control flow has been useful for writing low-level code. But as switch is used in higher-level contexts, its error-prone nature begins to outweigh flexibility.

JDK 12 is now in development in the OpenJDK community. For now, the switch expressions proposal is the only technology formally listed as targetting JDK 12.

IDG Insider

PREVIOUS ARTICLE

« World of Warcraft: Battle for Azeroth review: The world is enough

NEXT ARTICLE

HPE rolls out program changes to trigger partner growth »
author_image
IDG Connect

IDG Connect tackles the tech stories that matter to you

  • Mail

Recommended for You

Tech Cynic: VR, the never-popular technology

Tech Cynic – IT without the rose-tinted spectacles

Five months on, GDPR doubts remain for this lawyer

Martin Veitch's inside track on today’s tech trends

How can smart solutions help address Southeast Asia's urban challenges?

Keri Allan looks at the latest trends and technologies

Poll

Is your organization fully GDPR compliant?