Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-23 Thread Peter Levart
Hi, Excuse me for asking, but I can't find any text describing motivation for introduction of this method in JEP-355 other than "Developers will have access to this algorithm via String::stripIndent instance method"... If I understand the JEP correctly, this is an algorithm that is applied t

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-23 Thread Brent Christian
Hi, Jim I have a few comments on the webrev. src/java.base/share/classes/java/lang/String.java 2982 private static int outdent(List lines) { Can you please add a doc comment for what this method does? 2973 .map(line -> { 2974 int firstNonWhitespace = line.indexOfNonWhitespace(); 29

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-23 Thread Brent Christian
Hi, I have a couple questions/comments about the special treatment of the last line in a text block. -- In the CSR we have: "3. If the last line in the list of individual lines (i.e., the line with the text block closing delimiter) is blank, then add it to the set of determining lines. (The

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-22 Thread Alex Buckley
On 5/21/2019 4:19 PM, Alex Buckley wrote: On 5/21/2019 2:10 PM, Jim Laskey wrote: Updated version http://cr.openjdk.java.net/~jlaskey/8223775/webrev-02 API spec looks good, but it was a surprise to learn that stripIndent performs normalization of line terminators: "@return string with margins

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Alex Buckley
On 5/21/2019 2:10 PM, Jim Laskey wrote: Updated version http://cr.openjdk.java.net/~jlaskey/8223775/webrev-02 This webrev substantially updates the API spec, which is really a topic for amber-spec-experts (keep reading to see why). Cross-posting between -dev and -spec-experts lists is not goo

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Jim Laskey
Updated version http://cr.openjdk.java.net/~jlaskey/8223775/webrev-02 > On May 21, 2019, at 3:11 PM, Alex Buckley wrote: > > On 5/21/2019 7:56 AM, Jim Laskey wrote: >> Please do a code review of the new String::stripIndent instance metho

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Vicente Romero
Hi, On 5/21/19 2:37 PM, Jim Laskey wrote: On May 21, 2019, at 3:27 PM, Vicente Romero wrote: Hi Jim, Some minor comments: - the javadoc for String::stripIndent needs some formating. There is a solitary "counted. The" Looking for a code review at this point. Will get to API soon. - at m

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Jim Laskey
> On May 21, 2019, at 3:27 PM, Vicente Romero wrote: > > Hi Jim, > > Some minor comments: > > - the javadoc for String::stripIndent needs some formating. There is a > solitary "counted. The" Looking for a code review at this point. Will get to API soon. > - at method String::stripIndent,

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Jim Laskey
Thank you. I haven't really put the API out for CSR review as yet. This is current state remnant from Stuart's Raw String Literals CSR review. He and I hope to reform this very soon. Your comments will provide a good starting point. Cheers, -- Jim > On May 21, 2019, at 3:11 PM, Alex Buckley

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Vicente Romero
Hi Jim, Some minor comments: - the javadoc for String::stripIndent needs some formating. There is a solitary "counted. The" - at method String::stripIndent, you can bail out and do nothing if outdent==0 - suggestion: method String::outdent could return a MapInteger> to indicate the first index

Re: RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Alex Buckley
On 5/21/2019 7:56 AM, Jim Laskey wrote: Please do a code review of the new String::stripIndent instance method. My interest is in the API spec because the JLS will make normative reference to it. "Removes horizontal white space margins from the essential body of a Text Block originated stri

RFR - JDK-8223775 String::stripIndent (Preview)

2019-05-21 Thread Jim Laskey
Please do a code review of the new String::stripIndent instance method. This instance method is being introduced to support JEP-355: Text Blocks, by removing incidental indentation from the text block content. The algorithm used is defined in the JEP and also described in the JBS entry. Thank y