views:

73

answers:

1

I have used jad for many years, most of these with the Jadclipse plugin to eclipse which makes it quite usable. Especially with the "Align code for debugging" which allows you to see the decompiled code for any line in a stack trace. Very nice.

Unfortunately I've seen more and more that the <- MISALIGNED -> comment sneaks in, which is most likely because jad expects the classfile to be in order which clearly is not the case for the Java 6 runtime library. Hence when writing the file, and an instruction says "this is line 100" then 99 empty lines are written, and if then the next instruction says "this is for line 10" then jad cannot rewind to put that output there, but just prints out a comment that this is in the wrong place.

Here is an example for HttpURLConnection:

          protected HttpURLConnection(URL url, Proxy proxy, Handler handler1)
            {
/* <-MISALIGNED-> */ /* 603*/        super(url);
/* <-MISALIGNED-> */ /* 192*/        ps = null;
/* <-MISALIGNED-> */ /* 196*/        errorStream = null;
/* <-MISALIGNED-> */ /* 199*/        setUserCookies = true;
/* <-MISALIGNED-> */ /* 200*/        userCookies = null;
/* <-MISALIGNED-> */ /* 220*/        currentProxyCredentials = null;
/* <-MISALIGNED-> */ /* 221*/        currentServerCredentials = null;
/* <-MISALIGNED-> */ /* 222*/        needToCheck = true;
/* <-MISALIGNED-> */ /* 223*/        doingNTLM2ndStage = false;
/* <-MISALIGNED-> */ /* 224*/        doingNTLMp2ndStage = false;
/* <-MISALIGNED-> */ /* 226*/        tryTransparentNTLMServer = NTLMAuthentication.supportsTransparentAuth();
/* <-MISALIGNED-> */ /* 227*/        tryTransparentNTLMProxy = NTLMAuthentication.supportsTransparentAuth();
/

The question is now if there is another decompiler which generates more accurate output linewise. The actual decompilation does not need to be extremely great or anything, but I really like it to be where the Java Stack Trace view expects it to be. If it works well with Jadclipse, thats even better.

A: 

I use jad with as little formatting as possible and then I use eclipse's format command, as I can make it match my preferred style from the preferences.

Peter DeWeese
Doesn't that break the association between line numbers in the stack trace and the line numbers after the Eclipse formatter is done?
Thorbjørn Ravn Andersen