IntelliJ IDEA
IntelliJ IDEA – the Leading Java and Kotlin IDE, by JetBrains
IntelliJ IDEA 2017.3 EAP brings support for Local-Variable Type Inference
IntelliJ IDEA 2017.3 EAP brings support for Local-Variable Type Inference.
A long-awaited Java 9 has been released just a few weeks ago, but we’re already looking forward to the new goodies Java 10 is going to bring. Though the chances are it might not be called Java 10. Oracle has proposed moving Java to releases every six months, so we might have the next release already as early as March 2018, and will probably be named Java 18.3. We’ll see.
The upcoming release of Java is going to bring Local-Variable Type Inference according to the JEP 286. This specification aims to reduce the boilerplate code while declaring local variables.
IntelliJ IDEA 2017.3 supports Local-Variable Type Inference. The IDE will include a prompt to replace the explicit types with ‘var’, when the type can be inferred from the context.
Currently the IDE detects local variables with ‘var‘ types when they can be replaced with explicit types.
This new feature allows you to sneak-a-peek into the future Java release, so we hope you’ll give it a try. As this is an experimental feature, we count on your feedback a lot. But please keep in mind that the JEP 286 has not been released yet so it might still change, and if so, the support for this feature in our IDE will be changed accordingly. Do share your thoughts with us here in the comments, on twitter or in our issue tracker.
Happy developing!