Creating Java Path checkersJava Path checkers track data through the program code, finding execution paths containing the issues, or more specifically Java Path checkers track data flow from source to sink. To create a Java Path checker, you must decide what data will be tracked by the analysis engine. Once you identify your criteria, you must then communicate your criteria to the engine in the form of a Java knowledge base file, which uses a Java-like declarative language called JKB. In the Java knowledge base, you must identify which calls:
If you have two calls, with one returning null and another dereferencing it, then you have an NPE issue. Optionally, you can identify which calls:
Note: Klocwork has the same capability to tune existing checkers to reduce false positives. See Tuning Java analysis.
|