RFR: 8336382: Fixes error reporting in loading AWT and fonts [v4]
Karm Michal Babacek
duke at openjdk.org
Sun Sep 29 21:07:49 UTC 2024
On Sat, 28 Sep 2024 23:10:53 GMT, Karm Michal Babacek <duke at openjdk.org> wrote:
> # Font.java and information leakage
>
> @prrace @jerboaa
>
> Would this solution address the concern? Instead of passing on the whole throwable, we just inspect it and if it is this particular one, we pass on the information to the user?
>
> ```
> +++ b/src/java.desktop/share/classes/java/awt/Font.java
> @@ -971,6 +971,9 @@ public static Font[] createFonts(InputStream fontStream)
> }
> return createFont0(fontFormat, fontStream, true, tracker);
> } catch (InterruptedException e) {
> + if (e.getCause().getMessage().contains("java.home property not set")) {
> + throw new IOException("Problem reading font data. java.home property not set.");
> + }
> throw new IOException("Problem reading font data.");
> ```
I retract this. It's not that inconvenient and I don't want to complicate this PR.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20169#issuecomment-2381602619
More information about the client-libs-dev
mailing list