JDT Improvements, Top Eclipse Kepler Feature #6
Since 2001, Eclipse has been setting the standard for Java Development Tools, and with Eclipse Kepler, the JDT team has shipped another top-quality release. As we get closer to Eclipse Kepler, I’m counting down the Top 10 Eclipse Kepler features that I’m looking forward to most. Number 6 on my list is the improvements to the Eclipse Java Developer Tools.
There are a number of new quick fixes, including the ability to easily convert If-Else statements to Switch statements:
And quick-fix to combine multiple strings:
And there is a now a quick-fix to allow you to fast-fail (convert an expression to ! and return).
The JDT now provides a default logical structure for XML DOMs. These can be used in the variables view during debugging, showing XML attributes as simple arrays.
While the JDT has had leak analysis for a while, unfortunately the use of common utilities (like Google Guava) could easily trip it up. Now, the JDT is smart enough to detect the usage of these common libraries and not complain when they are used properly.
The annotation based null-based analysis (that was first introduced with Indigo) has now been extended to work with fields. If a field is marked @nullable, then almost all access to that field can be flagged as a potential null access. The compiler now recognizes a narrow range of code patterns where a null-check of a field is directly followed by a dereference or an assignment to a @NonNull variable. For these particular situations, no problem will be reported.
Finally, JUnit has received a few improvements especially how how it handles skipped tests. Skipped tests are decorated with a special icon and not marked as ‘passed’.
While Eclipse is certainly a powerful platform, Eclipse-as-a-Java-IDE is one of the most important uses for the majority of Eclipse users. I’m happy to see that this great tool is still going strong after 12 years!.
For more Eclipse Tips & Tricks and the annual Top 10 list, follow me on twitter.