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); }