Intellij decompiler (fernflower decompiler) stopped working correctly.

Hi,

Some weeks ago i made utility to import jar from project and extract it to .java files. It worked correctly but now when i'm trying to decompile class it have different output (no methods implementation and different comments in file/wrong import statements). Here is how i do it:

ClassFileDecompiler cfd = new ClassFileDecompiler();
File file = new File(path);
CharSequence javaFileData = cfd.decompile(LocalFileSystem.getInstance().findFileByIoFile(file));

Earlier it gave me 

// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)

and methods implementation, now it give me:

// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available

When I open .class file in intellij it decompile it like i want but when I'm trying to do it programmatically it stopped working.

0
1 comment

Sorry for the late reply :(

I can think of two reasons for that: (1) the "full" decompiler is unable to process a file so it falls back to the skeleton-only one, or (2) the "Java Bytecode Decompiler" plugin is disabled.

Instead of using `com.intellij.psi.impl.compiled.ClassFileDecompiler#decompile`, try to invoke `org.jetbrains.java.decompiler.IdeaDecompiler#decompile` directly.

0

Please sign in to leave a comment.