Skip to content

Commit f1d867d

Browse files
committed
8364996: java/awt/font/FontNames/LocaleFamilyNames.java times out on Windows
Backport-of: 15e8609a2c3d246e89cfb349cbd21777bc471bae
1 parent 7fad923 commit f1d867d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/jdk/java/awt/font/FontNames/LocaleFamilyNames.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,29 +26,32 @@
2626
* @bug 4935798 6521210 6901159
2727
* @summary Tests that all family names that are reported in all locales
2828
* correspond to some font returned from getAllFonts().
29-
* @run main LocaleFamilyNames
29+
* @run main/othervm/timeout=360 LocaleFamilyNames
3030
*/
3131
import java.awt.*;
3232
import java.util.*;
3333

3434
public class LocaleFamilyNames {
3535
public static void main(String[] args) throws Exception {
36+
System.out.println("Start time: " + java.time.LocalDateTime.now());
3637

3738
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
38-
3939
Font[] all_fonts = ge.getAllFonts();
40-
4140
Locale[] all_locales = Locale.getAvailableLocales();
4241

42+
System.out.println("Number of fonts: " + all_fonts.length);
43+
System.out.println("Number of locales: " + all_locales.length);
44+
4345
HashSet all_families = new HashSet();
4446
for (int i=0; i<all_fonts.length; i++) {
4547
all_families.add(all_fonts[i].getFamily());
4648
for (int j=0; j<all_locales.length;j++) {
4749
all_families.add(all_fonts[i].getFamily(all_locales[j]));
4850
}
49-
5051
}
5152

53+
System.out.println("Number of font families: " + all_families.size());
54+
System.out.println("Time after preparing the font families HashSet: " + java.time.LocalDateTime.now());
5255

5356
for (int i=0; i<all_locales.length; i++) {
5457
String[] families_for_locale =

0 commit comments

Comments
 (0)