Bind the Check record to the checker
After you add @Check, bind the data to the issue, using @Bind("NPE.RET"):
package junit.framework; @Bind("NPE.RET") class Assert { public static void assertNotNull(@Check Object object); }
Test the knowledge base
To test your knowledge base:
- Import the knowledge base into your project using kwcheck:
kwcheck import check.jkb
- Run the analysis:
kwcheck run
When the code is analyzed using this knowledge base, Klocwork now knows assertNotNull is the check; consequently, NPE.RET is not reported.