-
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: don't inline constants in synchronized statement (#799)
- Loading branch information
Showing
5 changed files
with
66 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
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
30 changes: 30 additions & 0 deletions
30
jadx-core/src/test/java/jadx/tests/integration/synchronize/TestNestedSynchronize.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,30 @@ | ||
package jadx.tests.integration.synchronize; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import jadx.tests.api.SmaliTest; | ||
|
||
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; | ||
|
||
public class TestNestedSynchronize extends SmaliTest { | ||
|
||
// @formatter:off | ||
/* | ||
public final void test() { | ||
Object obj = null; | ||
Object obj2 = null; | ||
synchronized (obj) { | ||
synchronized (obj2) { | ||
} | ||
} | ||
} | ||
*/ | ||
// @formatter:on | ||
|
||
@Test | ||
public void test() { | ||
assertThat(getClassNodeFromSmali()) | ||
.code() | ||
.countString(2, "synchronized"); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
jadx-core/src/test/smali/synchronize/TestNestedSynchronize.smali
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,14 @@ | ||
.class public final Lsynchronize/TestNestedSynchronize; | ||
.super Ljava/lang/Object; | ||
.source "TestNestedSynchronize.java" | ||
|
||
.method public final test()V | ||
.locals 2 | ||
const/4 v0, 0 | ||
const/4 v1, 0 | ||
monitor-enter v0 | ||
monitor-enter v1 | ||
monitor-exit v1 | ||
monitor-exit v0 | ||
return-void | ||
.end method |