Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v54]

2023-04-08 Thread Jim Laskey
On Fri, 7 Apr 2023 09:32:59 GMT, ExE Boss  wrote:

>> Jim Laskey has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Recommended changes
>
> src/java.base/share/classes/java/lang/StringConcatHelper.java line 364:
> 
>> 362: try {
>> 363: return value.prepend(indexCoder, buf);
>> 364: } catch (Throwable ex) {
> 
> This should rethrow errors (such as `OutOfMemoryError`):
> Suggestion:
> 
> } catch (Error err) {
> throw err;
> } catch (Throwable ex) {

Changing

> src/java.base/share/classes/java/lang/runtime/StringTemplateImpl.java line 
> 100:
> 
>> 98: try {
>> 99: return (List)valuesMH.invokeExact(this);
>> 100: } catch (RuntimeException | OutOfMemoryError ex) {
> 
> Suggestion:
> 
> } catch (RuntimeException | Error ex) {

Changing

> src/java.base/share/classes/java/lang/runtime/StringTemplateImpl.java line 
> 111:
> 
>> 109: try {
>> 110: return (String) interpolateMH.invokeExact(this);
>> 111: } catch (RuntimeException | OutOfMemoryError ex) {
> 
> Suggestion:
> 
> } catch (RuntimeException | Error ex) {

Changing

-

PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1161119626
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1161119647
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1161119669


Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v54]

2023-04-07 Thread ExE Boss
On Tue, 4 Apr 2023 16:07:54 GMT, Jim Laskey  wrote:

>> Enhance the Java programming language with string templates, which are 
>> similar to string literals but contain embedded expressions. A string 
>> template is interpreted at run time by replacing each expression with the 
>> result of evaluating that expression, possibly after further validation and 
>> transformation. This is a [preview language feature and 
>> API](http://openjdk.java.net/jeps/12).
>
> Jim Laskey has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Recommended changes

These should rethrow all `Error`s:

src/java.base/share/classes/java/lang/StringConcatHelper.java line 364:

> 362: try {
> 363: return value.prepend(indexCoder, buf);
> 364: } catch (Throwable ex) {

This should rethrow errors (such as `OutOfMemoryError`):
Suggestion:

} catch (Error err) {
throw err;
} catch (Throwable ex) {

src/java.base/share/classes/java/lang/runtime/StringTemplateImpl.java line 100:

> 98: try {
> 99: return (List)valuesMH.invokeExact(this);
> 100: } catch (RuntimeException | OutOfMemoryError ex) {

Suggestion:

} catch (RuntimeException | Error ex) {

src/java.base/share/classes/java/lang/runtime/StringTemplateImpl.java line 111:

> 109: try {
> 110: return (String) interpolateMH.invokeExact(this);
> 111: } catch (RuntimeException | OutOfMemoryError ex) {

Suggestion:

} catch (RuntimeException | Error ex) {

-

PR Review: https://git.openjdk.org/jdk/pull/10889#pullrequestreview-1376048871
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1160580952
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1160595676
PR Review Comment: https://git.openjdk.org/jdk/pull/10889#discussion_r1160595790


Re: RFR: JDK-8285932 Implementation of JEP 430 String Templates (Preview) [v54]

2023-04-04 Thread Jim Laskey
> Enhance the Java programming language with string templates, which are 
> similar to string literals but contain embedded expressions. A string 
> template is interpreted at run time by replacing each expression with the 
> result of evaluating that expression, possibly after further validation and 
> transformation. This is a [preview language feature and 
> API](http://openjdk.java.net/jeps/12).

Jim Laskey has updated the pull request incrementally with one additional 
commit since the last revision:

  Recommended changes

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/10889/files
  - new: https://git.openjdk.org/jdk/pull/10889/files/6274eb3f..4c6d70d1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=10889=53
 - incr: https://webrevs.openjdk.org/?repo=jdk=10889=52-53

  Stats: 8 lines in 3 files changed: 4 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/10889.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/10889/head:pull/10889

PR: https://git.openjdk.org/jdk/pull/10889