Oracle JDeveloper 10g (9.0.5) preview is now available, and includes plenty
of new features will hopefully be appreciated by both RAD developers and code
monkeys. I use JDeveloper as my main development environment and code editor
when working on the product. This article lists ten of my favorite new features
for the hardened Java hacker.
1. Semantic Underlining
Since 9.0.4, JDeveloper has provided syntactic underlining. If
your Java code contained a syntax error such as a missing semicolon, a red underline
indicated the offending code. In 10g, semantic errors are also underlined.
These are errors in the logic of your code that would prevent it from compiling,
such as method calls that throw unhandled exceptions, or references to classes
that haven't been imported. Semantic errors are indicated by a blue underline
(you can change this, of course, or turn this feature off completely if the
underlines distract you from the important business of actually hacking code).

2. Import Assistance
I like to keep Java code compiling as much as possible, so when I use a class
from a new package namespace, I want to add an import for it immediately. The
downside of this is that it involves a lot of vertical jumping about in the
code editor. In JDeveloper 9.0.4, I was using the import completion feature
to work around this. In 9.0.4, if you enter a fully qualified package name,
e.g. "javax.swing." then pick the class name from the resulting insight
popup list, an import is automatically added for the class.
The code editor in 10g goes one step further and tries to guess the import
you need when it encounters an unrecognized class name. You can choose to ignore
its suggestion, or press a hotkey (Alt+Enter by default) to
automatically insert the suggested import statement.

3. Structure Window Sorting and Filtering
The structure window shows a list of classes, fields and methods
defined by a java file open in the code editor. Sometimes, the sheer size of
some of the classes I work with on a daily basis made the structure window less
useful than it probably should have been. Probably time to do some refactoring,
but in the meantime, JDeveloper 10g makes my life easier by letting me filter,
sort and generally muck about with the items displayed in the structure window.

The toolbar buttons in the structure window provide the following
filtering features:
 |
Show Methods |
 |
Show Fields |
 |
Show Static Members |
 |
Show Public Members Only |
4. Code Menu
A lot of functionality in the code editor was previously only
available using shortcut keys. You could discover these features by going to
Tools->Preferences and navigating to the Accelerators
page. 10g makes it much easier to find coding features by adding a new Code
menu when the editor is active. It's also handy as a reminder of several of
the accelerators.

Update: In JDeveloper 10g production, the Code menu is now known as the Source menu.
5. Improved Javadoc Support
Support in general for Javadoc is much better in 10g. One feature
I like a lot is the automatic Javadoc insertion. If you type /**
and press enter above any public method that doesn't already
have Javadoc, a template Javadoc comment is automatically inserted complete
with @param, @return, and @throws tags.
You can also invoke this functionality from Code->Add Javadoc Comments.

When pressing F1 over a java identifier, JDeveloper
has always displayed the relevant Javadoc page. However, the help window used
to display the Javadoc was a separate top level window from JDeveloper, which
made it hard to position the windows to look at your code and read the documentation
at the same time. The new help system in JDeveloper 10g already makes this
a more pleasant experience by providing an integrated help topic window you
can position side by side with the code editor:

Better still, when you press Ctrl-D (or use the
Code->Quick Javadoc menu) inside a method, field or class
name, a popup appears containing appropriately scoped javadoc:

6. Field Insight for Java Classes
In dialogs where you need to type a class name (e.g. Search->Go
to Java Class...), a new feature in JDeveloper 9.0.5 provides an insight
list of available classes as you type. This is a great alternative to browsing
the class hierarchy using a separate browse dialog.
7. Audit and Metrics
JDeveloper 10g has new tools for auditing and calculating metrics
on your code. Of the two, I find audit most useful. It's great for helping to
keep code tidy, following coding standards, with complete and correct javadoc
tags etc. There's a large amount of audit functionality, including the ability
to create profiles consisting of specific audit rules, the ability to define
new rules via an extension API, utilities for automatically fixing audit violations,
and command line support for running audit outside JDeveloper.

8. Surround With
Using the Code->Surround With... menu, you
can easily insert several coding constructs.

It's particularly handy for inserting try/catch blocks. It even
automatically inserts any required import statements for exceptions caught in
the catch clause.

9. Generate Accessors
Code->Generate Accessors... provides a quick
way to create get...() and set...() methods based on existing fields of a class.

10. Log Window Color Coding & Hyperlinks
The log window in 10g now uses two different colors to distinguish
stdout and stderr output. If an exception stack trace is dumped to stderr, hyperlinks
are displayed in the log window making it easy to jump to the offending code.

|