From cd6463a71a3bd7b60b90ec9641ab0f094bb2a53e Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 30 Jan 2025 13:36:24 +0100 Subject: [PATCH] Backport b0c131e872f997cb7deadc9b0a87bd76e3a2a83c --- test/jdk/java/io/File/createTempFile/SpecialTempFile.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/jdk/java/io/File/createTempFile/SpecialTempFile.java b/test/jdk/java/io/File/createTempFile/SpecialTempFile.java index 736e721d641..5cba3ff8796 100644 --- a/test/jdk/java/io/File/createTempFile/SpecialTempFile.java +++ b/test/jdk/java/io/File/createTempFile/SpecialTempFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ import jdk.test.lib.Platform; import jdk.test.lib.OSVersion; +import jdk.internal.util.StaticProperty; public class SpecialTempFile { private static void test(String name, String[] prefix, String[] suffix, @@ -111,7 +112,7 @@ public static void main(String[] args) throws Exception { String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" }; String[] resvSuf = { ".temp", ".temp" }; boolean exceptionExpected = - !(System.getProperty("os.name").endsWith("11") || + !(System.getProperty("os.name").matches("^.*[11|2025]$") || new OSVersion(10, 0).compareTo(OSVersion.current()) > 0); test("ReservedName", resvPre, resvSuf, exceptionExpected); }