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

[core] Compilation issues with nested anonymous classes #1305

Closed
nitram84 opened this issue Dec 11, 2021 · 1 comment
Closed

[core] Compilation issues with nested anonymous classes #1305

nitram84 opened this issue Dec 11, 2021 · 1 comment
Labels
bug Core Issues in jadx-core module

Comments

@nitram84
Copy link
Contributor

I would like to report some compilation issues with nested anonymous classes. I tested the following sample with latest git revision 0f00fb9 and openjdk8:

public class JobProcessor {

  public interface Job {
    public void executeJob();
  }

  public void start() {
    runJob(new Job() {
      @Override
      public void executeJob() {
        runJob(new Job() {

          @Override
          public void executeJob() {
            doSomething();
          }
        });
      }

      private void doSomething() {
      }

    });
  }

  public static void runJob(Job job) {
  }
}

Case 1: When I am using this settings
[x] inline anonymous classes
[x] inline methods
the result can't be compiled since "AnonymousClass1" does not exist.

Case 2: When I am using this settings
[ ] inline anonymous classes
[x] inline methods
the result can't be compiled too. Error is "class JobProcessor.AnonymousClass1 is already defined in class JobProcessor".

I'm getting the same result with java-input and java-convert.

This sample can be used in unit tests.

@nitram84 nitram84 added bug Core Issues in jadx-core module labels Dec 11, 2021
@skylot
Copy link
Owner

skylot commented Dec 12, 2021

@nitram84 both cases fixed. In second case was a stupid bug in rename code 😕
Thanks for report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

2 participants