Skip to content

Commit 2691c14

Browse files
committed
8345368: java/io/File/createTempFile/SpecialTempFile.java fails on Windows Server 2025
Reviewed-by: mbaesken Backport-of: b0c131e872f997cb7deadc9b0a87bd76e3a2a83c
1 parent f63ee83 commit 2691c14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/jdk/java/io/File/createTempFile/SpecialTempFile.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@
3939

4040
import jdk.test.lib.Platform;
4141
import jdk.test.lib.OSVersion;
42+
import jdk.internal.util.StaticProperty;
4243

4344
public class SpecialTempFile {
4445
private static void test(String name, String[] prefix, String[] suffix,
@@ -111,7 +112,7 @@ public static void main(String[] args) throws Exception {
111112
String[] resvPre = { "LPT1.package.zip", "com7.4.package.zip" };
112113
String[] resvSuf = { ".temp", ".temp" };
113114
boolean exceptionExpected =
114-
!(System.getProperty("os.name").endsWith("11") ||
115+
!(System.getProperty("os.name").matches("^.*[11|2025]$") ||
115116
new OSVersion(10, 0).compareTo(OSVersion.current()) > 0);
116117
test("ReservedName", resvPre, resvSuf, exceptionExpected);
117118
}

0 commit comments

Comments
 (0)