Skip to content

String concatenation: dynamicinvoke is not implemented - JDK 11 #388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alisevych opened this issue Jul 4, 2022 · 1 comment · Fixed by #423
Closed

String concatenation: dynamicinvoke is not implemented - JDK 11 #388

alisevych opened this issue Jul 4, 2022 · 1 comment · Fixed by #423
Assignees
Labels
ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team

Comments

@alisevych
Copy link
Member

alisevych commented Jul 4, 2022

Description

Concatenation of Strings - with "+" operator - with JDK 11. Test generation reports an error in test file:
dynamicinvoke is not implemented "makeConcatWithConstants"

To Reproduce

Steps to reproduce the behavior:

  1. Open IntelliJ IDEA
  2. Plugin is installed
  3. A Maven/Gradle/Idea project with JDK 11 is opened
  4. Add a class using concatenation of Strings (with one stored in a variable) like:
public class StringExample {
    public void output() {
        String example = "Some text";
        System.out.println("Plus " + example);
    }
}

Expected behavior

Tests are supposed to be generated.

Actual behavior

The following test class is generated:

public class StringExampleTest {
    ///region Test suites for executable org.example.StringExample.output


    ///region Errors report for output

    public void testOutput_errors() {
        // Couldn't generate some tests. List of errors:
        // 
        // 1 occurrences of:
        /* An operation is not implemented: dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>("Some text")
        <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Plus \u0001") */

    }
    ///endregion

    ///endregion

}

Environment

Windows 10 Pro
IntelliJ IDEA 2022.1.3
JDK 11
UTBotJava plugin version

@alisevych alisevych added ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team labels Jul 4, 2022
@alisevych alisevych changed the title String concatenation: dynamicinvoke is not implemented String concatenation: dynamicinvoke is not implemented - JDK 11 Jul 4, 2022
@dtim
Copy link
Collaborator

dtim commented Jul 4, 2022

Related to #386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants