JEP 280 (Indify String Concat) integration

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Jan 27 09:24:38 UTC 2016


On 01/23/2016 12:20 AM, Alex Buckley wrote:
> On 1/22/2016 9:37 AM, Aleksey Shipilev wrote:
>> On 01/22/2016 05:44 PM, Peter Levart wrote:
>>> If StringConcatException ever gets thrown, will it propagate out of the
>>> concatenation expression execution? If yes, then it should probably be
>>> an unchecked exception, right?
>>
>> StringConcatException is modeled after LambdaConversionException: it
>> covers the linkage invariants, and it is thrown from bootstrap method
>> only. When BSM throws, call site initialization fails with
>> BootstrapMethodError, having this exception as the cause. Therefore, I
>> see no particular reason in making that exception unchecked.
> 
> In other words, StringConcatException will never (from the POV of the
> Java program) be the reason why evaluation of a string concat expression
> fails. The Java program would never catch StringConcatException if it
> was an unchecked exception class (since the JVM wraps SCE in BSME) ...
> and the Java program could never write 'catch (StringConcatException e)'
> if it was a checked exception class. So, there is no need to mention it
> in JLS 15.6.

Yes, exactly, thanks Alex!


Cheers,
-Aleksey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20160127/0bc4e2b5/signature.asc>


More information about the compiler-dev mailing list