-
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.
fix: correct args shift for instance invoke-custom (#1816)
- Loading branch information
Showing
2 changed files
with
38 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
36 changes: 36 additions & 0 deletions
36
jadx-core/src/test/java/jadx/tests/integration/java8/TestLambdaInstance2.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,36 @@ | ||
package jadx.tests.integration.java8; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.tests.api.IntegrationTest; | ||
|
||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; | ||
|
||
public class TestLambdaInstance2 extends IntegrationTest { | ||
|
||
public static class TestCls { | ||
private String field; | ||
|
||
public Runnable test(String str, int i) { | ||
return () -> call(str, i); | ||
} | ||
|
||
public void call(String str, int i) { | ||
field = str + '=' + i; | ||
} | ||
|
||
public void check() throws Exception { | ||
field = ""; | ||
test("num", 7).run(); | ||
assertThat(field).isEqualTo("num=7"); | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
assertThat(getClassNode(TestCls.class)) | ||
.code() | ||
.doesNotContain("lambda$") | ||
.containsOne("call(str, i)"); | ||
} | ||
} |