I work on a relatively large project that consists of multiple Maven modules. They contain Java and Flex source files including many generated ones in both technologies. When I run code inspection on the whole project using Analyze -> Inspect Code… in Intellij IDEA I get many false positives.
The problem is that there are many warnings in the generated code that I’m unable to fix easily. Also, as of version 9 IDEA support for Flex still have some issues and often valid code is marked as error.
In order to make the code inspection usable in the project I created a custom scope for Java non-generated files. The scope language syntax reference is not very comprehensive as of time of writing but I was able to come up with this pattern:
file[*]:src/*/java//*
It allows me to inspect non-generated Java sources across all modules in directories conforming to Maven standard directory layout like src/main/java and src/test/java. Directories with generated files like target/generated-sources/jaxb are ignored.

How many times you wrote the following line of code in Java?
List<String> list = new ArrayList<String>();
Adding import statements, repeating the generic parameter…
For me it’s very annoying, so I created a template for that in my IDE. In this post I’m going to explain how to set up templates for creating collections in Intellij IDEA.
Go to Settings -> Live Templates and create a new template with the following text:
java.util.List<$type$> $name$ = new java.util.ArrayList<$type$>();
I chose “newlist” as an abbreviation for the template. You can also set default values for the type and the name in “Edit variables” dialog by typing them in double quotes in expression field.
After saving the template you can create a new array list easily by typing “newlist” and pressing Ctrl+J or the key you chose in the template dialog (Tab by default).

I also created live templates for other collections I use frequently – HashSet and HashMap using this technique.
Long time ago when I started programming in Java I heavily used the JavaDoc API documentation which is currently available on Oracle site. It was not very convenient to find a specific class there. Later I found a Java 6 JavaDoc search engine plugin for Firefox at Mycroft Project. Nowadays I mostly use my IDE to browse JavaDoc documentation but I still find it useful from time to time.
