What’s new in IntelliJ IDEA 2019.1 EAP2?
A new EAP build for the upcoming IntelliJ IDEA 2019.1 is now ready for you to try. It comes with better data flow analysis, JVM Debugger improvements, Kotlin 1.3.20, and Maven 3.6.0. Let’s dive into the details.
Data Flow analysis enhancements
With each major release we improve our data flow analysis, and as you may have come to expect, this release is no different.
Precise warning highlighting in the ternary expressions
With IntelliJ IDEA 2019.1 we’ve improved the precision of the warning highlighting for ternary expressions. Now the IDE will only highlight a condition in which a nullability violation is detected, previously the IDE highlighted the whole ternary expression, even when the nullability was only violated in a single branch.
Thanks to this new feature you now have precise highlighting in the switch expressions too.
Improved analysis of mathematical operations
Now the data flow analysis tracks the value of mathematical operations and uses this information to warn you about the conditions that are always true or false. With this upcoming release, the analysis of many math operations was improved including multiplication, remainder, and bitwise operations.
Inference of the constructor’s purity from sources
The upcoming IntelliJ IDEA 2019.1 improves the support for the @Contract annotations. The IDE can now automatically infer the purity of constructors from sources and adds annotations icon in the gutter which you can click on and the IDE adds a @Contract(pure = true) annotation to your codebase. The constructor purity was already inferred for library code and now it works for source files as well.
Also, IntelliJ IDEA now enables non-null parameter inference for non-stable source methods. If a method can be overridden, but the base class implementation unconditionally dereferences the parameter, we believe that in such cases it’s acceptable to have a not-null inference for the parameter. Please report to our issue tracker if this feature produces any false-positive nullability violation warnings in your project.
In some cases, the IDE now can detect if the array index is out of bounds for multidimensional arrays.
Navigation from Java stack trace to the relevant position within a line
IntelliJ IDEA now tries to take you from the Java stack trace to the relevant position within a line. Previously when the link in the stack trace was clicked, it would only take you to the first column of the corresponding row, now the IDE tries to determine the exact location within the row to take the cursor to when it’s possible.
Run Tool Window
Now the “Dump Threads” action in the Run tool window, opens the Dump tab where you can view all the thread dumps and the stack traces associated with those threads, with the most important threads shown at the top of the list. It makes it easy to locate the thread you need and to navigate to it. Previously this action printed the raw thread dump to console output, which I think we can all agree, is not very useful. Now the “Dump Threads” action invokes the same tab as the Debugger tool window.
Support ‘synchronized’, ‘assert’ and ‘switch’ in the debugger evaluator
With this upcoming release of IntelliJ IDEA we have improved the debugger evaluator to now support synchronized statements, assert expressions, and switch statements.
We have updated the Maven version bundled with IntelliJ IDEA to v3.6.0.
This EAP build updates the bundled Kotlin plugin version to 1.3.20, see the Kotlin blog for details. Here’s a little more insight into what it brings you:
- Template to generate ‘main’ without parameters.
- Inspections to improve coroutines code.
- New intention for converting SAM as lambda to an anonymous object.
- String conversion improvements.
Feel free to grab a copy of the IntelliJ IDEA 2019.1 EAP build and explore all our new features! Don’t forget to share your experience with us in the comments below or the issue tracker, on Twitter, or our discussion forum.