What jarnotator does in less than 1 minute

jarnotator-logoNullPointerException-s still plague the java world. Commercial programs that throw such exceptions from time to time are unfortunately not so rare. It is here that jarnotator steps in to help addressing this problem. Described in what should amount to less than a minute worth of reading follows what jarnatotor does. 

 

The jarnotator logic analyzes bytecode looking for specific patterns. In particular those related to nullness. Based on the observed patterns jarnotator will add jsr305 (see Web links) nullness related annotations like @javax.annotation.CheckForNull.

For instance if an explicit return null; statement is discovered the method bytecode will be annotated with @CheckForNull. By itself this will NOT influence the behaviour of the bytecode in any way. The annotation is however pickedup by the excellent findbugs (TM) (see Web links). If your code happens to call a @CheckForNull annotated method without perfoming a null-check findbugs (TM) will report this possible NullPointerException.

But jarnotator does not stop there. Annotation are not only put onto the methods. jarnotator can also propagate this constraint to other methods when necessary. If you already use jsr305 annotation you are in luck too. Not only can jarnotator discover missing annotation and propagate them. it can do the same for annotation add manually in your source code.

Possibly a few answers to question that my arise put in FAQ-style

  • Q: Can it annotate interfaces?
  • A: Yes, annotations applied to an interface implementation can be propagate to the interface.
  • Q: Can it annotate abstract classes?
  • A: Yes, annotations applied to an abstract method implementation can be propagate to the abstract parent.
  • Q: Method m1() returns a call to the null-returning method m2() directly. Will m1() be annotated as well?
  • A: Yes
  • Q: Will the jar have a dependency on the jarnotator jar after it has been processed?
  • A: No, not at all.
  • Q: Will the jar have a dependency on the jsr305 jar after it has been processed?
  • A: Possible. If the code is inspected with the Relfection API the jsr305 jar is needed. Probably the same for other annotation processing tool.
  • Q: Will new runtime checks be inserted in the bytecode?
  • A: No
  • Q: Will the runtime performance degrade?
  • A: No
  • Q: Does jarnotator perform any bytecode optimization?
  • A: No

Follow Me

Follow us on Twitter

Feed Display

Linux Today
Linux Today News Service
Linux Today
  • Linux File System Fsck Testing -- The Results Are In
    EnterpriseStorageForum: "It has been a while since we started the fsck project to test fsck (file system check) times on Linux file systems. After an extended delay, the Linux File System fsck testing results can now be presented."
  • Firefox 11 Gets SPDY
    Datamation: Google's speed-enhancing SPDY protocol lands in upcoming version of Mozilla's open source browser.
  • Piracy and the value of freedom
    Linux User & Developer: "If I were a victim of actual piracy while sailing the seas, I would probably consider the word's rampant misuse in technology circles as massively insulting."

Phoca - Google AdSense Easy

Google Search

Webwww.biggerbytes.be

RSS socialnet

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati
Add to BlinkBits
Copyright © 2012 BiggerBytes.Be. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.