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

Vicente Romero vicente.romero at oracle.com
Tue May 21 18:27:21 UTC 2019


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 Map<Integer, 
Integer> to indicate the first index of a non-whitespace per line. I 
concede that you probably won't be able to use a lambda at the end but 
you will avoid invoking String::indexOfNonWhitespace per line again at 
String::stripIndent

Thanks,
Vicente

On 5/21/19 10:56 AM, Jim Laskey wrote:
> 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 you.
>
> -- Jim
>
> webrev: http://cr.openjdk.java.net/~jlaskey/8223775/webrev-01 <http://cr.openjdk.java.net/~jlaskey/8223775/webrev-01>
> jbs: https://bugs.openjdk.java.net/browse/JDK-8223775 <https://bugs.openjdk.java.net/browse/JDK-8223775>
> csr: https://bugs.openjdk.java.net/browse/JDK-8223776 <https://bugs.openjdk.java.net/browse/JDK-8223776>
> jep: https://bugs.openjdk.java.net/browse/JDK-8222530 <https://bugs.openjdk.java.net/browse/JDK-8222530>
>
>



More information about the core-libs-dev mailing list