CheckThread provides a thread annotation library and a
static analysis engine for finding certain kinds of threading bugs at compile time.
CheckThread will report thread confinement violations and race conditions
within the Intellij IDE.
THREAD POLICY LISTING
- Install the Intellij Plugin, restart Intellij.
- Import the checkthread-annotation.jar file into your Java project.
You can get this jar from checkthread.org or inside the unpacked plugin.
- Add @ThreadSafe, @NotThreadSafe, and @ThreadConfined thread policy Java
annotations to your Java code.
- Alternatively, instead of using Java annotations, you can specify a method's
thread policy by adding a threadpolicy.xml file to your Intellij project's
class path. See checkthread.org for a simple example.
- Compile your Java code and press the CheckThread toolbar button to perform analysis.
- CheckThread inspects Java byte code, so be sure to compile your latest changes before pressing the CheckThread button.
FOR MORE INFO
- ThreadSafe - Add this annotation to methods that are thread safe. CheckThread will validate that there are no race conditions.
- NotThreadSafe - Add this annotation to methods that are not thread safe.
- ThreadConfined- Add this annotation to methods that are thread confined. For example, methods on Swing components are confined to the event-dispatch thread. CheckThread will report if you are calling a Swing method on the wrong thread.
General usage instructions
See checkthread.org for instructions.
Adding support for Intellij 8
Adding support for threadpolicy.xml