|
1 | 1 | /* |
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. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
26 | 26 | * @bug 4935798 6521210 6901159 |
27 | 27 | * @summary Tests that all family names that are reported in all locales |
28 | 28 | * correspond to some font returned from getAllFonts(). |
29 | | - * @run main LocaleFamilyNames |
| 29 | + * @run main/othervm/timeout=360 LocaleFamilyNames |
30 | 30 | */ |
31 | 31 | import java.awt.*; |
32 | 32 | import java.util.*; |
33 | 33 |
|
34 | 34 | public class LocaleFamilyNames { |
35 | 35 | public static void main(String[] args) throws Exception { |
| 36 | + System.out.println("Start time: " + java.time.LocalDateTime.now()); |
36 | 37 |
|
37 | 38 | GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
38 | | - |
39 | 39 | Font[] all_fonts = ge.getAllFonts(); |
40 | | - |
41 | 40 | Locale[] all_locales = Locale.getAvailableLocales(); |
42 | 41 |
|
| 42 | + System.out.println("Number of fonts: " + all_fonts.length); |
| 43 | + System.out.println("Number of locales: " + all_locales.length); |
| 44 | + |
43 | 45 | HashSet all_families = new HashSet(); |
44 | 46 | for (int i=0; i<all_fonts.length; i++) { |
45 | 47 | all_families.add(all_fonts[i].getFamily()); |
46 | 48 | for (int j=0; j<all_locales.length;j++) { |
47 | 49 | all_families.add(all_fonts[i].getFamily(all_locales[j])); |
48 | 50 | } |
49 | | - |
50 | 51 | } |
51 | 52 |
|
| 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()); |
52 | 55 |
|
53 | 56 | for (int i=0; i<all_locales.length; i++) { |
54 | 57 | String[] families_for_locale = |
|
0 commit comments