java-decompiler / jd-gui

A standalone Java Decompiler GUI
GNU General Public License v3.0
14.02k stars 2.39k forks source link

Incorrect decompilation for org.mortbay.start.Main #18

Closed PeterWippermann closed 9 years ago

PeterWippermann commented 9 years ago

First of all, thanks for this software! It's a great piece of work and very helpful :-)

Here's the bug I discovered. I tried to decompile the following class: http://grepcode.com/file/repo1.maven.org/maven2/org.mortbay.jetty/start/6.1.23/org/mortbay/start/Main.java

The respective jar should be available here: http://grepcode.com/snapshot/repo1.maven.org/maven2/org.mortbay.jetty/start/6.1.23/

I noticed that line numbering is incorrect in JD-IntelliJ and double-checked in JD-GUI. Then I noticed, that the decompiled source is not correct and thus the line number also fails.

It seems that between those two lines in the original (!) source, the decompiler becomes confused:

486  System.setProperty("java.class.path",.toString());
487 ClassLoader cl=.getClassLoader();

In JD-GUI the result of the decompilation looks like this: jd-gui snapshot

emmanue1 commented 9 years ago

Thanks for this feedback. I keep & close this issue : this is not a GUI bug.

PeterWippermann commented 9 years ago

Hi Emmanuel,

I also concluded that this bug must be rather related to the underlying base of the decompiler, which is also used in the IDE plugins. But it’s up to you to destinct this. And in addition: there’s no possibility to raise bugs for the decompiler base, is there?

Best regards, Peter

Von: Emmanuel Dupuy [mailto:notifications@github.com] Gesendet: Sonntag, 14. Juni 2015 21:34 An: java-decompiler/jd-gui Cc: Wippermann, Peter Betreff: Re: [jd-gui] Incorrect decompilation for org.mortbay.start.Main (#18)

Thanks for this feedback. I keep & close this issue : this is not a GUI bug.

— Reply to this email directly or view it on GitHubhttps://github.com/java-decompiler/jd-gui/issues/18#issuecomment-111868640.


BearingPoint GmbH Geschäftsführer: Marcel Nickler (Vorsitzender), Hans-Werner Wurzel (stellv. Vorsitzender), Kiumars Hamidian, Matthias Loebich, Kai Wächter, Dr. Robert Wagner Vorsitzender des Aufsichtsrats: Beat Leimbacher Sitz: Frankfurt am Main Registergericht: Amtsgericht Frankfurt am Main HRB 55490

The information in this email is confidential and may be legally privileged. If you are not the intended recipient of this message, any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you are not the intended recipient, please reply to or forward a copy of this message to the sender and delete the message, any attachments, and any copies thereof from your system.

emmanue1 commented 9 years ago

Hi Peter, it's exact.

The current JD-Core, born in 2007, is based on a simple "Pattern Matching Engine", like JAD. One of the hardest things is to correctly recognize the end of a try-catch-finally. The next major release will be based on "Control Flow Graph" and will be published on GitHub.

Regards.