RFR: JDK-8278549: UNIX sun/font coding misses SUSE distro detection on recent distro SUSE 15

Martin Doerr mdoerr at openjdk.java.net
Mon Jan 10 16:40:29 UTC 2022


On Tue, 4 Jan 2022 14:14:46 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> Hello, please review this adjustment for recent SUSE Linux 15.
> The font coding on UNIX, see setOsNameAndVersion in files 
> 
> src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java
> src/java.desktop/unix/classes/sun/font/MFontConfiguration.java
> 
> uses the file /etc/SuSE-release to detect SUSE Linux. However on SUSE Linux 15 this file does not exist any more.
> Instead /etc/os-release can be used as a replacement on SLES12 and SLES15 :
> 
> Example content of /etc/os-release
> NAME="SLES"
> VERSION="12-SP2"
> VERSION_ID="12.2"
> PRETTY_NAME="SUSE Linux Enterprise Server 12 SP2"
> 
> There the name and version information is stored (NAME=... , VERSION_ID=...).
> 
> Additionally I noticed that there is some code duplication in FcFontConfiguration.java and MFontConfiguration.java , what do you think about moving this to some common place ?
> 
> Thanks, Matthias

Changes requested by mdoerr (Reviewer).

src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java line 298:

> 296:     }
> 297: 
> 298:     private String getOsinfo(String s) {

Maybe call it `extractOsInfo`?

src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java line 346:

> 344:                 }
> 345:                 osName = props.getProperty("NAME");
> 346:                 osVersion =  props.getProperty("VERSION_ID");

Extra whitespace.

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

PR: https://git.openjdk.java.net/jdk/pull/6956



More information about the client-libs-dev mailing list