What it is:
JSR 308 checkers
are bug-finding and verification tools
for preventing and detecting null pointer errors, incorrect uses of equality operations, and side effect errors.
The checkers demonstrate the usefulness of the JSR 308 annotations.
Requirements:
For the plugin to work, your Eclipse must be running on a Java 5 VM or newer, but at least Java 6 is required to run the distributed JSR308 compiler
The plugin has been tested on Linux, Eclipse 3.3.2, and Java 6 and Mac OS X, Eclipse 3.4 and Java 5.
To see what Java VM and Eclipse is running on, select from the menu Help -> About Eclipse Platform -> Configuration Details.
Depending on your installation, the menu may be Help -> About Eclipse SDK -> Configuration Details.
How to install:
- In Eclipse, select from the menu Help -> Software Update -> Find and Install...
- Choose the Search for new features to install option, and click Next.
- Click New Remote Site.
- Enter the following:
- Name:JSR 308 Checkers
- URL:http://groups.csail.mit.edu/pag/jsr308/eclipse
and click OK.
- Under Sites to include in search, you should see "JSR 308 Checkers".
Select the checkbox next to it and click Finish.
- Under Select features to install, you should see "JSR 308 Checkers" (for running the checkers) and "JSR 308 Skeleton Generator" (for generating skeleton files).
(You may have to expand the tree to make the features visible.)
Select the checkbox next to it and click Next.
- Select the I accept the terms in the licence agreement option and click Next.
- Select the location.
The default (your workspace) should be fine. Click Finish.
- The plugin is not digitally signed. Install it anyway.
- Click Yes to restart Eclipse.
When installing the "JSR 308 Checkers" plugin, you also need to set up
the path to the JSR 308 javac executable and
checkers.jar:
- Open the Preferences dialog
Window > Preferences...
- Select JSR 308 Checkers from top level menu
- Update the locations of the JSR 308 javac executable
and checkers.jar
- Click OK to apply the changes
How to use Checkers Feature:
First, you need to add checkers.jar to your project's classpath.
(Eclipse may complain about unresolved classes referenced form a classfile. This does not affect the checking but if you want to make the warning go away,
add javac.jar to the project's classpath.)
To perform the checking, select the checker from the context menu of a Java project, for example JSR 308 -> Run NonNull.
The checker will run and warnings will be added to the Problems view.
To remove the warning markers, run JSR 308 -> Remove Markers
How to use the Skeleton Generator Feature:
- Create a new Eclipse project containing the desired packages. The
plug-in performs in-place modifications to the files. They need to
be in the source path (usually in src directory), but do not
need to have the classpath configured properly.
- Select (i.e. highlight) the packages (or individual source files)
to be converted.
- Choose JSR308 Tools > Skeleton Files (With JavaDocs) or
JSR308 Tools > Skeleton Files (No JavaDocs) from their
context menus. The documentation might be helpful when annotating
the code.
- The plug-in generates skeleton files in place of the input files.
How to report problems:
Send problem reports to checkers@lists.csail.mit.edu
Currently supported checkers: Nullness, Javari, IGJ, Interning