Give me the damn source!

10 AM December 4, 2007

After taking a much-needed break, I’m back programming Java. Much to my surprise, I’m enjoying it. However, there is still one wound that time hasn’t healed: JAR files without source.

Oh, the hair I’ve pulled out, staring at Javadoc, trying to divine whether a function returns null or empty array to indicate no-result! The co-workers I’ve disturbed swearing at RuntimeExceptions thrown from ten layers beneath the API! The unwarranted pride I’ve felt correctly guessing a working sequence of method calls!

Fortunately, I have found a partial relief in JadClipse, a Java decompiler for Eclipse. JadClipse not only does a reasonable job of recovering source, it also attempts to match up the line numbers in the generated code with the line numbers in the .class file so I can trace execution in the debugger. JadClipse is much happy-making.

A few notes:

  1. JadClipse relies on a native executable, Jad, to do the decompilation.
  2. Jad does not come with source.
  3. Time spent perusing the JadClipse preferences page is well rewarded.
  4. Be careful what you decompile. Many sourceless packages have licenses that prohibit reverse engineering. One wrong click, and you could be sued.
By alang | # | Comments (1)
(Posted to Software Development and Java)
© 2003-2006 Alan Green