On Fri, 13 Nov 2026 20:35:17 GMT, Phil Race <[email protected]> wrote:

> This  updates the test FCComposite.java to not expect the first fontconfig 
> font to be used by JDK fonts if it is a variation font. 
> This change can be reverted after we support variation fonts.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Marked as reviewed by aivanov (Reviewer).

test/jdk/java/awt/font/FontNames/FCCompositeTest.java line 65:

> 63:             BufferedReader br = new BufferedReader(new 
> InputStreamReader(is));
> 64:             String fileline = br.readLine();
> 65:             br.close();

Use try-with-resources


            String fileline;
            try (BufferedReader br = new BufferedReader(new 
InputStreamReader(p.getInputStream()))) {
                fileline = br.readLine();
            }

test/jdk/java/awt/font/FontNames/FCCompositeTest.java line 81:

> 79:                 }
> 80:             }
> 81:             br.close();

Using try-with-resources will ensure the stream is closed when the `return 
true` inside the loop is reached or when an exception is thrown.

test/jdk/java/awt/font/FontNames/FCCompositeTest.java line 105:

> 103:             if (usesVariableFont(fcnames[index])) {
> 104:                 return;
> 105:             }

Does it make sense to throw `jtreg.SkippedException` in this case? The test 
isn't run because the font file is a variable font.

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

PR Review: https://git.openjdk.org/jdk/pull/33900#pullrequestreview-5926865350
PR Review Comment: https://git.openjdk.org/jdk/pull/33900#discussion_r4590988971
PR Review Comment: https://git.openjdk.org/jdk/pull/33900#discussion_r4591008742
PR Review Comment: https://git.openjdk.org/jdk/pull/33900#discussion_r4591025435

Reply via email to