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] Compiler error with nested classes and generics #2120

Open
nitram84 opened this issue Mar 9, 2024 · 0 comments
Open

[core] Compiler error with nested classes and generics #2120

nitram84 opened this issue Mar 9, 2024 · 0 comments
Labels
bug Core Issues in jadx-core module

Comments

@nitram84
Copy link
Contributor

nitram84 commented Mar 9, 2024

Issue details

I'm reporting this issue as a unit test:

package jadx.tests.integration.inner;

import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;
import org.junit.jupiter.api.Test;

import static jadx.tests.api.utils.JadxMatchers.containsOne;
import static jadx.tests.api.utils.JadxMatchers.countString;
import static org.hamcrest.MatcherAssert.assertThat;

public class TestInnerClass6 extends IntegrationTest {
	public static class TestCls {

		public static class RecyclerView {

			public static class ViewHolder {
			}

			public static class Adapter<T> {
			}
		}

		public static class TestAdapter extends RecyclerView.Adapter<TestAdapter.ViewHolder> {
			public static class ViewHolder extends RecyclerView.ViewHolder {
			}
		}
	}

	@Test
	public void test() {
		this.disableCompilation(); // TODO please remove this line, when this unit test passes
		ClassNode cls = getClassNode(TestInnerClass6.TestCls.class);
		String code = cls.getCode().toString();
		assertThat(code, countString(0, "<ViewHolder>"));
		assertThat(code, containsOne("<TestAdapter.ViewHolder>"));
	}
}

Jadx generates <ViewHolder> instead of <TestAdapter.ViewHolder>.

Relevant log output or stacktrace

No response

Provide sample and class/method full name

Example:
See e.g. class "in.pounkumar.restclient.Fragment.History.HistoryAdapter" in https://apkpure.com/rest-api-client/in.pounkumar.restclient/download/1.1.2

Jadx version

latest git

@nitram84 nitram84 added bug Core Issues in jadx-core module labels Mar 9, 2024
pull bot pushed a commit to 58563528/jadx that referenced this issue Mar 9, 2024
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

1 participant