Skip to content

[Bug]: Wrong Jimple generation #987

@stschott

Description

@stschott

What happened?

For cases like the following code the Jimple generation is wrong, as it tries removes the conditional expression and just appends "c" to the string:

void method (boolean condition) {
    String s = "a" + (condition ? "b" : "c")
}

This only happen for code compiled with JDK 8 or earlier. It will probably also happen for other conditional expressions.

Please see https://github.com/soot-oss/SootUp/tree/fix/conditionalStringConcat for a test case.

Version

Latest develop branch

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions