-
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.
core: select correct array type element
- Loading branch information
Showing
2 changed files
with
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package jadx.tests.internal; | ||
|
||
import jadx.api.InternalJadxTest; | ||
import jadx.core.dex.nodes.ClassNode; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.hamcrest.CoreMatchers.containsString; | ||
import static org.hamcrest.CoreMatchers.not; | ||
import static org.junit.Assert.assertThat; | ||
|
||
public class TestTmp2 extends InternalJadxTest { | ||
|
||
public static class TestCls extends Exception { | ||
int c; | ||
String d; | ||
String f; | ||
|
||
public void testComplexIf(String a, int b) { | ||
if (d == null || (c == 0 && b != -1 && d.length() == 0)) { | ||
c = a.codePointAt(c); | ||
} else { | ||
if (a.hashCode() != 0xCDE) { | ||
c = f.compareTo(a); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
ClassNode cls = getClassNode(TestCls.class); | ||
String code = cls.getCode().toString(); | ||
System.out.println(code); | ||
|
||
assertThat(code, containsString("return;")); | ||
assertThat(code, not(containsString("else"))); | ||
} | ||
} |