-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve blocks tree compare for finally extract (#1501)
- Loading branch information
Showing
7 changed files
with
147 additions
and
34 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
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
45 changes: 45 additions & 0 deletions
45
jadx-core/src/test/java/jadx/tests/integration/trycatch/TestTryCatchFinally14.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,45 @@ | ||
package jadx.tests.integration.trycatch; | ||
|
||
import jadx.tests.api.IntegrationTest; | ||
import jadx.tests.api.extensions.profiles.TestProfile; | ||
import jadx.tests.api.extensions.profiles.TestWithProfiles; | ||
|
||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; | ||
|
||
public class TestTryCatchFinally14 extends IntegrationTest { | ||
|
||
@SuppressWarnings("unused") | ||
public static class TestCls { | ||
private TCls t; | ||
|
||
public void test() { | ||
try { | ||
if (t != null) { | ||
t.doSomething(); | ||
} | ||
} finally { | ||
if (t != null) { | ||
t.doFinally(); | ||
} | ||
} | ||
} | ||
|
||
private static class TCls { | ||
public void doSomething() { | ||
} | ||
|
||
public void doFinally() { | ||
} | ||
} | ||
} | ||
|
||
@TestWithProfiles({ TestProfile.DX_J8, TestProfile.D8_J11, TestProfile.JAVA8 }) | ||
public void test() { | ||
assertThat(getClassNode(TestCls.class)) | ||
.code() | ||
.containsOne(".doSomething();") | ||
.containsOne("} finally {") | ||
.containsOne(".doFinally();") | ||
.countString(2, "!= null) {"); | ||
} | ||
} |