Any NPE detection IG?

In our group right now the nullability and how to indicate that and how to make it easier to read the code etc. has become the hottest topic. Wondering if there is any IG available for detecting possible NPE and warnig the developer?

Some of the suggestions have been around adding it to javadoc but that is not solid enough. Java seems to be wanting to do something in 1.5 but not sure what the current status is. Check the link below.

Any help

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5030232

1 comment

Keith Lea is working on a null-checking plugin, that enables does both dynamic and static checking for null args and returns, declaring nullability status via JDK1.5 annotation. No plans currently exist to include this functionality in IG, although I would certainly not be averse to it when it matures. It's amazing how many bugs have an NPE as their visible symptom, and anything that will do preemptive checking for NPEs will smoke out a lot of them.

One big issue for nullability checking is readability, but it should be possible for IDEA to fold all of the @notnull annotations that are likely to proliferate. Another issue is all of the existing libraries that are written without null-checking annotations, which will have to either be retrofitted or dealt with conservatively.

--Dave Griffith

0

Please sign in to leave a comment.