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

Need to define the behaviour for 0 and 1 argument method type in StringConcatFactory.makeConcat

XMLWordPrintable

      Method type restrictions for StringConcatFactory.makeConcat are about return type & maximum number of arguments. This would mean 0 & 1 argument method types are valid. This calls for the definition for concatenation with 0 & 1 params.
      Specifically
      StringConcatFactory.makeConcat(lookup(),
                                                              "name",
                                                             MethodType.methodType(String.class));
      and
      StringConcatFactory.makeConcat(lookup(),
                                                              "name",
                                                             MethodType.methodType(String.class, String.class));

      Note: Though the API refers to JLS 15.18.1 "String Concatenation Operator +", the JLS section only talk about concatenation of 2 arguments.

            psandoz Paul Sandoz
            pgundarlahal Prashanthram Gundarlahally
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: