ecd-plugin / ecd

An Eclipse Plugin to integrate different Class Decompiler seamlessly into the development workflow
Eclipse Public License 1.0
261 stars 57 forks source link

Inner classes are missing #94

Open supersache opened 1 year ago

supersache commented 1 year ago

It is a bit of a mystery that noone has brought this up before... Regardless of which decompiler you chose, inner classes are always missing in the decompiled eclipse view. So are references to those, e.g. class attributes whose type is an inner class of another type.

jpstotz commented 1 year ago

Most decompiler require direct access to the class files, so ECD has to extract the necessary classes. Inner classes are stored in separate class file(s) and if they are missing this may indicate that they had not been extracted and are thus not decompiled.

If you have an example JAR file that contains a class where you miss the inner classes please check if e.g. standalone jd-gui shows the inner class. If it shows the inner class it would be nice of you if you could provide that Jar to me so I could check it in detail what is going wrong.

JanecekPetr commented 1 month ago

I stumbled on ths issue because I am indeed seeing similar things. However, there are at least two different issues at hand, so let's make it more specific.

  1. I have a jar (which I cannot distribute, but will try with a different one and report back) on which I call the "Export Source" action. Doesn't matter whether it's on the whole jar or a single package. This generates a zip file containing all decompiled .java sources ... but without the inner classes. If I specifically call "Export sources" on a single inner class, it works. If I select multiple class files, the inner classes are not included.

  2. By default inner class files are not visible in the Project Explorer. This ties into point 1, actually point 1 makes this problem seem much worse than it is. It looks like the decompiler does not see the inner class files at all because they're not in the Package explorer and they're not exported when decompiling the whole jar. However, this can be configured. In other words, the inner class files are hidden by default, but can be displayed at will, and decompiled one by one.

obrazek

What I want, obviously, is to fix the first issue. If that works as expected, the second issue would never even seem like an issue. Extra points for decompiling the inner classes automatically when only the outer class is selected for the extraction.