Eclipse 2.1 - New and Noteworthy

Java Development Tools

General


More flexible Java source and output paths

The Java build path setup offers improved flexibility:
  • Exclusion filters let you exclude certain source files within a source folder from being compiled.
  • Source folders can now be nested - use an exclusion filter on the parent folder to exclude the sub-folder you wish to add to the build path.
  • The location of generated class files can be set individually for each source folder.
  • You can also use linked folders as source folders, class folders or output folders.

Java Build Path property page


Project-specific Java compiler settings In addition to workspace-wide Java compiler preference settings (Java > Compiler), you can now configure these for a specific Java project through the new Java Compiler property page on each Java project.

More Java compiler options

  • Java projects that depend on each other can usually be compiled successfully in a single build action. In order for cycles to be allowed, you'll need to lower the severity associated with circular dependencies on the Java > Compiler preference page.
  • The Java compiler can now warn of unused private method, field, or type declarations. This option helps you find dead code and some subtle errors.
  • The Java compiler now gives you a warning when you appear to be assigning a variable with its own value. This helps catch a subtle mistake in setter methods and constructor declarations where the name of a parameter is close to the name of a field. This option can be configured via the Java > Compiler > Style preference page. Here is an example:
Assignment with no effect

Improved prefix and suffix configuration for variables

In addition to configuring the prefix or suffix for fields, you can now specify the prefix or suffix for static fields, parameters, and local variables. These settings on the Java > Code Generation preference page are used in code assist, quick fix, and refactoring whenever a variable name needs to be computed.

Name conventions preference page


Customizable code generation

The Java > Code Generation preference page allows you to customize generated code and comments in a similar way to normal templates. These code templates are used whenever code is generated. (The comments replace the existing 'filecomment' and 'typecomment' templates used for code generation.)

Code and Comments tab in Code Generation preference page


Configurable task tags

The Java > Task Tags preference page is used to configure the workspace-wide presentation of task tags appearing in Java comments. You can also configure these tags on a per-project basis via the Java Task Tags property page on each Java project.

Task Tags preference page

In the editor you'll see:

Editor with a TODO task


Sort members

There is now a Sort Members action on the context menu of Java compilation units and top level types that rearranges the members of a compilation unit according to the category order defined in the Java > Appearance > Member Sort Order preference page.

Member Sort Order preference page


Add Delegate Methods dialog

You can now easily generate delegate methods (methods that delegate to a method provided by an instance variable) by using the Source > Generate Delegate Methods action. The action is available on all types with fields.

Add Delegate Methods dialog


Package Explorer improvements

Non-Java projects are now presented in the Package Explorer view. A filter is provided to filter out non-Java projects, and the open/close interaction is now consistent with the resource Navigator view.

Non-Java projects in Package Explorer

Libraries (such as the JRE system library) are now presented as a single node with one or more JARs as children.


Hierarchical vs. flat layout of packages

An option on the Java Packages view (and the Package Explorer view) allows you to change the way packages are displayed. Hierarchical displays packages in a tree, with sub-packages below packages; Flat displays them in the standard arrangement, as a flat list where all packages and sub-packages are siblings. Below is an example of the hierarchical layout:

Hierarchical layout in Package Explorer


Logical packages

The Java Packages view (Java Browsing perspective) coalesces packages of the same name across source folders within a project. This shows a view of a logical package.

Logical packages in Java Packages view


Type hierarchy view supports grouping by defining type

The type hierarchy method view lets you sort the selected type's methods by its defining types. For example, for AbstractList you can see that it contains methods that were defined in Object, Collection, and List:

Sort members by the defining type in the type hierarchy


More filters for the Package Explorer and Project views

There are more filters for Package Explorer and Projects views:

Package Explorer filters


Multiple method restore

You can now restore multiple Java elements from the local history in one operation by selecting Restore From Local History from the context menu. In the left pane of the dialog, check the elements you want to restore and for each checked element select a history entry from the right hand side.

Multi-method restore


 

Previous Index Next

Copyright IBM Corporation and others 2000, 2003