-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve class search for super call (#1512)
- Loading branch information
Showing
4 changed files
with
83 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
jadx-core/src/test/java/jadx/tests/integration/invoke/TestSuperInvokeUnknown.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package jadx.tests.integration.invoke; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.tests.api.IntegrationTest; | ||
|
||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; | ||
|
||
public class TestSuperInvokeUnknown extends IntegrationTest { | ||
|
||
public static class TestCls { | ||
public static class BaseClass { | ||
public int doSomething() { | ||
return 0; | ||
} | ||
} | ||
|
||
public static class NestedClass extends BaseClass { | ||
@Override | ||
public int doSomething() { | ||
return super.doSomething(); | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
disableCompilation(); | ||
noDebugInfo(); | ||
assertThat(getClassNode(TestCls.NestedClass.class)) // BaseClass unknown | ||
.code() | ||
.containsOne("return super.doSomething();"); | ||
} | ||
|
||
@Test | ||
public void testTopCls() { | ||
noDebugInfo(); | ||
assertThat(getClassNode(TestCls.class)) | ||
.code() | ||
.containsOne("return super.doSomething();"); | ||
} | ||
} |