IntelliJ IDEA 2016.3 EAP: Polyglot Maven, Grails View, Inspections and More

Say hello to the fresh IntelliJ IDEA 2016.3 EAP build, which brings several new features worth checking out.

Support for Polyglot Maven

First of all, we’ve added the support for Polyglot Maven. In case you don’t know, this is a set of Maven extensions that allows the POM file to be written in Groovy, Scala, Ruby and other languages.

While project import works for any language, coding assistance within POM files is available only for Groovy.

Apart from that you can work with the projects that use Polyglot Maven just as with any other Maven projects.

The Show Effective POM action works as usual and is especially useful if you want to see how Maven interprets the DSL.

Building Groovy resources

Speaking about Groovy, we’ve added actions that build Groovy files located in resource folders. They’re available via the main menu BuildGroovy Resources. Build Resources is incremental while Rebuild Resources builds from the scratch.

Grails view

The Grails developers will be happy to know that the Grails view is back for Grails 3. Now, instead of a tool window, it’s tab inside of the Project tool window:

Artifacts are grouped by their type and reside outside of the sources folder. If you define a class within the src/main/groovy source folder and annotate it with @Artifact(“Controller”), the Grails view will show it under the Controllers node.

All the Project tool window settings are applicable to the Grails view as well, including Flatten Packages.

Items under the Plugins node (always the last in the list) navigate to the corresponding GrailsPlugin class.

Inspection that inlines local variables used only by return statements

IntelliJ IDEA has many inspections aimed at making code shorter and simpler. In this EAP build, we’ve added one more that we hope you’ll find useful.

The new inspection finds local variables used only by return statements, and provides a quick fix that inlines these variables–by replacing their assignments with return statements.

When the returned value can’t be inlined into return statement, the quick fix attempts to move the return statement as close to the computation of the returned value as possible:

Adding runtime assertions for not-null-annotated code

IntelliJ IDEA’s compiler (Settings → Build, Execution, DeploymentCompiler) has an option to generate runtime assertions for the methods and parameters annotated with org.jetbrains.annotations.NotNull.

screen-shot-2016-09-21-at-18-57-12

Starting now it supports non-JetBrains annotations as well–JSR-305 in particular. Click Configure annotations to change the default behaviour:

The blue arrows indicate which annotation is be used by the IDE in inspections. Use the Check button to change them.

Here we’d like to thank Vladimir Dolzhenko who contributed to this improvement.

Resource bundle editor showing unused properties

The Resource Bundle editor now tells which properties are unused in the project:

Spring Initializr

Layout of the Spring Initializr has been reworked to fit more items and provide additional information. As a bonus, it now has the Search field.

Download the EAP build, give it a try and share your feedback with us. If you see something works not as it’s intended, write to our issue tracker.

Develop with Pleasure!

Posted in EAP Releases, New Features | Tagged , , , | Leave a comment

Share Your Stats to Improve Code Completion via Machine Learning

Code completion is, no doubt, one of the most useful features of any IDE. This is why IntelliJ IDEA offers it in so many flavors: Basic Completion, Smart Completion, Second Completion, Second Smart Completion, Statement Completion, and Hippie Completion.

Each of these completion types already uses different algorithms and heuristics, but we’d like take them even further with machine learning, which we believe can be a huge improvement to the completion efficiency. However, to really implement it, we need more data from you.

Here comes the idea of our new plugin: Completion Stats Collector. What this plugin does is it collects data about how you’re using code completion, anonymizes it and sends to us. Again, the plugin doesn’t send any of your personal data or code, just generic info about how code completion is used.

What are the benefits of installing this plugin? Mainly, of course, helping us to improve code completion. Less important, yet nice, you’ll always use the latest and most efficient completion algorithms tuned personally for you. In the beginning you won’t notice any big improvements (the opposite in theory may be possible sometimes). Later, as we keep improving the algorithm, we bet you’ll start noticing the difference.

The downside of using the plugin is a slight outgoing traffic—with the maximum around 20KB/hour, based on how heavily you use code completion. In future we’ll do our best to keep the traffic as low as possible.

Like the idea of helping us improve the completion? Install the plugin! Meanwhile, we’ll be happy to answer questions, get suggestions or feedback.

Develop with Pleasure!

Posted in New Features, News & Events | Tagged , | 6 Comments

Webinar Recording: Introduction to Akka Actors with Java 8

Last week we had a pleasure of hosting a webinar in partnership with Lightbend about Akka Actors and Java 8. In it, Johan gave an introduction into how to write Actors and also answered a great number of questions. If you missed the webinar, but the topic is interesting to you, you’re welcome to watch the recording:

Jump directly to a topic you’re most interested in using the following links:

The sources of the project used by Johan can be found on GitHub.

For slides, use this link.

Also, please suggest other topics you’d like us to cover in our further webinars and the authors you’d like to have as webinar guests. In case you’d like to be such guest yourself, write to me about it.

Speaking to you

Johan AndrénJohan Andrén is a member of the Akka team at Lightbend. He has been working professionally with tech on the JVM since 2005, focused on Scala and Lightbend technologies the last five years. He is located in Stockholm, Sweden. Follow Johan on Twitter.

Develop with Pleasure!

Posted in Webinars | Tagged , | Leave a comment

IntelliJ IDEA 2016.3 EAP Makes Unused Code Detection More Flexible

Have you ever seen a project with no unused symbols? If so, you are really lucky! Jokes aside, finding unused code is difficult because of things like dependency injection, reflection, and countless frameworks. Luckily we have IntelliJ IDEA that provides instance editor highlighting and batch inspection that are a great aid in this task. Unfortunately, sometimes static information is not enough to detect that code is implicitly used by a framework or called through reflection, or your project is a library and all public methods are therefore implicitly used. To make the inspection more flexible and support all that cases, we’ve introduced the following settings.

Continue reading

Posted in EAP Releases, New Features | Tagged , | 2 Comments

IntelliJ IDEA 2016.3 EAP Helps Migrate to Java 8’s Stream APIs

In one of her recent articles, Trisha Gee wrote about refactoring to Java 8. Among many great tips about Java 8, the article also showed how IntelliJ IDEA helps write correct and idiomatic Java 8. With IntelliJ IDEA 2016.3, we’ve gone further and extended our existing inspections to support non-trivial cases.

Continue reading

Posted in EAP Releases, New Features | Tagged , , , , | 8 Comments

IntelliJ IDEA 2016.2.4 Update is Out

TGIF! The good news today (apart from that it’s Friday) is that IntelliJ IDEA 2016.2.4 is out. Inside you’ll find a number of important bugfixes.

Feel free to download and install the new version from scratch, or (if you’re running IntelliJ IDEA 2016.2.3), apply the patch by clicking Check for Updates and then Download and Install.

Enjoy your weekend!

Posted in Releases | Tagged , , | 12 Comments

Java Annotated Monthly – September 2016

The sad news is, it’s the end of summer. On the other hand, maybe you need a break from the kids and you’re happy to shift your work-life balance towards passionate-developer-mode. The good news is it’s conference season. If you are going to be at JavaZone, JavaOne or Devoxx, not only will you be brought up to speed on what’s going on in the Java world, you can meet JetBrains people! Come and say Hi at our booth, we love chatting to people. Personally, I’ll also be appearing as close to home as Cádiz and as far away as Australia! If you can’t make it to any conferences, we will (of course) be sharing the most interesting developments through Java Annotated Monthly.

JavaAnnotatedMonthly@2x

Continue reading

Posted in News & Events | Tagged | 4 Comments

IntelliJ IDEA 2016.2.4 RC is Out

Good news! An IntelliJ IDEA 2016.2.4 RC is out and ready to test. Among other bugfixes the build addresses IDEA-160416, an annoying keyboard issue on OS X.

Give the build a try and share your feedback. If no serious problems found, the build will go GA.

Develop with Pleasure!

Posted in EAP Releases, Release Candidates | Tagged , , | 1 Comment

IntelliJ IDEA 2016.3 EAP: SF, Fira Code, Debugger Improvements and More

Time flies! Last week we started IntelliJ IDEA 2016.3 EAP and today we have a new EAP build to share with you. Among bugfixes, the build brings a couple of notable changes.

First of all, the OS X users will notice, that the default font of the UI (SettingsAppearance & Behavior → Appearance → UI Options) has changed to San Francisco (in particular SF NS Text), now the standard  for the OS X platform.

Another font-related change, now affecting all platforms, is Fira Code which is now bundled with the IDE–allowing everyone to use font ligatures:

To use ligatures, make sure to enable them explicitly:

Also, the debugger got better at detecting JREs used by the running application. Now, if the application uses a JRE different from the project JDK and you’re stepping into the JDK sources, the IDE will try to use another JDK configured in the IDE that better matches the running JRE version. This is useful in several cases:

  • When the alternative JRE configured in the Run Configuration is different from the Project JDK.
  • When you attach a debugger to a remotely running application using a JRE different from the project SDK.

The last but not least, we’ve improved the way we detect and inform about nullability issues. Now, if you have a method with the Not-Null contract defined for one of its parameters and the IDE notices that this contract is broken somewhere in the project, the IDE will notify you immediately about that–next to your parameter definition.

This works for @NotNull annotations as well for Guava’s Objects.requireNonNull:

The corresponding inspection also allows you to navigate to those usages breaking your contract–so you can fix that.

That’s all for today. You’re welcome to download the EAP build right away and give a try to these new features yourself.

As always, we’re looking forward to your feedback and bug reports in our issue tracker.

Develop with Pleasure!

Posted in EAP Releases, New Features | Tagged , , , | 13 Comments

Live Webinar: Peer Code Review from IDE

This is a guest blog post from the JetBrains Upsource team. They’d like to invite you to our free webinar, “Peer Code Review from IDE” with Trisha Gee that will take place on Tuesday, September 13th, 2016, at 14:00 GMT.

Upsource_webinar_Peer_Code_Review_from_IDE

If you’ve ever participated in the code review process, you know that reviewing your teammates’ code changes outside of your favourite IDE may feel uncomfortable and even frustrating. The IDE is the customary environment where we deal with code, be it changing something or exploring the code base. However, most code review tools only let you collaborate on code changes and discuss improvements in their web UI.

Upsource, a code review tool from JetBrains, helps developers feel more comfortable with the code review process. It provides an IDE plugin that allows you to participate in code reviews and discussions straight from your IDE leveraging all of its powerful capabilities.

In this free webinar Trisha Gee will show you how Upsource IDE integration works. You’ll learn how to:

  • Create code reviews from your IDE
  • Assign team members to review your changes and add watchers
  • Stay up to date with the process
  • Participate in discussions and manage your code reviews straight from your favorite IDE.

Space is limited, please register now.

This webinar is geared towards developers of different proficiency levels regardless of their programming language of choice. You will be able to ask questions during the webinar. The recording will be made available later.

JetBrains Upsource Team

Posted in Guest Post | 2 Comments