Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8186500

StringConcatFactory.makeConcatWithConstants throws AssertionError when recipe contains non-String constants

    Details

      Description

      The below code snippet when compiled and run on JDK9, throws Assertion error.

              StringConcatFactory.makeConcatWithConstants(lookup(), "name",
                      MethodType.methodType(String.class, String.class, String.class), "\1\2\1", (Integer)1);

      Though method is intended as BSM for indyfying string concatenation, javac seems to never produce a recipe with non-string constants. But when used directly as an API, recipe can be provided any constants as per javadoc.

        Attachments

          Activity

            People

            • Assignee:
              redestad Claes Redestad
              Reporter:
              pgundarlahal Prashanthram Gundarlahally
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: