fix: don't generate string concatenation without assign to variable

This commit is contained in:
Skylot
2020-05-12 22:51:38 +01:00
parent f482b8b95c
commit 58722d372e
3 changed files with 45 additions and 1 deletions
@@ -0,0 +1,32 @@
package jadx.tests.integration.others;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jadx.tests.api.IntegrationTest;
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat;
public class TestStringConcatWithoutResult extends IntegrationTest {
private static final Logger LOG = LoggerFactory.getLogger(TestStringConcatWithoutResult.class);
public static class TestCls {
public static final boolean LOG_DEBUG = false;
public void test(int i) {
String msg = "Input arg value: " + i;
if (LOG_DEBUG) {
LOG.debug(msg);
}
}
}
@Test
public void test() {
noDebugInfo();
assertThat(getClassNode(TestCls.class))
.code()
.containsOne(" = \"Input arg value: \" + i;");
}
}