Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inner and anonymous classes not present in FernFlower decompilation #88

Closed
TheKodeToad opened this issue Jul 22, 2022 · 4 comments
Closed

Comments

@TheKodeToad
Copy link

TheKodeToad commented Jul 22, 2022

Source file:

public class Main {

    Status status = Status.OK;

    void run() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                status = Status.ABORTED;
            }
        }).start();
    }

    enum Status {
        OK,
        ABORTED
    }

}

Decompilation (ECD FernFlower):

import Main.1;
import Main.Status;

public class Main {
	Status status;

	public Main() {
		this.status = Status.OK;
	}

	void run() {
      (new Thread(new 1(this))).start();
   }
}

/*
	DECOMPILATION REPORT

	Decompiled from: /home/me/eclipse-workspace/Example/bin/Main.class
	Total time: 7 ms
	
	Decompiled with FernFlower.
*/

Decompilation (CLI FernFlower):

public class Main {
   Main.Status status;

   public Main() {
      this.status = Main.Status.OK;
   }

   void run() {
      (new Thread(new Runnable() {
         public void run() {
            Main.this.status = Main.Status.ABORTED;
         }
      })).start();
   }

   static enum Status {
      OK,
      ABORTED;
   }
}
@jpstotz
Copy link
Collaborator

jpstotz commented Jul 22, 2022

@TheKodeToad Please provide a full description of your problem including an example of the decompiled class that you think is decompiled wrong. Note that ECD just uses FernFlower so unless it is a missing option set when using FernFlower the ECD issues tracker is the wrong place for your issue.

@TheKodeToad
Copy link
Author

TheKodeToad commented Jul 22, 2022

It pretty much happens in all cases, which is why I felt a description wasn't necceccary.
I have updated it now.

@jpstotz
Copy link
Collaborator

jpstotz commented Jul 25, 2022

Thanks, I was able to reproduce the problem. Even using the same FernFlower library included in ECD on command-line the output is OK, via ECD not.

The root cause seems to be that ECD filters the classes provided to FernFlower in an incorrect way.

@jpstotz
Copy link
Collaborator

jpstotz commented Jul 25, 2022

I fixed the problem, it fix will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants