IntelliJ IDEA
IntelliJ IDEA – the Leading Java and Kotlin IDE, by JetBrains
IntelliJ IDEA 2020.2 Early Access Program Is Starting!
The Early Access Program for our next major release, IntelliJ IDEA 2020.2, is now open! This upcoming release will be loaded with plenty of cool new features, and you can already try some of them in the very first EAP build. The features available to explore include full support for GitHub Pull Requests, the brand new Inspections Widget, Maven Wrapper support, HPROF enhancements, and much more.
You can download EAP builds from our website, get them from the Toolbox App, or update using snaps if you use Ubuntu.
As usual, the EAP builds for IntelliJ IDEA Ultimate are free to use, but they expire within 30 days of the build date.
Version Control
Full GitHub Pull Requests support
We are excited to announce that IntelliJ IDEA 2020.2 will come with full support for GitHub Pull Requests!
We introduced initial support for GitHub Pull Requests with v2018.3, and we’ve been enhancing this functionality ever since. Previously, the IDE had some useful features, such as the GitHub tool window with a list of all pull requests associated with the repository, the Timeline view for a pull request, which opens in the editor, and the ability to view comments in diffs and create comments of your own. But those features were mostly for viewing pull requests and not for interacting with them.
With the upcoming IntelliJ IDEA 2020.2, you’ll be able to browse, assign, manage, and even merge pull requests, view the timeline and in-line comments, submit comments and reviews, and accept changes.
You no longer need to switch between the browser and your IDE. The entire Pull Request workflow can now be completed from within IntelliJ IDEA!
Let’s discuss these new features in detail.
New layout for the pull requests view
To make it easier for you to interact with pull requests, we’ve improved the way the IDE displays lists of them by providing you with all the information you need in one view. Pull requests are now shown in a separate vertical toolwindow in the top left-hand corner of the screen. Simply click on any pull request you need from the list, and the IDE will display all of the information about it, such as its message, branch names, author, assignee, changed files, commits, timeline, comments, and more.
Previously, the IDE displayed the GitHub Pull requests in the tool window with the horizontal layout, but the space for pull request details was very limited and there was no space for pull request commits.
Viewing the results of pre-commit checks in the Timeline
While you’re reviewing the pull requests, you’ll notice that at the bottom of the timeline there is a panel that displays the results of the checks if any appear. The IDE will provide you with the links that help you resolve issues.
Reviews support
You can now complete every stage of the review workflow from inside the IDE. This means you can start a review, request reviews, attach comments, and submit reviews.
Interaction with comments
With the upcoming IntelliJ IDEA 2020.2, you’ll be able to view, edit, create, or remove the commit level comments.
What’s more, the IDE will let you view and interact with the line level comments – providing you with the ability to perform the code review right from inside the IDE!
Merging pull requests from within the IDE
Now you can merge pull requests from within the IDE – it is no longer necessary to use a workaround. In the previous release, it was first necessary to create a local branch from a pull request, and only then was it possible to merge it as a regular branch.
We’ve been reviewing and polishing GitHub Support, and IntelliJ IDEA 2020.2 will come with lots of fixes for known issues.
Be sure to check out the full support for GitHub Pull Requests, and please share your feedback with us!
Improved way of presenting the result of the Compare branches action
Speaking of changes in the Version Control subsystem, we’ve improved the way the result of the Compare branches action is presented.
Now when you are comparing 2 branches in IntelliJ IDEA, you’ll be able to see the commits of the compared branches in one view. The IDE will now open the logs of both branches being compared in the editor instead of in the VCS tool window, where there is not enough space to display all the information.
Squash local commits from the log
We’ve made one more highly anticipated improvement to Git integration. You can now select a number of local commits in the Log tab of the Git tool window and squash them into one.
This action is available from the context menu, which can be invoked by right-clicking.
Editor
Brand new Inspections Widget
We’re pleased to introduce our brand new Inspections Widget, which makes it easier for you to view all the problems in the current file and to navigate between them.
The Inspections Widget provides detailed information about the number of warnings, errors, and other issues in the current file. You can use the arrow icons to navigate through errors in the files, though of course it’s still possible to navigate through errors using the good old F2 shortcut.
From this Inspections Widget, you can configure the highlighting level: none, errors only, or all problems. Previously, it was possible to configure the highlighting level by using the Inspector icon on the Status bar or by using the icon in the top right-hand corner of the file. The downside was that these were not easy to find – especially the icon in the Status bar, which was not clearly visible and which was placed far from the file context, i.e. the editor.
Profiler
HPROF memory viewer
IntelliJ IDEA 2020.2 will come with a nice enhancement to the HPROF memory viewer, with which you can analyze the heap to locate the parts of the code that use large amounts of memory resources, and to find the memory leaks.
The HPROF memory viewer now does not merely show general information about the analyzing heap, such as a summary (total size, number of instances, and stack traces of the file), garbage collector roots, classes, and the object view. It also displays the calculated retained sizes of objects, shortest paths to garbage collector roots, the dominator tree for objects (retained objects), and incoming references.
Currently, the viewer works for HPROF dumps that are already prepared. To start using this feature, select “Run → Open Profiler Snapshot” from the main menu and then choose any .hprof file you want to analyze.
Java
Java Live Templates Clean-up
IntelliJ IDEA has lots of features that help speed up your coding. Among them are live templates, which expand abbreviations to much longer pieces of code, such as loops, conditions, various declarations, or print statements.
To find and learn all the configured live templates you may need, go to Settings/Preferences | Editor | Live Templates. Previously, we found it was difficult to locate the Java live templates among the live templates for all the other languages, so we decided to group the Java live templates under the Java node. This means that in IntelliJ IDEA 2020.2, all existing templates from plain, surround, other, output, and iterations groups will be moved to the Java group.
We’ve created a separate Groovy group, as well.
Unfortunately, there is a downside to this change. If you ever customized any of the predefined Live Templates, your customization may be reset after updating to v2020.2, and you’ll need to delete templates under the old groups and again add the customization manually for the newly created Java and Groovy groups. We are very sorry for this inconvenience.
Java Inspections
As usual, the new major release will come with a variety of new inspections.
We’ve improved our data flow analysis (Constant Conditions & Exceptions) so that it can now detect pointless ‘Math.min’ and ‘Math.max’ operations. This inspection already detected “Arguments of ‘min’ are the same” cases, and now it’s been improved to warn you when one operand is never bigger or smaller than another.
Also, our data flow analysis will now report non-trivial expressions that are known to evaluate to 0. Please note that the warning is not issued if the expression is a constant expression or a method call in which all arguments and qualifiers are constants.
The IDE will warn you about inconsistent Contract and NotNull annotations:
The IDE also provides an intention for combining System.out.println(String.format(…)) into System.out.printf, detects some pointless String.substring calls, warns you when x and y in AssertJ assertThat(x).isEqualTo(y) are inconvertible, and does much more.
Scopes for Introduce Variable Refactoring
The Introducing Variable refactorings can now replace occurrences of the variable in intermediate scopes, and they do not replace only one or all occurrences, as was previously the case.
Java 5 or older
Please note that the upcoming IntelliJ IDEA 2020.2 won’t support running and testing projects on Java 5 or older Java versions. Java 5 reached “end of life” status in 2009, and Oracle has not provided support or security updates for this version for a long time.
Note that it will still be possible to write code that’s compatible with Java 5 in IntelliJ IDEA. In order to compile it, run JUnit tests for it, or deploy it to an application server, however, you’ll need to use Java 6 or a newer version of Java.
You can always use IntelliJ IDEA 2020.1 or a lower version of the IDE to run projects on Java 5. All previous versions of IntelliJ IDEA can be found on our website.
Maven
The upcoming version of IntelliJ IDEA will support Maven Wrapper. The IDE will automatically use a configured Maven Wrapper if present and will import all the changes when needed.
There’s one more useful improvement in this area to report: you can now set a Maven version for each project individually. Previously, the Maven version was shared across all opened projects.
You’ll find the list of all the addressed issues in the release notes.
That’s it for today. Give the brand new IntelliJ IDEA 2020.2 EAP a test, and please give us your feedback via Twitter or our issue tracker, or simply drop a comment in the section below!
We’ll keep publishing the EAP builds for IntelliJ IDEA 2020.2, with more awesome features and useful improvements each week! Stay tuned!
Happy developing!