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/patch included] False positives when generating @Override annotations - Reloaded #984

Closed
nitram84 opened this issue Sep 24, 2020 · 1 comment
Labels
bug Core Issues in jadx-core module

Comments

@nitram84
Copy link
Contributor

Thanks for applying #976 and fixing the issue with static methods. But we both still missed one more case: package-private

test.Test1

package test;

public class Test1 {
  void a() {
  }
}

test.Test2

package test;

public class Test2 extends Test1 {
  @Override
  public void a() {
  }
}

test2.Test2

package test2;

import test.Test1;

public class Test2 extends Test1 {
  // JADX generates @Override here, which is not allowed
  public void a() {
  }
}

The patch to fix this is attached (override-package-private.patch.txt). As things get more complex here, I think creating unit tests for both cases helps to prevent regressions.

@nitram84 nitram84 added Core Issues in jadx-core module bug labels Sep 24, 2020
skylot added a commit that referenced this issue Sep 24, 2020
Signed-off-by: Skylot <skylot@gmail.com>
@skylot
Copy link
Owner

skylot commented Sep 24, 2020

@nitram84 thanks again!
I have made another fix: all access modifiers checks moved to a separate method and I have explicitly mentioned all possible flags.
Looks like I missed case with package-private because with default options jadx replace it with public modifier (this can be disabled with enabling Respect bytecode access modifiers option). Eventually, I plan to remove that action, but right now not every visibility issues are covered.

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