On Wed, 3 Sep 2025 20:11:24 GMT, Daniel Gredler <[email protected]> wrote:

>> `TextLayout` should deal more gracefully with zero length strings. Currently 
>> the exception listed below is the one that is thrown.
>> 
>> `new TextLayout("", f, new FontRenderContext(null, false, false));`
>> 
>>> Exception in thread "main" java.lang.IllegalArgumentException: Zero length
>>> string passed to TextLayout constructor.
>>> at java.lang.Throwable.<init>(Compiled Code)
>>> at java.lang.Exception.<init>(Compiled Code)
>>> at java.lang.RuntimeException.<init>(Compiled Code)
>>> at java.lang.IllegalArgumentException.<init>(Compiled Code)
>>> at java.awt.font.TextLayout.<init>(Compiled Code)
>>> at test.main(Compiled Code)
>> 
>> **REVIEWER NOTE:** Please check the empty-string `TextLayout` behavior 
>> documented in `TextLayoutConstructorTest` carefully; a badly-behaving empty 
>> `TextLayout` is probably worse than a `TextLayout` which doesn't allow empty 
>> strings...
>
> Daniel Gredler has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Remove unnecessary call to text.first()

Marked as reviewed by serb (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/26947#pullrequestreview-3232663677

Reply via email to