RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]
    Jim Laskey 
    jlaskey at openjdk.org
       
    Mon Oct 31 13:04:32 UTC 2022
    
    
  
On Fri, 28 Oct 2022 19:08:56 GMT, Rémi Forax <forax at openjdk.org> wrote:
>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update TemplateRuntime::combine
>
> src/java.base/share/classes/java/lang/template/StringTemplate.java line 149:
> 
>> 147:      * {@return the interpolation of the StringTemplate}
>> 148:      */
>> 149:     default String interpolate() {
> 
> I wonder if all the default methods should not be better as static methods given that they are not the important part of the API but more side information that may be handy
Actually instance interpolate() is the most important method. Each synthetic StringTemplate gets a specialized interpolate providing performance equivalent to string concat. And, a good percentage  of processors will work with the result of interpolate to produce result. Ex. `StringProcessor STR = st -> st.interpolate();` and`TemplateProcessor<JSONObject> JSON = st -> new JSONObject(st.interpolate());`
-------------
PR: https://git.openjdk.org/jdk/pull/10889
    
    
More information about the security-dev
mailing list