fix: preserve original method details in inlined invocation (PR #1049)

This commit is contained in:
Jonas Konrad
2020-12-12 20:08:50 +01:00
committed by GitHub
parent 035fce6191
commit 96dea75bc8
2 changed files with 48 additions and 0 deletions
@@ -0,0 +1,41 @@
package jadx.tests.integration.invoke;
import org.junit.jupiter.api.Test;
import jadx.tests.api.SmaliTest;
import static jadx.tests.api.utils.JadxMatchers.containsOne;
import static org.hamcrest.MatcherAssert.assertThat;
public class TestCastInOverloadedAccessor extends SmaliTest {
static class X {
void test() {
new Runnable() {
@Override
public void run() {
outerMethod("");
outerMethod("", "");
}
};
}
private void outerMethod(String s) {
}
private void outerMethod(String s, String t) {
}
private void outerMethod(int a) {
}
private void outerMethod(int a, int b) {
}
}
@Test
public void test() {
String code = getClassNode(X.class).getCode().getCodeStr();
assertThat(code, containsOne("outerMethod(\"\")"));
assertThat(code, containsOne("outerMethod(\"\", \"\")"));
}
}