Posts Tagged ‘inspections’

Better Spring with IntelliJ IDEA 10.5

Monday, May 9th, 2011

Yes! The sunny Spring has finally come to St.Petersburg too. However, it’s not that “Spring” we want to talk now…

We realize that many of you use the Spring framework in your every day work. So, many should be interested in the new Spring-related features that can be found in the upcoming IntelliJ IDEA 10.5 release.

1. Better navigation between xml configs and annotated stereotype components

2. Advanced usage search for @Autowired beans

3. More inspections for your configs, for instance, deprecated classes and members highlighting.

4. More powerful placeholder support. All spring model inspections get and analyze placeholder values before highlighting.

5. More clear Bean Dependencies Graph view. For instance, it obtains beans and dependencies from custom namespaces. Check out this spring integration schemas example.

There are also smaller changes here and there…

Download IntelliJ IDEA 10.5 RC to try it and enjoy the improved Spring framework support.

Java 7. @SafeVarargs

Friday, April 8th, 2011

Java 7 provides a way to remove a compiler warning about generics vararg invocation. With Java 7 you can annotate your vararg method with SafeVararg annotation and your clients won’t get these nasty warnings any more. IntelliJ IDEA 10.5 will help you to perform this migration. It will find for you all the places where @SafeVarargs annotation is applicable and suggest you to add this annotation. Of course, it will also check if existing @SafeVarargs annotations are applicable.

Suppose you have annotated your method with @SafeVararg but already have suppressions for unchecked warning in client’s code:

Since its version 6 IntelliJ IDEA contains an inspection to find redundant suppressions (available in batch mode only). Now you can use it to remove all suppressions which are garbage in your code. It will carefully check that these unchecked warnings were caused by generics vararg invocation and suggest you to remove all such suppressions. Simply run the ‘Redundant Suppression’ inspection (Ctrl-Alt-Shift-I).

All you need to do is to install Java 7 and setup language level to 7.

Download IntelliJ IDEA 10.5 EAP, try the new described features and let us know what you think.

No more misspellings in your VCS commit comments

Thursday, August 26th, 2010

How many times you wished you could edit your last VCS commit comment to correct a misspelling?

Now you will notice such mistakes because IntelliJ IDEA 10 checks the spelling in the comment field.

And it not just spellchecks the text, it runs the Spelling inspection on it and uses your custom dictionary too. Hit Alt+Enter/⌥↩ on an underlined word and fix it as you normally fix things in IntelliJ IDEA code editor.

Spellchecker is also enabled in other dialogs throughout the IDE, e.g. Search/Replace dialog.

Try IntelliJ IDEA X EAP and let us know your impressions.

Listeners and Adapters

Thursday, September 3rd, 2009

Occasionally implementing a Listener leads to an explosion of ugly empty boiler-plate methods. In such cases it is usually better to extend a matching adapter class and only override the needed methods.

The next IntelliJ IDEA Maia EAP build will make switching between implementing a Listener or extending an Adapter easier — with newly added Listener implementation could be replaced with Adapter extension inspection (also announced on Twitter).

This new inspection quickly highlights any implementations of Listeners which contain empty methods and offers to replace them with an extension of the relevant Adapter class.

A quick Alt+Enter, Enter replaces the verbose listener code by a more compact use of an Adapter. If you ever need to return to an implementation of a Listener, there is a new complementary intention to make this journey back quick and painless — Replace Adapter Extension with Listener implementation.