File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
lang/System/LoggerFinder/internal/BootstrapLogger Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2014, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2014, 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
3939import java .security .ProtectionDomain ;
4040import java .util .concurrent .atomic .AtomicBoolean ;
4141import java .util .List ;
42+ import java .util .Locale ;
4243import java .util .Optional ;
4344import java .util .Set ;
4445import java .util .stream .Collectors ;
@@ -88,6 +89,8 @@ static enum TestCase {
8889 }
8990
9091 public static void main (String [] args ) throws Exception {
92+ Locale savedLocale = Locale .getDefault ();
93+ Locale .setDefault (Locale .US );
9194 if (args == null || args .length == 0 ) {
9295 args = new String [] { TestCase .SECURE_AND_WAIT .name () };
9396 }
@@ -373,6 +376,7 @@ public static void main(String[] args) throws Exception {
373376 LogStream .err .println ("Not checking executor termination for " + test );
374377 }
375378 } finally {
379+ Locale .setDefault (savedLocale );
376380 SimplePolicy .allowAll .set (Boolean .FALSE );
377381 }
378382 LogStream .err .println (test .name () + ": PASSED" );
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2013, 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
@@ -52,6 +52,7 @@ public class LocalizedLevelName {
5252 public static void main (String args []) throws Exception {
5353 Locale defaultLocale = Locale .getDefault ();
5454 for (int i =0 ; i <namesMap .length ; i += 4 ) {
55+ Locale .setDefault (Locale .US );
5556 final String key = (String ) namesMap [i ];
5657 final Locale locale = (Locale ) namesMap [i +1 ];
5758 final String expectedTranslation = (String ) namesMap [i +2 ];
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2011, 2016 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2011, 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
3030 */
3131
3232import java .io .*;
33+ import java .util .Locale ;
3334import java .util .logging .*;
3435import java .util .regex .*;
3536
@@ -38,6 +39,8 @@ public class SimpleFormatterFormat {
3839 private static final String origFormat = System .getProperty (key );
3940 private static final PrintStream err = System .err ;
4041 public static void main (String [] args ) throws Exception {
42+ Locale savedLocale = Locale .getDefault ();
43+ Locale .setDefault (Locale .US );
4144 try {
4245 File dir = new File (System .getProperty ("user.dir" , "." ));
4346 File log = new File (dir , "simpleformat.txt" );
@@ -53,7 +56,8 @@ public static void main(String[] args) throws Exception {
5356 System .setProperty (key , origFormat );
5457 }
5558 System .setErr (err );
56- }
59+ }
60+ Locale .setDefault (savedLocale );
5761 }
5862
5963 private static String [] loggers = new String [] {
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2010, 2016 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2010, 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
3333 * @run main/othervm SourceClassName
3434 */
3535
36+ import java .util .Locale ;
3637import java .util .logging .*;
3738import java .io .*;
3839import sun .util .logging .PlatformLogger ;
3940
4041public class SourceClassName {
4142 public static void main (String [] args ) throws Exception {
43+ Locale savedLocale = Locale .getDefault ();
44+ Locale .setDefault (Locale .US );
4245 File dir = new File (System .getProperty ("user.dir" , "." ));
4346 File log = new File (dir , "testlog.txt" );
4447 PrintStream logps = new PrintStream (log );
4548 writeLogRecords (logps );
4649 checkLogRecords (log );
50+ Locale .setDefault (savedLocale );
4751 }
4852
4953 private static void writeLogRecords (PrintStream logps ) throws Exception {
You can’t perform that action at this time.
0 commit comments