-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support inner class contruction with outer instance (#2253)
- Loading branch information
Showing
3 changed files
with
67 additions
and
1 deletion.
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
33 changes: 33 additions & 0 deletions
33
jadx-core/src/test/java/jadx/tests/integration/inner/TestInnerConstructorCall.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,33 @@ | ||
package jadx.tests.integration.inner; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.tests.api.IntegrationTest; | ||
|
||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; | ||
|
||
public class TestInnerConstructorCall extends IntegrationTest { | ||
|
||
public static class TestCls { | ||
@SuppressWarnings("InnerClassMayBeStatic") | ||
public class A { | ||
public class AA { | ||
public void test() { | ||
} | ||
} | ||
} | ||
|
||
public void test() { | ||
A a = new A(); | ||
A.AA aa = a.new AA(); | ||
aa.test(); | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
assertThat(getClassNode(TestCls.class)) | ||
.code() | ||
.containsOne("A.AA aa = a.new AA();"); | ||
} | ||
} |