On Tue, 24 Mar 2026 04:47:30 GMT, Trupti Patil <[email protected]> wrote:

> Fixed PrintNullString.java to accept empty iterator as a valid input.
> With recent TextLayout changes, empty iterators are treated as a no-op 
> (similar to empty strings) and no longer throw IllegalArgumentException, 
> causing the previous expectation to fail on newer JDKs.
> 
> Tested the fix on windows, macOS and linux; it works as expected across all 
> platforms.

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 40:

> 38: /*
> 39:  * @test
> 40:  * @bug 4223328 8377534

Suggestion:

 * @bug 4223328 4138921

We don't add the bug id for a test bug. If I get the situation correctly, the 
behaviour changed as the result of 
[4138921](https://bugs.openjdk.org/browse/JDK-4138921), therefore that bug id 
needs to be added.

test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 110:

> 108: 
> 109:         g2d.drawString(emptyIterator, 20, 140);
> 110:         g2d.drawString("OK for empty iterator, int", 20, 140);

So, the code was updated by 
[JDK-4138921](https://bugs.openjdk.org/browse/JDK-4138921) in #26947, but the 
test wasn't updated.

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

PR Review: https://git.openjdk.org/jdk/pull/30389#pullrequestreview-4002369232
PR Review Comment: https://git.openjdk.org/jdk/pull/30389#discussion_r2984352567
PR Review Comment: https://git.openjdk.org/jdk/pull/30389#discussion_r2984341242

Reply via email to