From 5e685f6f2c7872a4239ef0c0a0afa60f4526529e Mon Sep 17 00:00:00 2001 From: Anjian Wen Date: Sun, 28 Dec 2025 09:13:09 +0000 Subject: [PATCH 01/56] 8374351: RISC-V: Small refactoring for crypto macro-assembler routines Reviewed-by: fyang, fjiang --- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 100 ++++++++++-------- 1 file changed, 55 insertions(+), 45 deletions(-) diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 75669d0e89c..127ac9f6951 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -2436,7 +2436,7 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_unsafe_setmemory = generate_unsafe_setmemory(); } - void generate_aes_loadkeys(const Register &key, VectorRegister *working_vregs, int rounds) { + void aes_load_keys(const Register &key, VectorRegister *working_vregs, int rounds) { const int step = 16; for (int i = 0; i < rounds; i++) { __ vle32_v(working_vregs[i], key); @@ -2448,7 +2448,7 @@ class StubGenerator: public StubCodeGenerator { } } - void generate_aes_encrypt(const VectorRegister &res, VectorRegister *working_vregs, int rounds) { + void aes_encrypt(const VectorRegister &res, VectorRegister *working_vregs, int rounds) { assert(rounds <= 15, "rounds should be less than or equal to working_vregs size"); __ vxor_vv(res, res, working_vregs[0]); @@ -2499,8 +2499,8 @@ class StubGenerator: public StubCodeGenerator { // Else we fallthrough to the biggest case (256-bit key size) // Note: the following function performs key += 15*16 - generate_aes_loadkeys(key, working_vregs, 15); - generate_aes_encrypt(res, working_vregs, 15); + aes_load_keys(key, working_vregs, 15); + aes_encrypt(res, working_vregs, 15); __ vse32_v(res, to); __ mv(c_rarg0, 0); __ leave(); @@ -2508,8 +2508,8 @@ class StubGenerator: public StubCodeGenerator { __ bind(L_aes192); // Note: the following function performs key += 13*16 - generate_aes_loadkeys(key, working_vregs, 13); - generate_aes_encrypt(res, working_vregs, 13); + aes_load_keys(key, working_vregs, 13); + aes_encrypt(res, working_vregs, 13); __ vse32_v(res, to); __ mv(c_rarg0, 0); __ leave(); @@ -2517,8 +2517,8 @@ class StubGenerator: public StubCodeGenerator { __ bind(L_aes128); // Note: the following function performs key += 11*16 - generate_aes_loadkeys(key, working_vregs, 11); - generate_aes_encrypt(res, working_vregs, 11); + aes_load_keys(key, working_vregs, 11); + aes_encrypt(res, working_vregs, 11); __ vse32_v(res, to); __ mv(c_rarg0, 0); __ leave(); @@ -2527,7 +2527,7 @@ class StubGenerator: public StubCodeGenerator { return start; } - void generate_aes_decrypt(const VectorRegister &res, VectorRegister *working_vregs, int rounds) { + void aes_decrypt(const VectorRegister &res, VectorRegister *working_vregs, int rounds) { assert(rounds <= 15, "rounds should be less than or equal to working_vregs size"); __ vxor_vv(res, res, working_vregs[rounds - 1]); @@ -2578,8 +2578,8 @@ class StubGenerator: public StubCodeGenerator { // Else we fallthrough to the biggest case (256-bit key size) // Note: the following function performs key += 15*16 - generate_aes_loadkeys(key, working_vregs, 15); - generate_aes_decrypt(res, working_vregs, 15); + aes_load_keys(key, working_vregs, 15); + aes_decrypt(res, working_vregs, 15); __ vse32_v(res, to); __ mv(c_rarg0, 0); __ leave(); @@ -2587,8 +2587,8 @@ class StubGenerator: public StubCodeGenerator { __ bind(L_aes192); // Note: the following function performs key += 13*16 - generate_aes_loadkeys(key, working_vregs, 13); - generate_aes_decrypt(res, working_vregs, 13); + aes_load_keys(key, working_vregs, 13); + aes_decrypt(res, working_vregs, 13); __ vse32_v(res, to); __ mv(c_rarg0, 0); __ leave(); @@ -2596,8 +2596,8 @@ class StubGenerator: public StubCodeGenerator { __ bind(L_aes128); // Note: the following function performs key += 11*16 - generate_aes_loadkeys(key, working_vregs, 11); - generate_aes_decrypt(res, working_vregs, 11); + aes_load_keys(key, working_vregs, 11); + aes_decrypt(res, working_vregs, 11); __ vse32_v(res, to); __ mv(c_rarg0, 0); __ leave(); @@ -2622,14 +2622,14 @@ class StubGenerator: public StubCodeGenerator { __ vsetivli(x0, 4, Assembler::e32, Assembler::m1); __ vle32_v(v16, rvec); - generate_aes_loadkeys(key, working_vregs, round); + aes_load_keys(key, working_vregs, round); Label L_enc_loop; __ bind(L_enc_loop); // Encrypt from source by block size __ vle32_v(v17, from); __ addi(from, from, BLOCK_SIZE); __ vxor_vv(v16, v16, v17); - generate_aes_encrypt(v16, working_vregs, round); + aes_encrypt(v16, working_vregs, round); __ vse32_v(v16, to); __ addi(to, to, BLOCK_SIZE); __ subi(len, len, BLOCK_SIZE); @@ -2709,14 +2709,14 @@ class StubGenerator: public StubCodeGenerator { __ vsetivli(x0, 4, Assembler::e32, Assembler::m1); __ vle32_v(v16, rvec); - generate_aes_loadkeys(key, working_vregs, round); + aes_load_keys(key, working_vregs, round); Label L_dec_loop; // Decrypt from source by block size __ bind(L_dec_loop); __ vle32_v(v17, from); __ addi(from, from, BLOCK_SIZE); __ vmv_v_v(v18, v17); - generate_aes_decrypt(v17, working_vregs, round); + aes_decrypt(v17, working_vregs, round); __ vxor_vv(v17, v17, v16); __ vse32_v(v17, to); __ vmv_v_v(v16, v18); @@ -2811,7 +2811,7 @@ class StubGenerator: public StubCodeGenerator { Register input_len, Register saved_encrypted_ctr, Register used_ptr) { // Algorithm: // - // generate_aes_loadkeys(); + // aes_load_keys(); // load_counter_128(counter_hi, counter_lo, counter); // // L_next: @@ -2825,7 +2825,7 @@ class StubGenerator: public StubCodeGenerator { // // L_main_loop: // if (len == 0) goto L_exit; - // saved_encrypted_ctr = generate_aes_encrypt(counter); + // saved_encrypted_ctr = aes_encrypt(counter); // // add_counter_128(counter_hi, counter_lo); // be_store_counter_128(counter_hi, counter_lo, counter); @@ -2869,7 +2869,7 @@ class StubGenerator: public StubCodeGenerator { __ mv(block_size, BLOCK_SIZE); // load keys to working_vregs according to round - generate_aes_loadkeys(key, working_vregs, round); + aes_load_keys(key, working_vregs, round); // 128-bit big-endian load be_load_counter_128(counter_hi, counter_lo, counter); @@ -2902,7 +2902,7 @@ class StubGenerator: public StubCodeGenerator { __ vle32_v(v16, counter); // encrypt counter according to round - generate_aes_encrypt(v16, working_vregs, round); + aes_encrypt(v16, working_vregs, round); __ vse32_v(v16, saved_encrypted_ctr); @@ -2997,6 +2997,34 @@ class StubGenerator: public StubCodeGenerator { return start; } + void ghash_loop(Register state, Register subkeyH, Register data, Register blocks, + VectorRegister vtmp1, VectorRegister vtmp2, VectorRegister vtmp3) { + VectorRegister partial_hash = vtmp1; + VectorRegister hash_subkey = vtmp2; + VectorRegister cipher_text = vtmp3; + + const unsigned int BLOCK_SIZE = 16; + + __ vsetivli(x0, 2, Assembler::e64, Assembler::m1); + __ vle64_v(hash_subkey, subkeyH); + __ vrev8_v(hash_subkey, hash_subkey); + __ vle64_v(partial_hash, state); + __ vrev8_v(partial_hash, partial_hash); + + __ vsetivli(x0, 4, Assembler::e32, Assembler::m1); + Label L_ghash_loop; + __ bind(L_ghash_loop); + __ vle32_v(cipher_text, data); + __ addi(data, data, BLOCK_SIZE); + __ vghsh_vv(partial_hash, hash_subkey, cipher_text); + __ subi(blocks, blocks, 1); + __ bnez(blocks, L_ghash_loop); + + __ vsetivli(x0, 2, Assembler::e64, Assembler::m1); + __ vrev8_v(partial_hash, partial_hash); + __ vse64_v(partial_hash, state); + } + /** * Arguments: * @@ -3024,30 +3052,12 @@ class StubGenerator: public StubCodeGenerator { Register data = c_rarg2; Register blocks = c_rarg3; - VectorRegister partial_hash = v1; - VectorRegister hash_subkey = v2; - VectorRegister cipher_text = v3; + VectorRegister vtmp1 = v1; + VectorRegister vtmp2 = v2; + VectorRegister vtmp3 = v3; - const unsigned int BLOCK_SIZE = 16; + ghash_loop(state, subkeyH, data, blocks, vtmp1, vtmp2, vtmp3); - __ vsetivli(x0, 2, Assembler::e64, Assembler::m1); - __ vle64_v(hash_subkey, subkeyH); - __ vrev8_v(hash_subkey, hash_subkey); - __ vle64_v(partial_hash, state); - __ vrev8_v(partial_hash, partial_hash); - - __ vsetivli(x0, 4, Assembler::e32, Assembler::m1); - Label L_ghash_loop; - __ bind(L_ghash_loop); - __ vle32_v(cipher_text, data); - __ addi(data, data, BLOCK_SIZE); - __ vghsh_vv(partial_hash, hash_subkey, cipher_text); - __ subi(blocks, blocks, 1); - __ bnez(blocks, L_ghash_loop); - - __ vsetivli(x0, 2, Assembler::e64, Assembler::m1); - __ vrev8_v(partial_hash, partial_hash); - __ vse64_v(partial_hash, state); __ leave(); __ ret(); From 078e71f4a3d68d298ab3c383e46d18912e1de7db Mon Sep 17 00:00:00 2001 From: Kirill Shirokov Date: Mon, 29 Dec 2025 21:09:41 +0000 Subject: [PATCH 02/56] 8344345: test/hotspot/gtest/x86/x86-asmtest.py has trailing whitespaces Reviewed-by: phh, lmesnik --- test/hotspot/gtest/x86/x86-asmtest.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/hotspot/gtest/x86/x86-asmtest.py b/test/hotspot/gtest/x86/x86-asmtest.py index 714b7aaea40..6544e30579f 100644 --- a/test/hotspot/gtest/x86/x86-asmtest.py +++ b/test/hotspot/gtest/x86/x86-asmtest.py @@ -172,10 +172,10 @@ class NFInstruction(Instruction): def __init__(self, name, aname, no_flag): super().__init__(name, aname) self.no_flag = no_flag - + def cstr(self): return f'__ {self._name}(' + ', '.join([op.cstr() for op in self.operands]) + (f', {str(self.no_flag).lower()}' if self.no_flag is not None else '') + ');' - + def astr(self): # JDK assembler uses 'cl' for shift instructions with one operand by default cl_str = (', cl' if self._name in shift_rot_ops and len(self.operands) == 2 else '') @@ -305,10 +305,10 @@ class CondRegRegRegInstruction(Instruction): self.cond = cond self.generate_operands(self.reg1, self.reg2, self.reg3) self.demote = True - + def cstr(self): return f'__ {self._name} (' + 'Assembler::Condition::' + self.cond + ', ' + ', '.join([reg.cstr() for reg in self.operands]) + ');' - + def astr(self): operands = self.operands if self.demote: @@ -326,10 +326,10 @@ class CondRegRegMemInstruction(Instruction): self.cond = cond self.generate_operands(self.reg1, self.reg2, self.mem) self.demote = True - + def cstr(self): return f'__ {self._name} (' + 'Assembler::Condition::' + self.cond + ', ' + ', '.join([reg.cstr() for reg in self.operands]) + ');' - + def astr(self): operands = self.operands if self.demote: From 92c6799b401eb786949e88cd7142002b2a875ce0 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Mon, 29 Dec 2025 21:20:59 +0000 Subject: [PATCH 03/56] 8374361: Update copyright year to 2025 for jdk.hotspot.agent in files where it was missed Reviewed-by: phh --- .../linux/native/libsaproc/LinuxDebuggerLocal.cpp | 2 +- src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java | 2 +- .../share/classes/sun/jvm/hotspot/HotSpotAgent.java | 2 +- .../share/classes/sun/jvm/hotspot/debugger/Debugger.java | 2 +- .../sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java | 2 +- .../jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java | 2 +- .../sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java | 2 +- .../classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java | 2 +- .../sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java | 2 +- .../classes/sun/jvm/hotspot/runtime/StackValueCollection.java | 2 +- .../sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java | 2 +- .../classes/sun/jvm/hotspot/runtime/amd64/AMD64RegisterMap.java | 2 +- .../hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java | 2 +- .../runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java | 2 +- .../runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java | 2 +- .../share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java | 2 +- .../share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java | 2 +- src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp b/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp index 4b8c5e55f63..caf948019af 100644 --- a/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, 2021, NTT DATA. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java index 897ea5da85f..e1715b5e024 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java index 4ffd0434e86..cb708f9b284 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Azul Systems, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java index 81e620ff1fb..a6ef3b72544 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java index c4a3a4850ff..3dbcd8b8112 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java index 88863e76285..d20b998aa64 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java index 3833680d96c..851dc5ad09c 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java index 6fbea538488..46edb2f55b2 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java index b45dbd23405..9ed05b31319 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java index a2808bfff31..f6d33d3c7e8 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java index e85973773dc..030d502075d 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64RegisterMap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64RegisterMap.java index b1ae1e8a001..dd8834f3d38 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64RegisterMap.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64RegisterMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java index a2cdac72add..483c3e5dfde 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java index f8672066189..5eb39ed66a8 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java index a573b9a383a..9e47bf57602 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java index 76b8595e3b2..05044ec8afc 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java index 53fa5204349..2ca720dd573 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp b/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp index 74be5db0d79..f2994c0d827 100644 --- a/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp +++ b/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 From 08450f2c4d447c42a2ca8222d162ae3d2d25268a Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 30 Dec 2025 07:01:49 +0000 Subject: [PATCH 04/56] 8374326: Update copyright year to 2025 for jdk.jpackage in files where it was missed Reviewed-by: phh --- .../linux/native/libapplauncher/LinuxLauncherLib.cpp | 2 +- .../classes/jdk/jpackage/internal/MacPkgInstallerScripts.java | 2 +- .../jdk/jpackage/internal/resources/ResourceLocator.java | 2 +- src/jdk.jpackage/share/native/applauncher/PackageFile.cpp | 2 +- src/jdk.jpackage/share/native/common/Dll.h | 2 +- src/jdk.jpackage/share/native/common/app.cpp | 2 +- src/jdk.jpackage/share/native/common/tstrings.cpp | 2 +- .../classes/jdk/jpackage/internal/WixLauncherAsService.java | 2 +- src/jdk.jpackage/windows/native/common/MsiUtils.h | 2 +- src/jdk.jpackage/windows/native/libjpackage/VersionInfo.cpp | 2 +- src/jdk.jpackage/windows/native/libmsica/Version.cpp | 2 +- src/jdk.jpackage/windows/native/libmsica/Version.h | 2 +- src/jdk.jpackage/windows/native/libmsica/libmsica.cpp | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/jdk.jpackage/linux/native/libapplauncher/LinuxLauncherLib.cpp b/src/jdk.jpackage/linux/native/libapplauncher/LinuxLauncherLib.cpp index 7d7c8b7213d..561e2a942bb 100644 --- a/src/jdk.jpackage/linux/native/libapplauncher/LinuxLauncherLib.cpp +++ b/src/jdk.jpackage/linux/native/libapplauncher/LinuxLauncherLib.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgInstallerScripts.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgInstallerScripts.java index ecd3d19ac17..d0313af1efa 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgInstallerScripts.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgInstallerScripts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java index 93d317b0128..cb03a1fee8a 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.jpackage/share/native/applauncher/PackageFile.cpp b/src/jdk.jpackage/share/native/applauncher/PackageFile.cpp index 31b431215d5..4bf51348d6d 100644 --- a/src/jdk.jpackage/share/native/applauncher/PackageFile.cpp +++ b/src/jdk.jpackage/share/native/applauncher/PackageFile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/jdk.jpackage/share/native/common/Dll.h b/src/jdk.jpackage/share/native/common/Dll.h index c84242373a7..bfe9e25238e 100644 --- a/src/jdk.jpackage/share/native/common/Dll.h +++ b/src/jdk.jpackage/share/native/common/Dll.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/jdk.jpackage/share/native/common/app.cpp b/src/jdk.jpackage/share/native/common/app.cpp index d9492785f06..a64e84b70fb 100644 --- a/src/jdk.jpackage/share/native/common/app.cpp +++ b/src/jdk.jpackage/share/native/common/app.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/jdk.jpackage/share/native/common/tstrings.cpp b/src/jdk.jpackage/share/native/common/tstrings.cpp index b38c811e8bd..7ceb87edfa1 100644 --- a/src/jdk.jpackage/share/native/common/tstrings.cpp +++ b/src/jdk.jpackage/share/native/common/tstrings.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixLauncherAsService.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixLauncherAsService.java index 833219eaa10..0755a920fd2 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixLauncherAsService.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixLauncherAsService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/jdk.jpackage/windows/native/common/MsiUtils.h b/src/jdk.jpackage/windows/native/common/MsiUtils.h index 26fa9f91045..d501174268d 100644 --- a/src/jdk.jpackage/windows/native/common/MsiUtils.h +++ b/src/jdk.jpackage/windows/native/common/MsiUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/jdk.jpackage/windows/native/libjpackage/VersionInfo.cpp b/src/jdk.jpackage/windows/native/libjpackage/VersionInfo.cpp index 122757b3ac3..aa977be8a82 100644 --- a/src/jdk.jpackage/windows/native/libjpackage/VersionInfo.cpp +++ b/src/jdk.jpackage/windows/native/libjpackage/VersionInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/jdk.jpackage/windows/native/libmsica/Version.cpp b/src/jdk.jpackage/windows/native/libmsica/Version.cpp index 293f2dd36be..f8c570a1349 100644 --- a/src/jdk.jpackage/windows/native/libmsica/Version.cpp +++ b/src/jdk.jpackage/windows/native/libmsica/Version.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/jdk.jpackage/windows/native/libmsica/Version.h b/src/jdk.jpackage/windows/native/libmsica/Version.h index 4ef176d382f..6f91a36765e 100644 --- a/src/jdk.jpackage/windows/native/libmsica/Version.h +++ b/src/jdk.jpackage/windows/native/libmsica/Version.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/jdk.jpackage/windows/native/libmsica/libmsica.cpp b/src/jdk.jpackage/windows/native/libmsica/libmsica.cpp index edfea6dc136..f338c8ab103 100644 --- a/src/jdk.jpackage/windows/native/libmsica/libmsica.cpp +++ b/src/jdk.jpackage/windows/native/libmsica/libmsica.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 From e4e923a1ffc8ff059c983c7e9201d0ee3273482d Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 30 Dec 2025 09:49:05 +0000 Subject: [PATCH 05/56] 8374195: TestReplaceNarrowPhiWithBottomPhi fails on ppc64 platforms in (fast)debug Reviewed-by: mbaesken, jbechberger --- .../jtreg/compiler/c2/TestReplaceNarrowPhiWithBottomPhi.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/compiler/c2/TestReplaceNarrowPhiWithBottomPhi.java b/test/hotspot/jtreg/compiler/c2/TestReplaceNarrowPhiWithBottomPhi.java index 22b9b52d593..f01698c300f 100644 --- a/test/hotspot/jtreg/compiler/c2/TestReplaceNarrowPhiWithBottomPhi.java +++ b/test/hotspot/jtreg/compiler/c2/TestReplaceNarrowPhiWithBottomPhi.java @@ -23,7 +23,8 @@ /** * @test - * @bug 8370200 + * @bug 8370200 8374195 + * @requires (os.arch != "ppc64") & (os.arch != "ppc64le") * @library /test/lib / * @run driver ${test.main.class} */ From a6462d641cba004829f9136df22f3d953c0e0c5d Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 30 Dec 2025 12:08:36 +0000 Subject: [PATCH 06/56] 8374316: Update copyright year to 2025 for hotspot in files where it was missed Reviewed-by: kbarrett --- src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp | 2 +- src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp | 2 +- src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp | 2 +- .../cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp | 2 +- .../aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.hpp | 2 +- src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp | 2 +- src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad | 2 +- src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp | 2 +- src/hotspot/cpu/aarch64/methodHandles_aarch64.hpp | 2 +- src/hotspot/cpu/aarch64/register_aarch64.hpp | 2 +- src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp | 2 +- .../cpu/aarch64/stackChunkFrameStream_aarch64.inline.hpp | 2 +- src/hotspot/cpu/arm/assembler_arm_32.hpp | 2 +- src/hotspot/cpu/arm/c1_Defs_arm.hpp | 2 +- src/hotspot/cpu/arm/c1_LIRAssembler_arm.hpp | 2 +- src/hotspot/cpu/arm/continuationFreezeThaw_arm.inline.hpp | 2 +- .../cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.hpp | 2 +- src/hotspot/cpu/arm/interp_masm_arm.hpp | 2 +- src/hotspot/cpu/arm/matcher_arm.hpp | 2 +- src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp | 2 +- src/hotspot/cpu/arm/stackChunkFrameStream_arm.inline.hpp | 2 +- src/hotspot/cpu/arm/stubRoutines_arm.hpp | 2 +- src/hotspot/cpu/arm/vmreg_arm.hpp | 2 +- src/hotspot/cpu/arm/vmreg_arm.inline.hpp | 2 +- src/hotspot/cpu/ppc/c1_Defs_ppc.hpp | 2 +- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.hpp | 2 +- src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp | 2 +- src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp | 2 +- src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp | 2 +- .../cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.hpp | 2 +- src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp | 2 +- src/hotspot/cpu/ppc/stackChunkFrameStream_ppc.inline.hpp | 2 +- src/hotspot/cpu/riscv/assembler_riscv.inline.hpp | 2 +- src/hotspot/cpu/riscv/c1_Defs_riscv.hpp | 2 +- src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp | 2 +- src/hotspot/cpu/riscv/codeBuffer_riscv.hpp | 2 +- src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp | 2 +- src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp | 2 +- src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp | 2 +- .../cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.hpp | 2 +- src/hotspot/cpu/riscv/gc/z/z_riscv.ad | 2 +- src/hotspot/cpu/riscv/interp_masm_riscv.hpp | 2 +- src/hotspot/cpu/riscv/javaFrameAnchor_riscv.hpp | 2 +- src/hotspot/cpu/riscv/matcher_riscv.hpp | 2 +- src/hotspot/cpu/riscv/methodHandles_riscv.hpp | 2 +- src/hotspot/cpu/riscv/riscv_b.ad | 2 +- src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp | 2 +- src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp | 2 +- src/hotspot/cpu/riscv/stubRoutines_riscv.hpp | 2 +- src/hotspot/cpu/s390/assembler_s390.inline.hpp | 2 +- src/hotspot/cpu/s390/c1_Defs_s390.hpp | 2 +- src/hotspot/cpu/s390/c1_FrameMap_s390.hpp | 2 +- src/hotspot/cpu/s390/continuationFreezeThaw_s390.inline.hpp | 2 +- src/hotspot/cpu/s390/disassembler_s390.cpp | 2 +- src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp | 2 +- .../cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.hpp | 2 +- src/hotspot/cpu/s390/interp_masm_s390.hpp | 2 +- src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp | 2 +- src/hotspot/cpu/s390/matcher_s390.hpp | 2 +- src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp | 2 +- src/hotspot/cpu/s390/stackChunkFrameStream_s390.inline.hpp | 2 +- src/hotspot/cpu/s390/stubRoutines_s390.hpp | 2 +- src/hotspot/cpu/x86/assembler_x86.inline.hpp | 2 +- src/hotspot/cpu/x86/c1_Defs_x86.hpp | 2 +- src/hotspot/cpu/x86/c1_FrameMap_x86.hpp | 2 +- src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp | 2 +- src/hotspot/cpu/x86/c1_LinearScan_x86.hpp | 2 +- src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp | 2 +- src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp | 2 +- .../cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp | 2 +- src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp | 2 +- src/hotspot/cpu/x86/gc/z/z_x86_64.ad | 2 +- src/hotspot/cpu/x86/icache_x86.hpp | 2 +- src/hotspot/cpu/x86/interpreterRT_x86.hpp | 2 +- src/hotspot/cpu/x86/matcher_x86.hpp | 2 +- src/hotspot/cpu/x86/methodHandles_x86.hpp | 2 +- src/hotspot/cpu/x86/nativeInst_x86.hpp | 2 +- src/hotspot/cpu/x86/peephole_x86_64.hpp | 2 +- src/hotspot/cpu/x86/rdtsc_x86.hpp | 2 +- src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp | 2 +- src/hotspot/cpu/x86/stackChunkFrameStream_x86.inline.hpp | 2 +- src/hotspot/cpu/x86/stubRoutines_x86.hpp | 2 +- src/hotspot/cpu/zero/assembler_zero.inline.hpp | 2 +- src/hotspot/cpu/zero/continuationFreezeThaw_zero.inline.hpp | 2 +- src/hotspot/cpu/zero/icache_zero.hpp | 2 +- src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp | 2 +- src/hotspot/cpu/zero/stackChunkFrameStream_zero.inline.hpp | 2 +- src/hotspot/cpu/zero/stubRoutines_zero.hpp | 2 +- src/hotspot/os/aix/libodm_aix.cpp | 2 +- src/hotspot/os/aix/libperfstat_aix.hpp | 2 +- src/hotspot/os/aix/osThread_aix.hpp | 2 +- src/hotspot/os/aix/os_aix.hpp | 2 +- src/hotspot/os/linux/gc/z/zSyscall_linux.hpp | 2 +- src/hotspot/os/linux/os_linux.hpp | 2 +- src/hotspot/os/linux/os_linux.inline.hpp | 2 +- src/hotspot/os/linux/procMapsParser.hpp | 2 +- src/hotspot/os/posix/include/jvm_md.h | 2 +- src/hotspot/os/posix/signals_posix.hpp | 2 +- src/hotspot/os/posix/threadLocalStorage_posix.cpp | 2 +- src/hotspot/os/windows/gc/z/zSyscall_windows.hpp | 2 +- src/hotspot/os/windows/os_windows.hpp | 2 +- src/hotspot/os/windows/safefetch_windows.hpp | 2 +- src/hotspot/os_cpu/bsd_aarch64/icache_bsd_aarch64.hpp | 2 +- src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S | 2 +- src/hotspot/os_cpu/linux_aarch64/copy_linux_aarch64.S | 2 +- src/hotspot/os_cpu/linux_aarch64/icache_linux_aarch64.hpp | 2 +- src/hotspot/os_cpu/linux_aarch64/safefetch_linux_aarch64.S | 2 +- src/hotspot/os_cpu/linux_aarch64/threadLS_linux_aarch64.S | 2 +- src/hotspot/os_cpu/linux_ppc/gc/z/zSyscall_linux_ppc.hpp | 2 +- src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp | 2 +- src/hotspot/os_cpu/windows_aarch64/icache_windows_aarch64.hpp | 2 +- src/hotspot/share/adlc/adlc.hpp | 2 +- src/hotspot/share/adlc/adlparse.hpp | 2 +- src/hotspot/share/asm/assembler.hpp | 2 +- src/hotspot/share/c1/c1_Canonicalizer.hpp | 2 +- src/hotspot/share/c1/c1_Defs.hpp | 2 +- src/hotspot/share/c1/c1_GraphBuilder.hpp | 2 +- src/hotspot/share/c1/c1_Instruction.hpp | 2 +- src/hotspot/share/c1/c1_InstructionPrinter.hpp | 2 +- src/hotspot/share/c1/c1_LinearScan.hpp | 2 +- src/hotspot/share/c1/c1_Optimizer.hpp | 2 +- src/hotspot/share/c1/c1_RangeCheckElimination.hpp | 2 +- src/hotspot/share/cds/aotClassLinker.hpp | 2 +- src/hotspot/share/cds/aotMappedHeapLoader.inline.hpp | 2 +- src/hotspot/share/cds/aotStreamedHeapLoader.hpp | 2 +- src/hotspot/share/cds/aotThread.cpp | 2 +- src/hotspot/share/cds/lambdaFormInvokers.inline.hpp | 2 +- src/hotspot/share/ci/bcEscapeAnalyzer.hpp | 2 +- src/hotspot/share/ci/ciEnv.hpp | 2 +- src/hotspot/share/ci/ciInstance.hpp | 2 +- src/hotspot/share/ci/ciMetadata.hpp | 2 +- src/hotspot/share/ci/ciTypeFlow.hpp | 2 +- src/hotspot/share/ci/ciUtilities.inline.hpp | 2 +- src/hotspot/share/classfile/bytecodeAssembler.hpp | 2 +- src/hotspot/share/classfile/classLoaderDataGraph.hpp | 2 +- src/hotspot/share/classfile/classLoaderStats.hpp | 2 +- src/hotspot/share/classfile/defaultMethods.hpp | 2 +- src/hotspot/share/classfile/javaClassesImpl.hpp | 2 +- src/hotspot/share/classfile/vmClasses.hpp | 2 +- src/hotspot/share/code/codeBehaviours.hpp | 2 +- src/hotspot/share/code/codeCache.hpp | 2 +- src/hotspot/share/code/compiledIC.hpp | 2 +- src/hotspot/share/code/dependencyContext.hpp | 2 +- src/hotspot/share/compiler/abstractCompiler.hpp | 2 +- src/hotspot/share/compiler/compileLog.hpp | 2 +- src/hotspot/share/compiler/compiler_globals.hpp | 2 +- src/hotspot/share/compiler/directivesParser.hpp | 2 +- src/hotspot/share/compiler/disassembler.hpp | 2 +- src/hotspot/share/compiler/methodMatcher.hpp | 2 +- src/hotspot/share/compiler/oopMap.hpp | 2 +- src/hotspot/share/compiler/oopMap.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1AllocRegion.hpp | 2 +- src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1Allocator.hpp | 2 +- src/hotspot/share/gc/g1/g1Allocator.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1AnalyticsSequences.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1CardSet.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1CollectionSet.hpp | 2 +- src/hotspot/share/gc/g1/g1CollectionSet.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1CollectionSetCandidates.hpp | 2 +- src/hotspot/share/gc/g1/g1CollectionSetCandidates.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp | 2 +- .../share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1EdenRegions.hpp | 2 +- src/hotspot/share/gc/g1/g1EvacStats.hpp | 2 +- src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.hpp | 2 +- src/hotspot/share/gc/g1/g1FullGCScope.hpp | 2 +- src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp | 2 +- src/hotspot/share/gc/g1/g1IHOPControl.hpp | 2 +- src/hotspot/share/gc/g1/g1MonitoringSupport.hpp | 2 +- src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp | 2 +- src/hotspot/share/gc/g1/g1ParallelCleaning.hpp | 2 +- src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp | 2 +- src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp | 2 +- src/hotspot/share/gc/g1/g1RegionsOnNodes.hpp | 2 +- src/hotspot/share/gc/g1/g1RootProcessor.hpp | 2 +- src/hotspot/share/gc/g1/g1ServiceThread.hpp | 2 +- src/hotspot/share/gc/g1/g1SurvivorRegions.hpp | 2 +- src/hotspot/share/gc/g1/g1Trace.hpp | 2 +- src/hotspot/share/gc/g1/g1VMOperations.hpp | 2 +- src/hotspot/share/gc/parallel/objectStartArray.hpp | 2 +- src/hotspot/share/gc/parallel/parallel_globals.hpp | 2 +- src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.hpp | 2 +- src/hotspot/share/gc/parallel/psCompactionManager.hpp | 2 +- src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp | 2 +- src/hotspot/share/gc/parallel/psMemoryPool.hpp | 2 +- src/hotspot/share/gc/parallel/psOldGen.hpp | 2 +- src/hotspot/share/gc/parallel/psPromotionLAB.hpp | 2 +- src/hotspot/share/gc/parallel/psPromotionManager.hpp | 2 +- src/hotspot/share/gc/parallel/psScavenge.hpp | 2 +- src/hotspot/share/gc/parallel/psVMOperations.hpp | 2 +- src/hotspot/share/gc/parallel/psVirtualspace.hpp | 2 +- src/hotspot/share/gc/parallel/psYoungGen.hpp | 2 +- src/hotspot/share/gc/parallel/spaceCounters.hpp | 2 +- src/hotspot/share/gc/parallel/vmStructs_parallelgc.hpp | 2 +- src/hotspot/share/gc/serial/cSpaceCounters.hpp | 2 +- src/hotspot/share/gc/serial/defNewGeneration.hpp | 2 +- src/hotspot/share/gc/serial/serialVMOperations.hpp | 2 +- src/hotspot/share/gc/serial/tenuredGeneration.hpp | 2 +- src/hotspot/share/gc/serial/tenuredGeneration.inline.hpp | 2 +- src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp | 2 +- src/hotspot/share/gc/shared/barrierSet.hpp | 2 +- src/hotspot/share/gc/shared/barrierSetConfig.hpp | 2 +- src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp | 2 +- src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.hpp | 2 +- src/hotspot/share/gc/shared/cardTableBarrierSet.hpp | 2 +- src/hotspot/share/gc/shared/collectedHeap.inline.hpp | 2 +- src/hotspot/share/gc/shared/collectorCounters.hpp | 2 +- src/hotspot/share/gc/shared/gcArguments.hpp | 2 +- src/hotspot/share/gc/shared/gcCause.hpp | 2 +- src/hotspot/share/gc/shared/gcHeapSummary.hpp | 2 +- src/hotspot/share/gc/shared/gcLocker.hpp | 2 +- src/hotspot/share/gc/shared/gcLogPrecious.hpp | 2 +- src/hotspot/share/gc/shared/gcPolicyCounters.hpp | 2 +- src/hotspot/share/gc/shared/gcThreadLocalData.hpp | 2 +- src/hotspot/share/gc/shared/gcTrace.hpp | 2 +- src/hotspot/share/gc/shared/gcVMOperations.hpp | 2 +- src/hotspot/share/gc/shared/genArguments.hpp | 2 +- src/hotspot/share/gc/shared/hSpaceCounters.hpp | 2 +- src/hotspot/share/gc/shared/oopStorage.hpp | 2 +- src/hotspot/share/gc/shared/parallelCleaning.hpp | 2 +- src/hotspot/share/gc/shared/partialArraySplitter.hpp | 2 +- src/hotspot/share/gc/shared/referenceProcessor.hpp | 2 +- src/hotspot/share/gc/shared/scavengableNMethods.hpp | 2 +- src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp | 2 +- src/hotspot/share/gc/shared/stringdedup/stringDedupStat.hpp | 2 +- src/hotspot/share/gc/shared/stringdedup/stringDedupThread.hpp | 2 +- src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp | 2 +- src/hotspot/share/gc/shared/vmStructs_gc.hpp | 2 +- .../share/gc/shenandoah/shenandoahReferenceProcessor.hpp | 2 +- src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp | 2 +- src/hotspot/share/gc/z/zArguments.hpp | 2 +- src/hotspot/share/gc/z/zBarrier.hpp | 2 +- src/hotspot/share/gc/z/zBarrierSet.hpp | 2 +- src/hotspot/share/gc/z/zBarrierSetNMethod.hpp | 2 +- src/hotspot/share/gc/z/zGeneration.hpp | 2 +- src/hotspot/share/gc/z/zGlobals.hpp | 2 +- src/hotspot/share/gc/z/zHeapIterator.hpp | 2 +- src/hotspot/share/gc/z/zMark.hpp | 2 +- src/hotspot/share/gc/z/zMark.inline.hpp | 2 +- src/hotspot/share/gc/z/zMarkContext.hpp | 2 +- src/hotspot/share/gc/z/zMarkContext.inline.hpp | 2 +- src/hotspot/share/gc/z/zNMethod.hpp | 2 +- src/hotspot/share/gc/z/zNMethodTableIteration.hpp | 2 +- src/hotspot/share/gc/z/zPageTable.hpp | 2 +- src/hotspot/share/gc/z/zRemembered.hpp | 2 +- src/hotspot/share/gc/z/zStat.hpp | 2 +- src/hotspot/share/gc/z/zThreadLocalData.hpp | 2 +- src/hotspot/share/gc/z/zUncoloredRoot.hpp | 2 +- src/hotspot/share/include/jmm.h | 2 +- src/hotspot/share/include/jvm_io.h | 2 +- src/hotspot/share/interpreter/bytecode.hpp | 2 +- src/hotspot/share/interpreter/bytecode.inline.hpp | 2 +- src/hotspot/share/interpreter/bytecodeHistogram.hpp | 2 +- src/hotspot/share/interpreter/bytecodeStream.hpp | 2 +- src/hotspot/share/interpreter/bytecodeTracer.hpp | 2 +- src/hotspot/share/interpreter/interpreter.hpp | 2 +- src/hotspot/share/interpreter/interpreterRuntime.hpp | 2 +- src/hotspot/share/interpreter/linkResolver.hpp | 2 +- src/hotspot/share/interpreter/templateInterpreter.hpp | 2 +- src/hotspot/share/interpreter/templateInterpreterGenerator.hpp | 2 +- src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp | 2 +- .../share/interpreter/zero/bytecodeInterpreter.inline.hpp | 2 +- src/hotspot/share/interpreter/zero/zeroInterpreter.hpp | 2 +- src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.hpp | 2 +- src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp | 2 +- src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.hpp | 2 +- src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.hpp | 2 +- .../jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp | 2 +- src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp | 2 +- src/hotspot/share/jfr/metadata/jfrSerializer.hpp | 2 +- src/hotspot/share/jfr/recorder/jfrEventSetting.hpp | 2 +- .../share/jfr/recorder/stacktrace/jfrStackFilterRegistry.hpp | 2 +- src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.hpp | 2 +- .../share/jfr/recorder/stringpool/jfrStringPoolWriter.hpp | 2 +- src/hotspot/share/jfr/support/jfrDeprecationEventWriter.hpp | 2 +- src/hotspot/share/jfr/support/jfrDeprecationManager.hpp | 2 +- src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp | 2 +- src/hotspot/share/jfr/support/jfrStackTraceMark.hpp | 2 +- src/hotspot/share/jfr/utilities/jfrBigEndian.hpp | 2 +- src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp | 2 +- src/hotspot/share/jfr/utilities/jfrEpochQueue.inline.hpp | 2 +- src/hotspot/share/jfr/utilities/jfrRelation.hpp | 2 +- src/hotspot/share/jfr/writers/jfrMemoryWriterHost.hpp | 2 +- src/hotspot/share/jfr/writers/jfrMemoryWriterHost.inline.hpp | 2 +- src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp | 2 +- src/hotspot/share/jvmci/jvmci.hpp | 2 +- src/hotspot/share/jvmci/jvmciEnv.hpp | 2 +- src/hotspot/share/jvmci/jvmci_globals.hpp | 2 +- src/hotspot/share/jvmci/vmSymbols_jvmci.hpp | 2 +- src/hotspot/share/libadt/vectset.hpp | 2 +- src/hotspot/share/logging/log.hpp | 2 +- src/hotspot/share/logging/logConfiguration.hpp | 2 +- src/hotspot/share/logging/logDecorators.hpp | 2 +- src/hotspot/share/memory/heapInspection.hpp | 2 +- src/hotspot/share/memory/iterator.hpp | 2 +- src/hotspot/share/memory/memoryReserver.hpp | 2 +- src/hotspot/share/memory/metaspace/metablock.inline.hpp | 2 +- src/hotspot/share/memory/resourceArea.inline.hpp | 2 +- src/hotspot/share/nmt/mallocHeader.hpp | 2 +- src/hotspot/share/nmt/mallocHeader.inline.hpp | 2 +- src/hotspot/share/nmt/nativeCallStackPrinter.hpp | 2 +- src/hotspot/share/oops/access.hpp | 2 +- src/hotspot/share/oops/access.inline.hpp | 2 +- src/hotspot/share/oops/instanceClassLoaderKlass.hpp | 2 +- src/hotspot/share/oops/instanceMirrorKlass.hpp | 2 +- src/hotspot/share/oops/instanceRefKlass.hpp | 2 +- src/hotspot/share/oops/instanceStackChunkKlass.hpp | 2 +- src/hotspot/share/oops/metadata.hpp | 2 +- src/hotspot/share/oops/oopCast.inline.hpp | 2 +- src/hotspot/share/oops/oopHandle.inline.hpp | 2 +- src/hotspot/share/oops/stackChunkOop.hpp | 2 +- src/hotspot/share/oops/weakHandle.inline.hpp | 2 +- src/hotspot/share/opto/callGenerator.hpp | 2 +- src/hotspot/share/opto/countbitsnode.hpp | 2 +- src/hotspot/share/opto/escape.hpp | 2 +- src/hotspot/share/opto/graphKit.hpp | 2 +- src/hotspot/share/opto/idealKit.hpp | 2 +- src/hotspot/share/opto/indexSet.hpp | 2 +- src/hotspot/share/opto/intrinsicnode.hpp | 2 +- src/hotspot/share/opto/multnode.hpp | 2 +- src/hotspot/share/opto/stringopts.hpp | 2 +- src/hotspot/share/opto/superwordVTransformBuilder.hpp | 2 +- src/hotspot/share/prims/foreignGlobals.inline.hpp | 2 +- src/hotspot/share/prims/jvmtiAgent.hpp | 2 +- src/hotspot/share/prims/jvmtiEventController.inline.hpp | 2 +- src/hotspot/share/prims/jvmtiImpl.hpp | 2 +- src/hotspot/share/prims/jvmtiTagMapTable.hpp | 2 +- src/hotspot/share/prims/jvmtiThreadState.inline.hpp | 2 +- src/hotspot/share/prims/methodHandles.hpp | 2 +- src/hotspot/share/prims/vectorSupport.hpp | 2 +- src/hotspot/share/prims/vmstorage.hpp | 2 +- src/hotspot/share/runtime/continuationHelper.inline.hpp | 2 +- src/hotspot/share/runtime/continuationJavaClasses.hpp | 2 +- src/hotspot/share/runtime/continuationWrapper.inline.hpp | 2 +- src/hotspot/share/runtime/flags/flagSetting.hpp | 2 +- src/hotspot/share/runtime/flags/jvmFlagLookup.hpp | 2 +- src/hotspot/share/runtime/handles.hpp | 2 +- src/hotspot/share/runtime/handles.inline.hpp | 2 +- src/hotspot/share/runtime/icache.hpp | 2 +- src/hotspot/share/runtime/interfaceSupport.inline.hpp | 2 +- src/hotspot/share/runtime/java.hpp | 2 +- src/hotspot/share/runtime/jfieldIDWorkaround.hpp | 2 +- src/hotspot/share/runtime/monitorDeflationThread.hpp | 2 +- src/hotspot/share/runtime/notificationThread.hpp | 2 +- src/hotspot/share/runtime/park.hpp | 2 +- src/hotspot/share/runtime/perfDataTypes.hpp | 2 +- src/hotspot/share/runtime/safefetch.hpp | 2 +- src/hotspot/share/runtime/safepoint.hpp | 2 +- src/hotspot/share/runtime/safepointVerifiers.hpp | 2 +- src/hotspot/share/runtime/signature.cpp | 2 +- src/hotspot/share/runtime/smallRegisterMap.inline.hpp | 2 +- src/hotspot/share/runtime/stackChunkFrameStream.hpp | 2 +- src/hotspot/share/runtime/stackChunkFrameStream.inline.hpp | 2 +- src/hotspot/share/runtime/stackWatermark.hpp | 2 +- src/hotspot/share/runtime/threadIdentifier.hpp | 2 +- src/hotspot/share/runtime/vframe.hpp | 2 +- src/hotspot/share/runtime/vmOperations.hpp | 2 +- src/hotspot/share/services/gcNotifier.hpp | 2 +- src/hotspot/share/services/threadIdTable.hpp | 2 +- src/hotspot/share/utilities/elfFile.hpp | 2 +- src/hotspot/share/utilities/macros.hpp | 2 +- src/hotspot/share/utilities/nativeCallStack.hpp | 2 +- src/hotspot/share/utilities/numberSeq.hpp | 2 +- src/hotspot/share/utilities/objectBitSet.hpp | 2 +- src/hotspot/share/utilities/objectBitSet.inline.hpp | 2 +- src/hotspot/share/utilities/resizableHashTable.hpp | 2 +- src/hotspot/share/utilities/ticks.hpp | 2 +- test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java | 2 +- .../jtreg/compiler/c2/irTests/LShiftINodeIdealizationTests.java | 2 +- .../jtreg/compiler/c2/irTests/LShiftLNodeIdealizationTests.java | 2 +- .../jtreg/compiler/c2/irTests/RShiftINodeIdealizationTests.java | 2 +- .../jtreg/compiler/c2/irTests/RShiftLNodeIdealizationTests.java | 2 +- test/hotspot/jtreg/compiler/c2/irTests/TestConv2BExpansion.java | 2 +- test/hotspot/jtreg/compiler/c2/irTests/TestFPComparison.java | 2 +- test/hotspot/jtreg/compiler/c2/irTests/TestIfMinMax.java | 2 +- test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java | 2 +- .../hotspot/jtreg/compiler/c2/irTests/TestMinMaxIdentities.java | 2 +- .../compiler/c2/irTests/TestVectorizationMismatchedAccess.java | 2 +- .../c2/irTests/scalarReplacement/AllocationMergesTests.java | 2 +- test/hotspot/jtreg/compiler/ciReplay/InliningBase.java | 2 +- .../jtreg/compiler/compilercontrol/commands/OptionTest.java | 2 +- .../jtreg/compiler/escapeAnalysis/TestFindInstMemRecursion.java | 2 +- test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java | 2 +- .../jtreg/compiler/gcbarriers/TestZGCBarrierElision.java | 2 +- test/hotspot/jtreg/compiler/intrinsics/TestCompareUnsigned.java | 2 +- .../jtreg/compiler/intrinsics/bigInteger/TestMultiplyToLen.java | 2 +- .../hotspot/jtreg/compiler/intrinsics/bigInteger/TestShift.java | 2 +- .../jtreg/compiler/intrinsics/bigInteger/TestSquareToLen.java | 2 +- .../jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java | 2 +- .../jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java | 2 +- .../jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java | 2 +- .../compiler/intrinsics/klass/CastNullCheckDroppingsTest.java | 2 +- .../jtreg/compiler/intrinsics/string/TestStringIntrinsics.java | 2 +- test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java | 2 +- .../patches/java.base/java/lang/invoke/MethodHandleHelper.java | 2 +- test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java | 2 +- .../src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java | 2 +- .../compiler/loopopts/TestLoopPredicationDivZeroCheck.java | 2 +- .../jtreg/compiler/loopopts/superword/TestCyclicDependency.java | 2 +- .../superword/TestIndependentPacksWithCyclicDependency.java | 2 +- .../jtreg/compiler/loopopts/superword/TestMulAddS2I.java | 2 +- .../loopopts/superword/TestScheduleReordersScalarMemops.java | 2 +- .../superword/TestUnorderedReductionPartialVectorization.java | 2 +- .../assertion/TestTemplateWithoutOpaqueLoopNodes.java | 2 +- .../jtreg/compiler/splitif/TestSplitDivisionThroughPhi.java | 2 +- test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java | 2 +- .../compiler/vectorization/TestFloatConversionsVectorNaN.java | 2 +- .../jtreg/compiler/vectorization/TestReverseBitsVector.java | 2 +- .../vectorization/runner/LoopArrayIndexComputeTest.java | 2 +- .../jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java | 2 +- test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java | 2 +- test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java | 2 +- .../jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java | 2 +- test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java | 2 +- test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java | 2 +- test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java | 2 +- .../gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java | 2 +- .../jtreg/gc/g1/pinnedobjs/TestPinnedOldObjectsEvacuation.java | 2 +- test/hotspot/jtreg/gc/parallel/TestDynShrinkHeap.java | 2 +- test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithZ.java | 2 +- test/hotspot/jtreg/gtest/AsyncLogGtest.java | 2 +- test/hotspot/jtreg/gtest/CompressedKlassGtest.java | 2 +- test/hotspot/jtreg/gtest/MetaspaceGtests.java | 2 +- .../CommandLine/OptionsValidation/TestOptionsWithRanges.java | 2 +- test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java | 2 +- .../runtime/ErrorHandling/UncaughtNativeExceptionTest.java | 2 +- test/hotspot/jtreg/runtime/ErrorHandling/libNativeException.c | 2 +- test/hotspot/jtreg/runtime/NMT/MallocRoundingReportTest.java | 2 +- test/hotspot/jtreg/runtime/NMT/MallocTestType.java | 2 +- test/hotspot/jtreg/runtime/NMT/MallocTrackingVerify.java | 2 +- test/hotspot/jtreg/runtime/NMT/ThreadedMallocTestType.java | 2 +- .../jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java | 2 +- test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java | 2 +- test/hotspot/jtreg/runtime/cds/ServiceLoaderTest.java | 2 +- test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java | 2 +- test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java | 2 +- .../jtreg/runtime/cds/appcds/CreateAOTCacheVerifyError.java | 2 +- test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java | 2 +- .../cds/appcds/cacheObject/ArchivedIntegerCacheTest.java | 2 +- .../appcds/cacheObject/ArchivedModuleWithCustomImageTest.java | 2 +- .../cds/appcds/customLoader/PrintSharedArchiveAndExit.java | 2 +- .../jtreg/runtime/cds/appcds/dynamicArchive/NestHostOldInf.java | 2 +- .../cds/appcds/dynamicArchive/PrintSharedArchiveAndExit.java | 2 +- .../cds/appcds/jigsaw/modulepath/src/com.foos/module-info.java | 2 +- .../cds/appcds/sharedStrings/SharedStringsHumongous.java | 2 +- .../runtime/cds/appcds/sharedStrings/SharedStringsUtils.java | 2 +- .../serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java | 2 +- test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java | 2 +- .../nsk/monitoring/share/server/ServerMemoryMXBean.java | 2 +- 451 files changed, 451 insertions(+), 451 deletions(-) diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp index fb14d588f04..5138e796360 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp index 729cd2827b7..21916a5f7dd 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp index 19a892f5ff8..04a2d4e2bd5 100644 --- a/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/continuationHelper_aarch64.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp index 8de9b77d608..e69be999f00 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.hpp index cdad45b9ead..07dd8eb5565 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp index ae2819e78ca..487970ab0c5 100644 --- a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad b/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad index 8149c7e4c97..ad2e9243823 100644 --- a/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad +++ b/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp b/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp index a6e7d74f528..1b3453f3d9a 100644 --- a/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/aarch64/methodHandles_aarch64.hpp b/src/hotspot/cpu/aarch64/methodHandles_aarch64.hpp index e82f4d6237e..5d1041528f7 100644 --- a/src/hotspot/cpu/aarch64/methodHandles_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/methodHandles_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/aarch64/register_aarch64.hpp b/src/hotspot/cpu/aarch64/register_aarch64.hpp index 108f0f34140..d1e0632c80b 100644 --- a/src/hotspot/cpu/aarch64/register_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/register_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp index dd00e765eea..910dfa7504e 100644 --- a/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/smallRegisterMap_aarch64.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/aarch64/stackChunkFrameStream_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/stackChunkFrameStream_aarch64.inline.hpp index 8d2f013e116..18c24ad0543 100644 --- a/src/hotspot/cpu/aarch64/stackChunkFrameStream_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/stackChunkFrameStream_aarch64.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/arm/assembler_arm_32.hpp b/src/hotspot/cpu/arm/assembler_arm_32.hpp index d6524f08680..e66953365b5 100644 --- a/src/hotspot/cpu/arm/assembler_arm_32.hpp +++ b/src/hotspot/cpu/arm/assembler_arm_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/cpu/arm/c1_Defs_arm.hpp b/src/hotspot/cpu/arm/c1_Defs_arm.hpp index 5145efd011a..3a11e1dcf39 100644 --- a/src/hotspot/cpu/arm/c1_Defs_arm.hpp +++ b/src/hotspot/cpu/arm/c1_Defs_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.hpp b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.hpp index 615d2f188ff..47e44158821 100644 --- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.hpp +++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/cpu/arm/continuationFreezeThaw_arm.inline.hpp b/src/hotspot/cpu/arm/continuationFreezeThaw_arm.inline.hpp index 05172ffeba3..6728f716caa 100644 --- a/src/hotspot/cpu/arm/continuationFreezeThaw_arm.inline.hpp +++ b/src/hotspot/cpu/arm/continuationFreezeThaw_arm.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.hpp b/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.hpp index ce767754294..d17e72e9286 100644 --- a/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.hpp +++ b/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/cpu/arm/interp_masm_arm.hpp b/src/hotspot/cpu/arm/interp_masm_arm.hpp index 578e191719e..530be1c577e 100644 --- a/src/hotspot/cpu/arm/interp_masm_arm.hpp +++ b/src/hotspot/cpu/arm/interp_masm_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/cpu/arm/matcher_arm.hpp b/src/hotspot/cpu/arm/matcher_arm.hpp index 66fe8ac330e..6c818e1f20d 100644 --- a/src/hotspot/cpu/arm/matcher_arm.hpp +++ b/src/hotspot/cpu/arm/matcher_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp b/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp index 1223384d3b7..e3b6a5dae8b 100644 --- a/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp +++ b/src/hotspot/cpu/arm/smallRegisterMap_arm.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/arm/stackChunkFrameStream_arm.inline.hpp b/src/hotspot/cpu/arm/stackChunkFrameStream_arm.inline.hpp index 2da68d6d5ee..259ed04ce29 100644 --- a/src/hotspot/cpu/arm/stackChunkFrameStream_arm.inline.hpp +++ b/src/hotspot/cpu/arm/stackChunkFrameStream_arm.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/arm/stubRoutines_arm.hpp b/src/hotspot/cpu/arm/stubRoutines_arm.hpp index 838b3e6d378..45ab10d14f9 100644 --- a/src/hotspot/cpu/arm/stubRoutines_arm.hpp +++ b/src/hotspot/cpu/arm/stubRoutines_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/cpu/arm/vmreg_arm.hpp b/src/hotspot/cpu/arm/vmreg_arm.hpp index f1dfd09a1e6..c8a02c5c660 100644 --- a/src/hotspot/cpu/arm/vmreg_arm.hpp +++ b/src/hotspot/cpu/arm/vmreg_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/cpu/arm/vmreg_arm.inline.hpp b/src/hotspot/cpu/arm/vmreg_arm.inline.hpp index 3e5c18dbda0..826ba03d6d3 100644 --- a/src/hotspot/cpu/arm/vmreg_arm.inline.hpp +++ b/src/hotspot/cpu/arm/vmreg_arm.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/cpu/ppc/c1_Defs_ppc.hpp b/src/hotspot/cpu/ppc/c1_Defs_ppc.hpp index f322e548e21..e2183b49f2a 100644 --- a/src/hotspot/cpu/ppc/c1_Defs_ppc.hpp +++ b/src/hotspot/cpu/ppc/c1_Defs_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.hpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.hpp index 6a2f6264850..dea055710cd 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp b/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp index e35bdae70d6..f7704ea5b14 100644 --- a/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp b/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp index 7c6d19d442b..1471a6299ee 100644 --- a/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp index 390623f48a1..2bf26bd5010 100644 --- a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.hpp b/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.hpp index 261d6ef85d9..bc74be4ac24 100644 --- a/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2021 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp b/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp index 221a3c01341..dfc7301c43d 100644 --- a/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/smallRegisterMap_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/ppc/stackChunkFrameStream_ppc.inline.hpp b/src/hotspot/cpu/ppc/stackChunkFrameStream_ppc.inline.hpp index a14ec9303f6..785f7e4b287 100644 --- a/src/hotspot/cpu/ppc/stackChunkFrameStream_ppc.inline.hpp +++ b/src/hotspot/cpu/ppc/stackChunkFrameStream_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp b/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp index e85b64bd6ba..06f72ea5862 100644 --- a/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/assembler_riscv.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/cpu/riscv/c1_Defs_riscv.hpp b/src/hotspot/cpu/riscv/c1_Defs_riscv.hpp index 65113656601..6c93ce14ef0 100644 --- a/src/hotspot/cpu/riscv/c1_Defs_riscv.hpp +++ b/src/hotspot/cpu/riscv/c1_Defs_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp index ed2ab0c4861..1e466e90d37 100644 --- a/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp b/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp index f541ac117eb..9fc157f9d8f 100644 --- a/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp +++ b/src/hotspot/cpu/riscv/codeBuffer_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp b/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp index d6586617a63..2c2cb03b59e 100644 --- a/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp b/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp index 918bf3db8cc..6aa6a3d7895 100644 --- a/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp index bc0b14f1365..e50fa1dae36 100644 --- a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.hpp b/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.hpp index cf97d0ff5cb..6f6e9065103 100644 --- a/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.hpp +++ b/src/hotspot/cpu/riscv/gc/shared/cardTableBarrierSetAssembler_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/riscv/gc/z/z_riscv.ad b/src/hotspot/cpu/riscv/gc/z/z_riscv.ad index e3847019bb3..a408cf309d5 100644 --- a/src/hotspot/cpu/riscv/gc/z/z_riscv.ad +++ b/src/hotspot/cpu/riscv/gc/z/z_riscv.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.hpp b/src/hotspot/cpu/riscv/interp_masm_riscv.hpp index 89b2ed17291..a9df09d656a 100644 --- a/src/hotspot/cpu/riscv/interp_masm_riscv.hpp +++ b/src/hotspot/cpu/riscv/interp_masm_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/cpu/riscv/javaFrameAnchor_riscv.hpp b/src/hotspot/cpu/riscv/javaFrameAnchor_riscv.hpp index 6bf1230914a..65d67462d94 100644 --- a/src/hotspot/cpu/riscv/javaFrameAnchor_riscv.hpp +++ b/src/hotspot/cpu/riscv/javaFrameAnchor_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/riscv/matcher_riscv.hpp b/src/hotspot/cpu/riscv/matcher_riscv.hpp index 1b490a07f92..3d27a25e333 100644 --- a/src/hotspot/cpu/riscv/matcher_riscv.hpp +++ b/src/hotspot/cpu/riscv/matcher_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2022, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/riscv/methodHandles_riscv.hpp b/src/hotspot/cpu/riscv/methodHandles_riscv.hpp index ffc3b3ab676..51d51734f4a 100644 --- a/src/hotspot/cpu/riscv/methodHandles_riscv.hpp +++ b/src/hotspot/cpu/riscv/methodHandles_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/riscv/riscv_b.ad b/src/hotspot/cpu/riscv/riscv_b.ad index beac10ec03d..a13efa96fc1 100644 --- a/src/hotspot/cpu/riscv/riscv_b.ad +++ b/src/hotspot/cpu/riscv/riscv_b.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2022, Huawei Technologies Co., Ltd. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // diff --git a/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp b/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp index ea5aef14ae1..58856d5f0ff 100644 --- a/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/smallRegisterMap_riscv.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp b/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp index 9e2b8003dc4..adff11c6a9f 100644 --- a/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp b/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp index 0f90777ce64..2c4e7210413 100644 --- a/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp +++ b/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/cpu/s390/assembler_s390.inline.hpp b/src/hotspot/cpu/s390/assembler_s390.inline.hpp index 3bab60f0bb6..a36906b0d4a 100644 --- a/src/hotspot/cpu/s390/assembler_s390.inline.hpp +++ b/src/hotspot/cpu/s390/assembler_s390.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/c1_Defs_s390.hpp b/src/hotspot/cpu/s390/c1_Defs_s390.hpp index 31e0f85efcc..a96c06b191b 100644 --- a/src/hotspot/cpu/s390/c1_Defs_s390.hpp +++ b/src/hotspot/cpu/s390/c1_Defs_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/c1_FrameMap_s390.hpp b/src/hotspot/cpu/s390/c1_FrameMap_s390.hpp index 721995f41fe..c4eed289eff 100644 --- a/src/hotspot/cpu/s390/c1_FrameMap_s390.hpp +++ b/src/hotspot/cpu/s390/c1_FrameMap_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2023 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/continuationFreezeThaw_s390.inline.hpp b/src/hotspot/cpu/s390/continuationFreezeThaw_s390.inline.hpp index 33ac17effa7..1102a745ac0 100644 --- a/src/hotspot/cpu/s390/continuationFreezeThaw_s390.inline.hpp +++ b/src/hotspot/cpu/s390/continuationFreezeThaw_s390.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/s390/disassembler_s390.cpp b/src/hotspot/cpu/s390/disassembler_s390.cpp index a69851cfdba..90f2eb60e2e 100644 --- a/src/hotspot/cpu/s390/disassembler_s390.cpp +++ b/src/hotspot/cpu/s390/disassembler_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp index 3e0b2be4873..65db915b672 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.hpp b/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.hpp index eb64a09a51f..8d0c8b82b68 100644 --- a/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/interp_masm_s390.hpp b/src/hotspot/cpu/s390/interp_masm_s390.hpp index 94ad63b16c6..d981f9ea01e 100644 --- a/src/hotspot/cpu/s390/interp_masm_s390.hpp +++ b/src/hotspot/cpu/s390/interp_masm_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp b/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp index 307034ca0cd..5feba6dee65 100644 --- a/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp +++ b/src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/matcher_s390.hpp b/src/hotspot/cpu/s390/matcher_s390.hpp index e4c277c63a8..99461e33e3c 100644 --- a/src/hotspot/cpu/s390/matcher_s390.hpp +++ b/src/hotspot/cpu/s390/matcher_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp b/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp index 43363ccd933..f338fb192ad 100644 --- a/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp +++ b/src/hotspot/cpu/s390/smallRegisterMap_s390.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/s390/stackChunkFrameStream_s390.inline.hpp b/src/hotspot/cpu/s390/stackChunkFrameStream_s390.inline.hpp index 4fff0846a80..e598117fe7d 100644 --- a/src/hotspot/cpu/s390/stackChunkFrameStream_s390.inline.hpp +++ b/src/hotspot/cpu/s390/stackChunkFrameStream_s390.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/s390/stubRoutines_s390.hpp b/src/hotspot/cpu/s390/stubRoutines_s390.hpp index 494d90cd85a..0a07efae46c 100644 --- a/src/hotspot/cpu/s390/stubRoutines_s390.hpp +++ b/src/hotspot/cpu/s390/stubRoutines_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/x86/assembler_x86.inline.hpp b/src/hotspot/cpu/x86/assembler_x86.inline.hpp index 6fae9764306..6f4490d5e25 100644 --- a/src/hotspot/cpu/x86/assembler_x86.inline.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/cpu/x86/c1_Defs_x86.hpp b/src/hotspot/cpu/x86/c1_Defs_x86.hpp index bfb885a1b73..9e286eb0460 100644 --- a/src/hotspot/cpu/x86/c1_Defs_x86.hpp +++ b/src/hotspot/cpu/x86/c1_Defs_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/cpu/x86/c1_FrameMap_x86.hpp b/src/hotspot/cpu/x86/c1_FrameMap_x86.hpp index 08b872cb095..b84b70085b0 100644 --- a/src/hotspot/cpu/x86/c1_FrameMap_x86.hpp +++ b/src/hotspot/cpu/x86/c1_FrameMap_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp index 33f7b063e77..7786c44b68f 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp b/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp index dcc9a77765a..0220de99375 100644 --- a/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp +++ b/src/hotspot/cpu/x86/c1_LinearScan_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp b/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp index bb32e55db75..ffb1b733303 100644 --- a/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp +++ b/src/hotspot/cpu/x86/continuationHelper_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp index fd52379d2e2..c5bf17c3b4e 100644 --- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp index 6f71ec64218..0a36571c757 100644 --- a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp index 8bb653ec5fb..19902500f93 100644 --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad index e66b4b0da7a..0c640dde285 100644 --- a/src/hotspot/cpu/x86/gc/z/z_x86_64.ad +++ b/src/hotspot/cpu/x86/gc/z/z_x86_64.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2015, 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 diff --git a/src/hotspot/cpu/x86/icache_x86.hpp b/src/hotspot/cpu/x86/icache_x86.hpp index 805022fbb32..92e4fbf1569 100644 --- a/src/hotspot/cpu/x86/icache_x86.hpp +++ b/src/hotspot/cpu/x86/icache_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/cpu/x86/interpreterRT_x86.hpp b/src/hotspot/cpu/x86/interpreterRT_x86.hpp index 6875280d9f5..8ff4e54c38a 100644 --- a/src/hotspot/cpu/x86/interpreterRT_x86.hpp +++ b/src/hotspot/cpu/x86/interpreterRT_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 diff --git a/src/hotspot/cpu/x86/matcher_x86.hpp b/src/hotspot/cpu/x86/matcher_x86.hpp index 41486c244b2..f7973a8564e 100644 --- a/src/hotspot/cpu/x86/matcher_x86.hpp +++ b/src/hotspot/cpu/x86/matcher_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/cpu/x86/methodHandles_x86.hpp b/src/hotspot/cpu/x86/methodHandles_x86.hpp index 6ba9b5f6a4f..83b59834261 100644 --- a/src/hotspot/cpu/x86/methodHandles_x86.hpp +++ b/src/hotspot/cpu/x86/methodHandles_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 diff --git a/src/hotspot/cpu/x86/nativeInst_x86.hpp b/src/hotspot/cpu/x86/nativeInst_x86.hpp index ec7fc3b154a..aba4400515f 100644 --- a/src/hotspot/cpu/x86/nativeInst_x86.hpp +++ b/src/hotspot/cpu/x86/nativeInst_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/cpu/x86/peephole_x86_64.hpp b/src/hotspot/cpu/x86/peephole_x86_64.hpp index 954297f555a..9152fe8abd0 100644 --- a/src/hotspot/cpu/x86/peephole_x86_64.hpp +++ b/src/hotspot/cpu/x86/peephole_x86_64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/cpu/x86/rdtsc_x86.hpp b/src/hotspot/cpu/x86/rdtsc_x86.hpp index a6519c439d3..2506404d68e 100644 --- a/src/hotspot/cpu/x86/rdtsc_x86.hpp +++ b/src/hotspot/cpu/x86/rdtsc_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp b/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp index 78b604c16fc..772a5266585 100644 --- a/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp +++ b/src/hotspot/cpu/x86/smallRegisterMap_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/x86/stackChunkFrameStream_x86.inline.hpp b/src/hotspot/cpu/x86/stackChunkFrameStream_x86.inline.hpp index ebdae8a7eac..24afb960e9c 100644 --- a/src/hotspot/cpu/x86/stackChunkFrameStream_x86.inline.hpp +++ b/src/hotspot/cpu/x86/stackChunkFrameStream_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.hpp b/src/hotspot/cpu/x86/stubRoutines_x86.hpp index 7d13c4f6e7a..3654b644131 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2024, 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 diff --git a/src/hotspot/cpu/zero/assembler_zero.inline.hpp b/src/hotspot/cpu/zero/assembler_zero.inline.hpp index d78eb39c973..a2961cfa84d 100644 --- a/src/hotspot/cpu/zero/assembler_zero.inline.hpp +++ b/src/hotspot/cpu/zero/assembler_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/zero/continuationFreezeThaw_zero.inline.hpp b/src/hotspot/cpu/zero/continuationFreezeThaw_zero.inline.hpp index 22f596b161a..740f65e3460 100644 --- a/src/hotspot/cpu/zero/continuationFreezeThaw_zero.inline.hpp +++ b/src/hotspot/cpu/zero/continuationFreezeThaw_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/zero/icache_zero.hpp b/src/hotspot/cpu/zero/icache_zero.hpp index 781021a2b20..cb6acb1b803 100644 --- a/src/hotspot/cpu/zero/icache_zero.hpp +++ b/src/hotspot/cpu/zero/icache_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp b/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp index 906575ab669..f6375796aec 100644 --- a/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp +++ b/src/hotspot/cpu/zero/smallRegisterMap_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/zero/stackChunkFrameStream_zero.inline.hpp b/src/hotspot/cpu/zero/stackChunkFrameStream_zero.inline.hpp index 3b9643fb3f4..f168062a59c 100644 --- a/src/hotspot/cpu/zero/stackChunkFrameStream_zero.inline.hpp +++ b/src/hotspot/cpu/zero/stackChunkFrameStream_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/cpu/zero/stubRoutines_zero.hpp b/src/hotspot/cpu/zero/stubRoutines_zero.hpp index 2002efc9f51..8050de8f9fd 100644 --- a/src/hotspot/cpu/zero/stubRoutines_zero.hpp +++ b/src/hotspot/cpu/zero/stubRoutines_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/os/aix/libodm_aix.cpp b/src/hotspot/os/aix/libodm_aix.cpp index 854fd5e2b79..035703a1771 100644 --- a/src/hotspot/os/aix/libodm_aix.cpp +++ b/src/hotspot/os/aix/libodm_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/os/aix/libperfstat_aix.hpp b/src/hotspot/os/aix/libperfstat_aix.hpp index a984440e579..5a6ddfd8f4d 100644 --- a/src/hotspot/os/aix/libperfstat_aix.hpp +++ b/src/hotspot/os/aix/libperfstat_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2024 SAP SE. All rights reserved. * Copyright (c) 2022, IBM Corp. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/os/aix/osThread_aix.hpp b/src/hotspot/os/aix/osThread_aix.hpp index 81c0eafa0f7..a3ba62d59db 100644 --- a/src/hotspot/os/aix/osThread_aix.hpp +++ b/src/hotspot/os/aix/osThread_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/os/aix/os_aix.hpp b/src/hotspot/os/aix/os_aix.hpp index a7bac40e79b..a30e2077fc2 100644 --- a/src/hotspot/os/aix/os_aix.hpp +++ b/src/hotspot/os/aix/os_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp b/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp index e5978c8d93a..1c9a6d7d831 100644 --- a/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp +++ b/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/os/linux/os_linux.hpp b/src/hotspot/os/linux/os_linux.hpp index 43f70b4af56..41b5afbf5c3 100644 --- a/src/hotspot/os/linux/os_linux.hpp +++ b/src/hotspot/os/linux/os_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/os/linux/os_linux.inline.hpp b/src/hotspot/os/linux/os_linux.inline.hpp index 4b5592d2f62..19438e50ad2 100644 --- a/src/hotspot/os/linux/os_linux.inline.hpp +++ b/src/hotspot/os/linux/os_linux.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/os/linux/procMapsParser.hpp b/src/hotspot/os/linux/procMapsParser.hpp index 037af91358f..b040f56e628 100644 --- a/src/hotspot/os/linux/procMapsParser.hpp +++ b/src/hotspot/os/linux/procMapsParser.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2024, Red Hat, Inc. and/or its affiliates. - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/os/posix/include/jvm_md.h b/src/hotspot/os/posix/include/jvm_md.h index 469738d01eb..eb8e1f0d7e9 100644 --- a/src/hotspot/os/posix/include/jvm_md.h +++ b/src/hotspot/os/posix/include/jvm_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/os/posix/signals_posix.hpp b/src/hotspot/os/posix/signals_posix.hpp index c1cb70df153..d0e32048ffa 100644 --- a/src/hotspot/os/posix/signals_posix.hpp +++ b/src/hotspot/os/posix/signals_posix.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/os/posix/threadLocalStorage_posix.cpp b/src/hotspot/os/posix/threadLocalStorage_posix.cpp index 8d1dad54a01..fe85a368df1 100644 --- a/src/hotspot/os/posix/threadLocalStorage_posix.cpp +++ b/src/hotspot/os/posix/threadLocalStorage_posix.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/os/windows/gc/z/zSyscall_windows.hpp b/src/hotspot/os/windows/gc/z/zSyscall_windows.hpp index 3d20fa5a924..ef093e1c370 100644 --- a/src/hotspot/os/windows/gc/z/zSyscall_windows.hpp +++ b/src/hotspot/os/windows/gc/z/zSyscall_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/os/windows/os_windows.hpp b/src/hotspot/os/windows/os_windows.hpp index f1153bbbfd3..d4a7d51c59b 100644 --- a/src/hotspot/os/windows/os_windows.hpp +++ b/src/hotspot/os/windows/os_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/os/windows/safefetch_windows.hpp b/src/hotspot/os/windows/safefetch_windows.hpp index c745b832abe..93e36d66d07 100644 --- a/src/hotspot/os/windows/safefetch_windows.hpp +++ b/src/hotspot/os/windows/safefetch_windows.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/os_cpu/bsd_aarch64/icache_bsd_aarch64.hpp b/src/hotspot/os_cpu/bsd_aarch64/icache_bsd_aarch64.hpp index 8b942730ae2..bacf907389f 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/icache_bsd_aarch64.hpp +++ b/src/hotspot/os_cpu/bsd_aarch64/icache_bsd_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * Copyright (c) 2021, Azul Systems, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S b/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S index 9ae19fa0cd9..ee70db01131 100644 --- a/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S +++ b/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S @@ -1,5 +1,5 @@ // Copyright (c) 2021, Red Hat Inc. All rights reserved. -// Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2024, 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 diff --git a/src/hotspot/os_cpu/linux_aarch64/copy_linux_aarch64.S b/src/hotspot/os_cpu/linux_aarch64/copy_linux_aarch64.S index 8abf9f49057..e4796483eb1 100644 --- a/src/hotspot/os_cpu/linux_aarch64/copy_linux_aarch64.S +++ b/src/hotspot/os_cpu/linux_aarch64/copy_linux_aarch64.S @@ -1,6 +1,6 @@ /* * Copyright (c) 2016, Linaro Ltd. All rights reserved. - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/os_cpu/linux_aarch64/icache_linux_aarch64.hpp b/src/hotspot/os_cpu/linux_aarch64/icache_linux_aarch64.hpp index 957be266702..8fbaa7a6b6e 100644 --- a/src/hotspot/os_cpu/linux_aarch64/icache_linux_aarch64.hpp +++ b/src/hotspot/os_cpu/linux_aarch64/icache_linux_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/os_cpu/linux_aarch64/safefetch_linux_aarch64.S b/src/hotspot/os_cpu/linux_aarch64/safefetch_linux_aarch64.S index ffffb7550bf..3a63ff7ad71 100644 --- a/src/hotspot/os_cpu/linux_aarch64/safefetch_linux_aarch64.S +++ b/src/hotspot/os_cpu/linux_aarch64/safefetch_linux_aarch64.S @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/os_cpu/linux_aarch64/threadLS_linux_aarch64.S b/src/hotspot/os_cpu/linux_aarch64/threadLS_linux_aarch64.S index 451c13773be..33be490190c 100644 --- a/src/hotspot/os_cpu/linux_aarch64/threadLS_linux_aarch64.S +++ b/src/hotspot/os_cpu/linux_aarch64/threadLS_linux_aarch64.S @@ -1,5 +1,5 @@ // Copyright (c) 2015, 2022, Red Hat Inc. All rights reserved. -// Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2024, 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 diff --git a/src/hotspot/os_cpu/linux_ppc/gc/z/zSyscall_linux_ppc.hpp b/src/hotspot/os_cpu/linux_ppc/gc/z/zSyscall_linux_ppc.hpp index 1b2b5dad7d7..97834f66a57 100644 --- a/src/hotspot/os_cpu/linux_ppc/gc/z/zSyscall_linux_ppc.hpp +++ b/src/hotspot/os_cpu/linux_ppc/gc/z/zSyscall_linux_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp b/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp index 828a603577d..26530cca5ba 100644 --- a/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp +++ b/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/os_cpu/windows_aarch64/icache_windows_aarch64.hpp b/src/hotspot/os_cpu/windows_aarch64/icache_windows_aarch64.hpp index e12caebf0e2..b12aa545079 100644 --- a/src/hotspot/os_cpu/windows_aarch64/icache_windows_aarch64.hpp +++ b/src/hotspot/os_cpu/windows_aarch64/icache_windows_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/share/adlc/adlc.hpp b/src/hotspot/share/adlc/adlc.hpp index dd35ebf9e1a..fbc941f4c1b 100644 --- a/src/hotspot/share/adlc/adlc.hpp +++ b/src/hotspot/share/adlc/adlc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 diff --git a/src/hotspot/share/adlc/adlparse.hpp b/src/hotspot/share/adlc/adlparse.hpp index bf30527c1f7..02baec53262 100644 --- a/src/hotspot/share/adlc/adlparse.hpp +++ b/src/hotspot/share/adlc/adlparse.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/asm/assembler.hpp b/src/hotspot/share/asm/assembler.hpp index 961b5fab700..bfe785fb94e 100644 --- a/src/hotspot/share/asm/assembler.hpp +++ b/src/hotspot/share/asm/assembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/c1/c1_Canonicalizer.hpp b/src/hotspot/share/c1/c1_Canonicalizer.hpp index f1c99d4996c..dc0b8c8dba7 100644 --- a/src/hotspot/share/c1/c1_Canonicalizer.hpp +++ b/src/hotspot/share/c1/c1_Canonicalizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/c1/c1_Defs.hpp b/src/hotspot/share/c1/c1_Defs.hpp index 5803e1ce686..bae44d620ae 100644 --- a/src/hotspot/share/c1/c1_Defs.hpp +++ b/src/hotspot/share/c1/c1_Defs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/share/c1/c1_GraphBuilder.hpp b/src/hotspot/share/c1/c1_GraphBuilder.hpp index 6eaeda5adcf..81983829ccb 100644 --- a/src/hotspot/share/c1/c1_GraphBuilder.hpp +++ b/src/hotspot/share/c1/c1_GraphBuilder.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/c1/c1_Instruction.hpp b/src/hotspot/share/c1/c1_Instruction.hpp index 6b5838f6062..7f6fb0f5191 100644 --- a/src/hotspot/share/c1/c1_Instruction.hpp +++ b/src/hotspot/share/c1/c1_Instruction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/c1/c1_InstructionPrinter.hpp b/src/hotspot/share/c1/c1_InstructionPrinter.hpp index b7bac561327..6edf270ec6e 100644 --- a/src/hotspot/share/c1/c1_InstructionPrinter.hpp +++ b/src/hotspot/share/c1/c1_InstructionPrinter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/c1/c1_LinearScan.hpp b/src/hotspot/share/c1/c1_LinearScan.hpp index 2088352d336..33cc0e5d17b 100644 --- a/src/hotspot/share/c1/c1_LinearScan.hpp +++ b/src/hotspot/share/c1/c1_LinearScan.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/hotspot/share/c1/c1_Optimizer.hpp b/src/hotspot/share/c1/c1_Optimizer.hpp index c26b7534bca..8ffe94dcf7d 100644 --- a/src/hotspot/share/c1/c1_Optimizer.hpp +++ b/src/hotspot/share/c1/c1_Optimizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/c1/c1_RangeCheckElimination.hpp b/src/hotspot/share/c1/c1_RangeCheckElimination.hpp index 833f5dd1e99..f36a2065109 100644 --- a/src/hotspot/share/c1/c1_RangeCheckElimination.hpp +++ b/src/hotspot/share/c1/c1_RangeCheckElimination.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/cds/aotClassLinker.hpp b/src/hotspot/share/cds/aotClassLinker.hpp index 7bbc9ce8138..66270bdb9cf 100644 --- a/src/hotspot/share/cds/aotClassLinker.hpp +++ b/src/hotspot/share/cds/aotClassLinker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/share/cds/aotMappedHeapLoader.inline.hpp b/src/hotspot/share/cds/aotMappedHeapLoader.inline.hpp index 0e50fefdf0f..2d7527949d3 100644 --- a/src/hotspot/share/cds/aotMappedHeapLoader.inline.hpp +++ b/src/hotspot/share/cds/aotMappedHeapLoader.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/cds/aotStreamedHeapLoader.hpp b/src/hotspot/share/cds/aotStreamedHeapLoader.hpp index d436af35dd0..065129a8a7b 100644 --- a/src/hotspot/share/cds/aotStreamedHeapLoader.hpp +++ b/src/hotspot/share/cds/aotStreamedHeapLoader.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/cds/aotThread.cpp b/src/hotspot/share/cds/aotThread.cpp index 113a751d2a1..f3382a6f7e4 100644 --- a/src/hotspot/share/cds/aotThread.cpp +++ b/src/hotspot/share/cds/aotThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/share/cds/lambdaFormInvokers.inline.hpp b/src/hotspot/share/cds/lambdaFormInvokers.inline.hpp index 09034debc13..d412873e5a4 100644 --- a/src/hotspot/share/cds/lambdaFormInvokers.inline.hpp +++ b/src/hotspot/share/cds/lambdaFormInvokers.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/src/hotspot/share/ci/bcEscapeAnalyzer.hpp b/src/hotspot/share/ci/bcEscapeAnalyzer.hpp index 27fb5cf1323..b75cb6a56f4 100644 --- a/src/hotspot/share/ci/bcEscapeAnalyzer.hpp +++ b/src/hotspot/share/ci/bcEscapeAnalyzer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/hotspot/share/ci/ciEnv.hpp b/src/hotspot/share/ci/ciEnv.hpp index a22975c7453..b384ff47a89 100644 --- a/src/hotspot/share/ci/ciEnv.hpp +++ b/src/hotspot/share/ci/ciEnv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/ci/ciInstance.hpp b/src/hotspot/share/ci/ciInstance.hpp index 1fb09985930..5367d397c97 100644 --- a/src/hotspot/share/ci/ciInstance.hpp +++ b/src/hotspot/share/ci/ciInstance.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/ci/ciMetadata.hpp b/src/hotspot/share/ci/ciMetadata.hpp index 2e232c59188..8f24ebcfaf5 100644 --- a/src/hotspot/share/ci/ciMetadata.hpp +++ b/src/hotspot/share/ci/ciMetadata.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/ci/ciTypeFlow.hpp b/src/hotspot/share/ci/ciTypeFlow.hpp index adfb85dc17f..add20077128 100644 --- a/src/hotspot/share/ci/ciTypeFlow.hpp +++ b/src/hotspot/share/ci/ciTypeFlow.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/share/ci/ciUtilities.inline.hpp b/src/hotspot/share/ci/ciUtilities.inline.hpp index 91f848368ac..78f4eb84fa9 100644 --- a/src/hotspot/share/ci/ciUtilities.inline.hpp +++ b/src/hotspot/share/ci/ciUtilities.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/classfile/bytecodeAssembler.hpp b/src/hotspot/share/classfile/bytecodeAssembler.hpp index c0383a9678c..cb40e92f1c4 100644 --- a/src/hotspot/share/classfile/bytecodeAssembler.hpp +++ b/src/hotspot/share/classfile/bytecodeAssembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/classfile/classLoaderDataGraph.hpp b/src/hotspot/share/classfile/classLoaderDataGraph.hpp index 803f227dcf3..19552706b17 100644 --- a/src/hotspot/share/classfile/classLoaderDataGraph.hpp +++ b/src/hotspot/share/classfile/classLoaderDataGraph.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/classfile/classLoaderStats.hpp b/src/hotspot/share/classfile/classLoaderStats.hpp index 23da6bff63c..b9b29512ac0 100644 --- a/src/hotspot/share/classfile/classLoaderStats.hpp +++ b/src/hotspot/share/classfile/classLoaderStats.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/classfile/defaultMethods.hpp b/src/hotspot/share/classfile/defaultMethods.hpp index c369cdc6cfd..e734008533b 100644 --- a/src/hotspot/share/classfile/defaultMethods.hpp +++ b/src/hotspot/share/classfile/defaultMethods.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/classfile/javaClassesImpl.hpp b/src/hotspot/share/classfile/javaClassesImpl.hpp index 5f88f708523..77975598ded 100644 --- a/src/hotspot/share/classfile/javaClassesImpl.hpp +++ b/src/hotspot/share/classfile/javaClassesImpl.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/classfile/vmClasses.hpp b/src/hotspot/share/classfile/vmClasses.hpp index caa54590eb2..21f74e7bdd8 100644 --- a/src/hotspot/share/classfile/vmClasses.hpp +++ b/src/hotspot/share/classfile/vmClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/code/codeBehaviours.hpp b/src/hotspot/share/code/codeBehaviours.hpp index 96a38fffc30..0484ac02e90 100644 --- a/src/hotspot/share/code/codeBehaviours.hpp +++ b/src/hotspot/share/code/codeBehaviours.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/code/codeCache.hpp b/src/hotspot/share/code/codeCache.hpp index dc9e5d7dc20..349cc652bf4 100644 --- a/src/hotspot/share/code/codeCache.hpp +++ b/src/hotspot/share/code/codeCache.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/code/compiledIC.hpp b/src/hotspot/share/code/compiledIC.hpp index db8a0860b39..f60ed93aa97 100644 --- a/src/hotspot/share/code/compiledIC.hpp +++ b/src/hotspot/share/code/compiledIC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/code/dependencyContext.hpp b/src/hotspot/share/code/dependencyContext.hpp index b08300ec645..6c3953e77e1 100644 --- a/src/hotspot/share/code/dependencyContext.hpp +++ b/src/hotspot/share/code/dependencyContext.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/compiler/abstractCompiler.hpp b/src/hotspot/share/compiler/abstractCompiler.hpp index adc85efbed5..5b97feb1a49 100644 --- a/src/hotspot/share/compiler/abstractCompiler.hpp +++ b/src/hotspot/share/compiler/abstractCompiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/compiler/compileLog.hpp b/src/hotspot/share/compiler/compileLog.hpp index 10698b3c13b..a92d03862f6 100644 --- a/src/hotspot/share/compiler/compileLog.hpp +++ b/src/hotspot/share/compiler/compileLog.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/compiler/compiler_globals.hpp b/src/hotspot/share/compiler/compiler_globals.hpp index 3919c596d74..98590abc15f 100644 --- a/src/hotspot/share/compiler/compiler_globals.hpp +++ b/src/hotspot/share/compiler/compiler_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/compiler/directivesParser.hpp b/src/hotspot/share/compiler/directivesParser.hpp index d4763430eb9..b0f6a74161a 100644 --- a/src/hotspot/share/compiler/directivesParser.hpp +++ b/src/hotspot/share/compiler/directivesParser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/compiler/disassembler.hpp b/src/hotspot/share/compiler/disassembler.hpp index 8e2ea3ce50d..db7066c9023 100644 --- a/src/hotspot/share/compiler/disassembler.hpp +++ b/src/hotspot/share/compiler/disassembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/share/compiler/methodMatcher.hpp b/src/hotspot/share/compiler/methodMatcher.hpp index 62945129e90..5f8fc8d4719 100644 --- a/src/hotspot/share/compiler/methodMatcher.hpp +++ b/src/hotspot/share/compiler/methodMatcher.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/compiler/oopMap.hpp b/src/hotspot/share/compiler/oopMap.hpp index f7a8cd8496c..0d9dbc188e8 100644 --- a/src/hotspot/share/compiler/oopMap.hpp +++ b/src/hotspot/share/compiler/oopMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 diff --git a/src/hotspot/share/compiler/oopMap.inline.hpp b/src/hotspot/share/compiler/oopMap.inline.hpp index e64ae506115..327c2ebaa3f 100644 --- a/src/hotspot/share/compiler/oopMap.inline.hpp +++ b/src/hotspot/share/compiler/oopMap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.hpp b/src/hotspot/share/gc/g1/g1AllocRegion.hpp index 248aa0a9da0..d21c6b0b43c 100644 --- a/src/hotspot/share/gc/g1/g1AllocRegion.hpp +++ b/src/hotspot/share/gc/g1/g1AllocRegion.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp b/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp index e1d23867ea3..a1b4f73378d 100644 --- a/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp +++ b/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/gc/g1/g1Allocator.hpp b/src/hotspot/share/gc/g1/g1Allocator.hpp index 9a7e62f5cc6..e340e2b40d1 100644 --- a/src/hotspot/share/gc/g1/g1Allocator.hpp +++ b/src/hotspot/share/gc/g1/g1Allocator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/gc/g1/g1Allocator.inline.hpp b/src/hotspot/share/gc/g1/g1Allocator.inline.hpp index f1e4d29c0e8..b5423b31575 100644 --- a/src/hotspot/share/gc/g1/g1Allocator.inline.hpp +++ b/src/hotspot/share/gc/g1/g1Allocator.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/g1/g1AnalyticsSequences.inline.hpp b/src/hotspot/share/gc/g1/g1AnalyticsSequences.inline.hpp index 9fae49320bc..0c8b4eb43a6 100644 --- a/src/hotspot/share/gc/g1/g1AnalyticsSequences.inline.hpp +++ b/src/hotspot/share/gc/g1/g1AnalyticsSequences.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/gc/g1/g1CardSet.inline.hpp b/src/hotspot/share/gc/g1/g1CardSet.inline.hpp index 4909e922c6b..98e5a72aa8c 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp index 7bb618e79b4..75af714060c 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.hpp b/src/hotspot/share/gc/g1/g1CollectionSet.hpp index e1d6c40f0ce..df0228c4956 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSet.hpp +++ b/src/hotspot/share/gc/g1/g1CollectionSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.inline.hpp b/src/hotspot/share/gc/g1/g1CollectionSet.inline.hpp index 8b2086f2109..b0321588d18 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSet.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CollectionSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/share/gc/g1/g1CollectionSetCandidates.hpp b/src/hotspot/share/gc/g1/g1CollectionSetCandidates.hpp index 8987ee6b338..7e882de7e5a 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSetCandidates.hpp +++ b/src/hotspot/share/gc/g1/g1CollectionSetCandidates.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/gc/g1/g1CollectionSetCandidates.inline.hpp b/src/hotspot/share/gc/g1/g1CollectionSetCandidates.inline.hpp index d32c7990d4e..b5080fee51c 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSetCandidates.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CollectionSetCandidates.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp index cb9727b3413..4db8ed23c49 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp +++ b/src/hotspot/share/gc/g1/g1CollectionSetChooser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp index bc2fd565aab..f6d47acdc01 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/gc/g1/g1EdenRegions.hpp b/src/hotspot/share/gc/g1/g1EdenRegions.hpp index a08cda97d4c..7cb4f93519e 100644 --- a/src/hotspot/share/gc/g1/g1EdenRegions.hpp +++ b/src/hotspot/share/gc/g1/g1EdenRegions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/g1/g1EvacStats.hpp b/src/hotspot/share/gc/g1/g1EvacStats.hpp index 4227cbab936..e6eb80442d6 100644 --- a/src/hotspot/share/gc/g1/g1EvacStats.hpp +++ b/src/hotspot/share/gc/g1/g1EvacStats.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.hpp b/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.hpp index d2bc8e7d8e0..9e1f69c24bc 100644 --- a/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCResetMetadataTask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/src/hotspot/share/gc/g1/g1FullGCScope.hpp b/src/hotspot/share/gc/g1/g1FullGCScope.hpp index ab5a48f3574..7a0d0a5395e 100644 --- a/src/hotspot/share/gc/g1/g1FullGCScope.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCScope.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp b/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp index 0c5f14ba3b2..7c715ebc0e6 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/gc/g1/g1IHOPControl.hpp b/src/hotspot/share/gc/g1/g1IHOPControl.hpp index b6e80d9b422..24061c026d1 100644 --- a/src/hotspot/share/gc/g1/g1IHOPControl.hpp +++ b/src/hotspot/share/gc/g1/g1IHOPControl.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/g1/g1MonitoringSupport.hpp b/src/hotspot/share/gc/g1/g1MonitoringSupport.hpp index 62c502d497c..31a39f2aca2 100644 --- a/src/hotspot/share/gc/g1/g1MonitoringSupport.hpp +++ b/src/hotspot/share/gc/g1/g1MonitoringSupport.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp index 15155c1d668..b7f33ccd564 100644 --- a/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp +++ b/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/gc/g1/g1ParallelCleaning.hpp b/src/hotspot/share/gc/g1/g1ParallelCleaning.hpp index 1a4e4601827..d8725cb110d 100644 --- a/src/hotspot/share/gc/g1/g1ParallelCleaning.hpp +++ b/src/hotspot/share/gc/g1/g1ParallelCleaning.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp b/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp index 61253c94ddd..3c1a6ed4667 100644 --- a/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp +++ b/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp index e2fc3d4fa04..e209cffdf0d 100644 --- a/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp +++ b/src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/gc/g1/g1RegionsOnNodes.hpp b/src/hotspot/share/gc/g1/g1RegionsOnNodes.hpp index 5b8d6479833..fb1f2381dba 100644 --- a/src/hotspot/share/gc/g1/g1RegionsOnNodes.hpp +++ b/src/hotspot/share/gc/g1/g1RegionsOnNodes.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/gc/g1/g1RootProcessor.hpp b/src/hotspot/share/gc/g1/g1RootProcessor.hpp index 27c92d730cf..95267dc3c46 100644 --- a/src/hotspot/share/gc/g1/g1RootProcessor.hpp +++ b/src/hotspot/share/gc/g1/g1RootProcessor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/g1/g1ServiceThread.hpp b/src/hotspot/share/gc/g1/g1ServiceThread.hpp index 4ed9c241562..ff58a5f26f2 100644 --- a/src/hotspot/share/gc/g1/g1ServiceThread.hpp +++ b/src/hotspot/share/gc/g1/g1ServiceThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/g1/g1SurvivorRegions.hpp b/src/hotspot/share/gc/g1/g1SurvivorRegions.hpp index 65c20dfbf45..4e4966f6797 100644 --- a/src/hotspot/share/gc/g1/g1SurvivorRegions.hpp +++ b/src/hotspot/share/gc/g1/g1SurvivorRegions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/g1/g1Trace.hpp b/src/hotspot/share/gc/g1/g1Trace.hpp index 1415828f376..a2e11ed4496 100644 --- a/src/hotspot/share/gc/g1/g1Trace.hpp +++ b/src/hotspot/share/gc/g1/g1Trace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/gc/g1/g1VMOperations.hpp b/src/hotspot/share/gc/g1/g1VMOperations.hpp index 0cc45163800..5429051496a 100644 --- a/src/hotspot/share/gc/g1/g1VMOperations.hpp +++ b/src/hotspot/share/gc/g1/g1VMOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/parallel/objectStartArray.hpp b/src/hotspot/share/gc/parallel/objectStartArray.hpp index 3453df4059e..fac7a4ce13a 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.hpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/parallel/parallel_globals.hpp b/src/hotspot/share/gc/parallel/parallel_globals.hpp index 22e495e7db4..64e2effdeae 100644 --- a/src/hotspot/share/gc/parallel/parallel_globals.hpp +++ b/src/hotspot/share/gc/parallel/parallel_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.hpp b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.hpp index 2b4bd2b6807..596ac231a97 100644 --- a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.hpp +++ b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.hpp index 0a404579da8..ee8ab3f7df0 100644 --- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp +++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp index 663cd83be9c..773b64d56a6 100644 --- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp +++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 diff --git a/src/hotspot/share/gc/parallel/psMemoryPool.hpp b/src/hotspot/share/gc/parallel/psMemoryPool.hpp index ed9793203d4..72687049ecc 100644 --- a/src/hotspot/share/gc/parallel/psMemoryPool.hpp +++ b/src/hotspot/share/gc/parallel/psMemoryPool.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 diff --git a/src/hotspot/share/gc/parallel/psOldGen.hpp b/src/hotspot/share/gc/parallel/psOldGen.hpp index 77ae5510b31..05359b12836 100644 --- a/src/hotspot/share/gc/parallel/psOldGen.hpp +++ b/src/hotspot/share/gc/parallel/psOldGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/parallel/psPromotionLAB.hpp b/src/hotspot/share/gc/parallel/psPromotionLAB.hpp index 60bd4ec250a..cf3ef0c90a3 100644 --- a/src/hotspot/share/gc/parallel/psPromotionLAB.hpp +++ b/src/hotspot/share/gc/parallel/psPromotionLAB.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/parallel/psPromotionManager.hpp b/src/hotspot/share/gc/parallel/psPromotionManager.hpp index 9808a55335d..44df708eea4 100644 --- a/src/hotspot/share/gc/parallel/psPromotionManager.hpp +++ b/src/hotspot/share/gc/parallel/psPromotionManager.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/parallel/psScavenge.hpp b/src/hotspot/share/gc/parallel/psScavenge.hpp index df97a1c1ede..e7db634c8e1 100644 --- a/src/hotspot/share/gc/parallel/psScavenge.hpp +++ b/src/hotspot/share/gc/parallel/psScavenge.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/parallel/psVMOperations.hpp b/src/hotspot/share/gc/parallel/psVMOperations.hpp index 1a542d59f8e..4c0908dfe14 100644 --- a/src/hotspot/share/gc/parallel/psVMOperations.hpp +++ b/src/hotspot/share/gc/parallel/psVMOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 diff --git a/src/hotspot/share/gc/parallel/psVirtualspace.hpp b/src/hotspot/share/gc/parallel/psVirtualspace.hpp index ca94f4d83b6..87ea86809f0 100644 --- a/src/hotspot/share/gc/parallel/psVirtualspace.hpp +++ b/src/hotspot/share/gc/parallel/psVirtualspace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/hotspot/share/gc/parallel/psYoungGen.hpp b/src/hotspot/share/gc/parallel/psYoungGen.hpp index 981b4a90874..98337d53184 100644 --- a/src/hotspot/share/gc/parallel/psYoungGen.hpp +++ b/src/hotspot/share/gc/parallel/psYoungGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/parallel/spaceCounters.hpp b/src/hotspot/share/gc/parallel/spaceCounters.hpp index b33aac386a6..86fc8438b23 100644 --- a/src/hotspot/share/gc/parallel/spaceCounters.hpp +++ b/src/hotspot/share/gc/parallel/spaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/parallel/vmStructs_parallelgc.hpp b/src/hotspot/share/gc/parallel/vmStructs_parallelgc.hpp index e45bd45400c..f69219a1f40 100644 --- a/src/hotspot/share/gc/parallel/vmStructs_parallelgc.hpp +++ b/src/hotspot/share/gc/parallel/vmStructs_parallelgc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 diff --git a/src/hotspot/share/gc/serial/cSpaceCounters.hpp b/src/hotspot/share/gc/serial/cSpaceCounters.hpp index 14c68e2b397..22a51cbbd20 100644 --- a/src/hotspot/share/gc/serial/cSpaceCounters.hpp +++ b/src/hotspot/share/gc/serial/cSpaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/serial/defNewGeneration.hpp b/src/hotspot/share/gc/serial/defNewGeneration.hpp index 40d2116cb58..e0c7b6bba37 100644 --- a/src/hotspot/share/gc/serial/defNewGeneration.hpp +++ b/src/hotspot/share/gc/serial/defNewGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/serial/serialVMOperations.hpp b/src/hotspot/share/gc/serial/serialVMOperations.hpp index 31f8c21e61a..9d4cac389e0 100644 --- a/src/hotspot/share/gc/serial/serialVMOperations.hpp +++ b/src/hotspot/share/gc/serial/serialVMOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/share/gc/serial/tenuredGeneration.hpp b/src/hotspot/share/gc/serial/tenuredGeneration.hpp index 038038f6808..ff73ab72b2c 100644 --- a/src/hotspot/share/gc/serial/tenuredGeneration.hpp +++ b/src/hotspot/share/gc/serial/tenuredGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/serial/tenuredGeneration.inline.hpp b/src/hotspot/share/gc/serial/tenuredGeneration.inline.hpp index 1c82566bdf4..db9733ce207 100644 --- a/src/hotspot/share/gc/serial/tenuredGeneration.inline.hpp +++ b/src/hotspot/share/gc/serial/tenuredGeneration.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp b/src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp index 89d419c28fa..280c406faa7 100644 --- a/src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp +++ b/src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 diff --git a/src/hotspot/share/gc/shared/barrierSet.hpp b/src/hotspot/share/gc/shared/barrierSet.hpp index 4edbb1a68a7..65e3b94c7f3 100644 --- a/src/hotspot/share/gc/shared/barrierSet.hpp +++ b/src/hotspot/share/gc/shared/barrierSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/share/gc/shared/barrierSetConfig.hpp b/src/hotspot/share/gc/shared/barrierSetConfig.hpp index 5a160f52c5a..412168cbb49 100644 --- a/src/hotspot/share/gc/shared/barrierSetConfig.hpp +++ b/src/hotspot/share/gc/shared/barrierSetConfig.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp b/src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp index 32a8719e21f..4bfa9406aab 100644 --- a/src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp +++ b/src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.hpp b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.hpp index 10e8311e764..deb775c8a47 100644 --- a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.hpp +++ b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp b/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp index 5c581da1252..faeb007c77d 100644 --- a/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp +++ b/src/hotspot/share/gc/shared/cardTableBarrierSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/share/gc/shared/collectedHeap.inline.hpp b/src/hotspot/share/gc/shared/collectedHeap.inline.hpp index 3900d1809ee..c9d84f54449 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.inline.hpp +++ b/src/hotspot/share/gc/shared/collectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/shared/collectorCounters.hpp b/src/hotspot/share/gc/shared/collectorCounters.hpp index 273f8fb2a4e..02b07cbf5c6 100644 --- a/src/hotspot/share/gc/shared/collectorCounters.hpp +++ b/src/hotspot/share/gc/shared/collectorCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/shared/gcArguments.hpp b/src/hotspot/share/gc/shared/gcArguments.hpp index d8a4901f887..7e9fffedaba 100644 --- a/src/hotspot/share/gc/shared/gcArguments.hpp +++ b/src/hotspot/share/gc/shared/gcArguments.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/share/gc/shared/gcCause.hpp b/src/hotspot/share/gc/shared/gcCause.hpp index aac4b801b74..c56833407ab 100644 --- a/src/hotspot/share/gc/shared/gcCause.hpp +++ b/src/hotspot/share/gc/shared/gcCause.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/shared/gcHeapSummary.hpp b/src/hotspot/share/gc/shared/gcHeapSummary.hpp index ae08f60d3a6..4d209d01afb 100644 --- a/src/hotspot/share/gc/shared/gcHeapSummary.hpp +++ b/src/hotspot/share/gc/shared/gcHeapSummary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/gc/shared/gcLocker.hpp b/src/hotspot/share/gc/shared/gcLocker.hpp index 33d10f0eecd..c0e28b66539 100644 --- a/src/hotspot/share/gc/shared/gcLocker.hpp +++ b/src/hotspot/share/gc/shared/gcLocker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/gc/shared/gcLogPrecious.hpp b/src/hotspot/share/gc/shared/gcLogPrecious.hpp index 8aa70252b3d..127a30f6b34 100644 --- a/src/hotspot/share/gc/shared/gcLogPrecious.hpp +++ b/src/hotspot/share/gc/shared/gcLogPrecious.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/gc/shared/gcPolicyCounters.hpp b/src/hotspot/share/gc/shared/gcPolicyCounters.hpp index e2ddb537f6e..b21967cd88b 100644 --- a/src/hotspot/share/gc/shared/gcPolicyCounters.hpp +++ b/src/hotspot/share/gc/shared/gcPolicyCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/gc/shared/gcThreadLocalData.hpp b/src/hotspot/share/gc/shared/gcThreadLocalData.hpp index 2632e806bab..2847cd8bf33 100644 --- a/src/hotspot/share/gc/shared/gcThreadLocalData.hpp +++ b/src/hotspot/share/gc/shared/gcThreadLocalData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/shared/gcTrace.hpp b/src/hotspot/share/gc/shared/gcTrace.hpp index 6a47e54090f..def4ea8f3de 100644 --- a/src/hotspot/share/gc/shared/gcTrace.hpp +++ b/src/hotspot/share/gc/shared/gcTrace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/gc/shared/gcVMOperations.hpp b/src/hotspot/share/gc/shared/gcVMOperations.hpp index a9aee2faf5d..5d4594e3d5c 100644 --- a/src/hotspot/share/gc/shared/gcVMOperations.hpp +++ b/src/hotspot/share/gc/shared/gcVMOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/hotspot/share/gc/shared/genArguments.hpp b/src/hotspot/share/gc/shared/genArguments.hpp index 0ff9568575d..088ee48f291 100644 --- a/src/hotspot/share/gc/shared/genArguments.hpp +++ b/src/hotspot/share/gc/shared/genArguments.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/shared/hSpaceCounters.hpp b/src/hotspot/share/gc/shared/hSpaceCounters.hpp index b55b24f7601..b9a6011bd65 100644 --- a/src/hotspot/share/gc/shared/hSpaceCounters.hpp +++ b/src/hotspot/share/gc/shared/hSpaceCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/gc/shared/oopStorage.hpp b/src/hotspot/share/gc/shared/oopStorage.hpp index 6097eeaa4f4..914c827f8ac 100644 --- a/src/hotspot/share/gc/shared/oopStorage.hpp +++ b/src/hotspot/share/gc/shared/oopStorage.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/shared/parallelCleaning.hpp b/src/hotspot/share/gc/shared/parallelCleaning.hpp index e1b07f5778d..ed76c4c9df9 100644 --- a/src/hotspot/share/gc/shared/parallelCleaning.hpp +++ b/src/hotspot/share/gc/shared/parallelCleaning.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/shared/partialArraySplitter.hpp b/src/hotspot/share/gc/shared/partialArraySplitter.hpp index 8608f993f8d..87cc137e797 100644 --- a/src/hotspot/share/gc/shared/partialArraySplitter.hpp +++ b/src/hotspot/share/gc/shared/partialArraySplitter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/share/gc/shared/referenceProcessor.hpp b/src/hotspot/share/gc/shared/referenceProcessor.hpp index a29ee7fca86..b211b94a85d 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/gc/shared/scavengableNMethods.hpp b/src/hotspot/share/gc/shared/scavengableNMethods.hpp index 00db556577e..5e24d97a379 100644 --- a/src/hotspot/share/gc/shared/scavengableNMethods.hpp +++ b/src/hotspot/share/gc/shared/scavengableNMethods.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp b/src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp index 24d17d7d45b..e9e4622568a 100644 --- a/src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp +++ b/src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.hpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.hpp index fb864ab34ab..81b5863b72f 100644 --- a/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.hpp +++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupStat.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.hpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.hpp index b1feb1b4ca9..60d73a461d6 100644 --- a/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.hpp +++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp index 59979646395..8267a103539 100644 --- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp +++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/gc/shared/vmStructs_gc.hpp b/src/hotspot/share/gc/shared/vmStructs_gc.hpp index 3a644079875..db968e28f67 100644 --- a/src/hotspot/share/gc/shared/vmStructs_gc.hpp +++ b/src/hotspot/share/gc/shared/vmStructs_gc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp index be11a364ab7..14adb924585 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2021, Red Hat, Inc. and/or its affiliates. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index 96ebf23bbb5..15520c47bbc 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2021, Red Hat, Inc. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/src/hotspot/share/gc/z/zArguments.hpp b/src/hotspot/share/gc/z/zArguments.hpp index 8bbd88f357c..eab2d22ac63 100644 --- a/src/hotspot/share/gc/z/zArguments.hpp +++ b/src/hotspot/share/gc/z/zArguments.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/gc/z/zBarrier.hpp b/src/hotspot/share/gc/z/zBarrier.hpp index 3071061c997..17dcfcd06dc 100644 --- a/src/hotspot/share/gc/z/zBarrier.hpp +++ b/src/hotspot/share/gc/z/zBarrier.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/z/zBarrierSet.hpp b/src/hotspot/share/gc/z/zBarrierSet.hpp index 8764c66d900..074d0e859fd 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.hpp +++ b/src/hotspot/share/gc/z/zBarrierSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/z/zBarrierSetNMethod.hpp b/src/hotspot/share/gc/z/zBarrierSetNMethod.hpp index f51aa53a7e9..c7bbe35e17d 100644 --- a/src/hotspot/share/gc/z/zBarrierSetNMethod.hpp +++ b/src/hotspot/share/gc/z/zBarrierSetNMethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/z/zGeneration.hpp b/src/hotspot/share/gc/z/zGeneration.hpp index 7ce096de6db..3b700361460 100644 --- a/src/hotspot/share/gc/z/zGeneration.hpp +++ b/src/hotspot/share/gc/z/zGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/gc/z/zGlobals.hpp b/src/hotspot/share/gc/z/zGlobals.hpp index 8c4f0d0c015..278b6480d1d 100644 --- a/src/hotspot/share/gc/z/zGlobals.hpp +++ b/src/hotspot/share/gc/z/zGlobals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/z/zHeapIterator.hpp b/src/hotspot/share/gc/z/zHeapIterator.hpp index 2b570e98f1c..3ebc7965ad7 100644 --- a/src/hotspot/share/gc/z/zHeapIterator.hpp +++ b/src/hotspot/share/gc/z/zHeapIterator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/gc/z/zMark.hpp b/src/hotspot/share/gc/z/zMark.hpp index 07e73849af6..cc398addeb8 100644 --- a/src/hotspot/share/gc/z/zMark.hpp +++ b/src/hotspot/share/gc/z/zMark.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/z/zMark.inline.hpp b/src/hotspot/share/gc/z/zMark.inline.hpp index 26c84679cc0..c174a7594a4 100644 --- a/src/hotspot/share/gc/z/zMark.inline.hpp +++ b/src/hotspot/share/gc/z/zMark.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/z/zMarkContext.hpp b/src/hotspot/share/gc/z/zMarkContext.hpp index 12f56c2f7a5..e79e5e317e3 100644 --- a/src/hotspot/share/gc/z/zMarkContext.hpp +++ b/src/hotspot/share/gc/z/zMarkContext.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/gc/z/zMarkContext.inline.hpp b/src/hotspot/share/gc/z/zMarkContext.inline.hpp index 7273a87a8c6..1609f73f3a0 100644 --- a/src/hotspot/share/gc/z/zMarkContext.inline.hpp +++ b/src/hotspot/share/gc/z/zMarkContext.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/gc/z/zNMethod.hpp b/src/hotspot/share/gc/z/zNMethod.hpp index 5d797f3fd55..865ea11e7b9 100644 --- a/src/hotspot/share/gc/z/zNMethod.hpp +++ b/src/hotspot/share/gc/z/zNMethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/gc/z/zNMethodTableIteration.hpp b/src/hotspot/share/gc/z/zNMethodTableIteration.hpp index 34bd7d9b4f8..064c3eafca0 100644 --- a/src/hotspot/share/gc/z/zNMethodTableIteration.hpp +++ b/src/hotspot/share/gc/z/zNMethodTableIteration.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/gc/z/zPageTable.hpp b/src/hotspot/share/gc/z/zPageTable.hpp index fadf550d996..350c518e77a 100644 --- a/src/hotspot/share/gc/z/zPageTable.hpp +++ b/src/hotspot/share/gc/z/zPageTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/z/zRemembered.hpp b/src/hotspot/share/gc/z/zRemembered.hpp index 6cc76f5dc26..b571d34d590 100644 --- a/src/hotspot/share/gc/z/zRemembered.hpp +++ b/src/hotspot/share/gc/z/zRemembered.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/gc/z/zStat.hpp b/src/hotspot/share/gc/z/zStat.hpp index 0078c963626..739c3cd5980 100644 --- a/src/hotspot/share/gc/z/zStat.hpp +++ b/src/hotspot/share/gc/z/zStat.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/gc/z/zThreadLocalData.hpp b/src/hotspot/share/gc/z/zThreadLocalData.hpp index 111a64e978e..a141fd8f83a 100644 --- a/src/hotspot/share/gc/z/zThreadLocalData.hpp +++ b/src/hotspot/share/gc/z/zThreadLocalData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/gc/z/zUncoloredRoot.hpp b/src/hotspot/share/gc/z/zUncoloredRoot.hpp index c007176e5c2..040b68673ba 100644 --- a/src/hotspot/share/gc/z/zUncoloredRoot.hpp +++ b/src/hotspot/share/gc/z/zUncoloredRoot.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/include/jmm.h b/src/hotspot/share/include/jmm.h index ee1462fe5a8..96139cc43b2 100644 --- a/src/hotspot/share/include/jmm.h +++ b/src/hotspot/share/include/jmm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/hotspot/share/include/jvm_io.h b/src/hotspot/share/include/jvm_io.h index 5233798b5a8..06c5f87952f 100644 --- a/src/hotspot/share/include/jvm_io.h +++ b/src/hotspot/share/include/jvm_io.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/interpreter/bytecode.hpp b/src/hotspot/share/interpreter/bytecode.hpp index de83cfe5d71..9d56da9f567 100644 --- a/src/hotspot/share/interpreter/bytecode.hpp +++ b/src/hotspot/share/interpreter/bytecode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/bytecode.inline.hpp b/src/hotspot/share/interpreter/bytecode.inline.hpp index 139f477d397..18e38809c96 100644 --- a/src/hotspot/share/interpreter/bytecode.inline.hpp +++ b/src/hotspot/share/interpreter/bytecode.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/interpreter/bytecodeHistogram.hpp b/src/hotspot/share/interpreter/bytecodeHistogram.hpp index dfa712f9f04..96274f2bf0c 100644 --- a/src/hotspot/share/interpreter/bytecodeHistogram.hpp +++ b/src/hotspot/share/interpreter/bytecodeHistogram.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/bytecodeStream.hpp b/src/hotspot/share/interpreter/bytecodeStream.hpp index 412951691c5..a6af350a24e 100644 --- a/src/hotspot/share/interpreter/bytecodeStream.hpp +++ b/src/hotspot/share/interpreter/bytecodeStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/bytecodeTracer.hpp b/src/hotspot/share/interpreter/bytecodeTracer.hpp index e7d7a360948..b32e55abbcf 100644 --- a/src/hotspot/share/interpreter/bytecodeTracer.hpp +++ b/src/hotspot/share/interpreter/bytecodeTracer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/interpreter.hpp b/src/hotspot/share/interpreter/interpreter.hpp index 800429913fd..576146b344e 100644 --- a/src/hotspot/share/interpreter/interpreter.hpp +++ b/src/hotspot/share/interpreter/interpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/interpreterRuntime.hpp b/src/hotspot/share/interpreter/interpreterRuntime.hpp index f553debcd75..70ceeb0b2af 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.hpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/linkResolver.hpp b/src/hotspot/share/interpreter/linkResolver.hpp index 4d28e712c5f..6308e0e09ad 100644 --- a/src/hotspot/share/interpreter/linkResolver.hpp +++ b/src/hotspot/share/interpreter/linkResolver.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/templateInterpreter.hpp b/src/hotspot/share/interpreter/templateInterpreter.hpp index fd6888ffab8..0b37412737e 100644 --- a/src/hotspot/share/interpreter/templateInterpreter.hpp +++ b/src/hotspot/share/interpreter/templateInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp b/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp index 07a7ca6169d..44fd99f79bf 100644 --- a/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp +++ b/src/hotspot/share/interpreter/templateInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp index 0032109982a..65d4ebebfe7 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.inline.hpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.inline.hpp index effee05c2f1..f51a26d24bf 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.inline.hpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/interpreter/zero/zeroInterpreter.hpp b/src/hotspot/share/interpreter/zero/zeroInterpreter.hpp index 79528de639b..a98a4c8caed 100644 --- a/src/hotspot/share/interpreter/zero/zeroInterpreter.hpp +++ b/src/hotspot/share/interpreter/zero/zeroInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.hpp b/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.hpp index f8db4a07e9a..d8dbd706905 100644 --- a/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.hpp +++ b/src/hotspot/share/interpreter/zero/zeroInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp b/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp index 5f630589257..98364690422 100644 --- a/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp +++ b/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.hpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.hpp index 18cee5de7f2..a0c48b3bb5d 100644 --- a/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.hpp +++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.hpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.hpp index 3965d0c0ff7..984d0ac6ef2 100644 --- a/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.hpp +++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp index 63e251d3b67..bff310784c2 100644 --- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp +++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp b/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp index 66ed9145c81..736ddcad48b 100644 --- a/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp +++ b/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/jfr/metadata/jfrSerializer.hpp b/src/hotspot/share/jfr/metadata/jfrSerializer.hpp index 34ea94acbe8..4e339991e6e 100644 --- a/src/hotspot/share/jfr/metadata/jfrSerializer.hpp +++ b/src/hotspot/share/jfr/metadata/jfrSerializer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jfr/recorder/jfrEventSetting.hpp b/src/hotspot/share/jfr/recorder/jfrEventSetting.hpp index 3b2888bf505..68a76e89ae3 100644 --- a/src/hotspot/share/jfr/recorder/jfrEventSetting.hpp +++ b/src/hotspot/share/jfr/recorder/jfrEventSetting.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.hpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.hpp index a3564506924..cc75d974acb 100644 --- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.hpp +++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackFilterRegistry.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.hpp b/src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.hpp index 690a5730804..c89fb46f5e5 100644 --- a/src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.hpp +++ b/src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.hpp b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.hpp index 5fc41550b66..0853060b913 100644 --- a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.hpp +++ b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.hpp b/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.hpp index 85a7ba51732..7f31be3cddf 100644 --- a/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.hpp +++ b/src/hotspot/share/jfr/support/jfrDeprecationEventWriter.hpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2023, 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 diff --git a/src/hotspot/share/jfr/support/jfrDeprecationManager.hpp b/src/hotspot/share/jfr/support/jfrDeprecationManager.hpp index 86fe3cd35df..093d94bcd6e 100644 --- a/src/hotspot/share/jfr/support/jfrDeprecationManager.hpp +++ b/src/hotspot/share/jfr/support/jfrDeprecationManager.hpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2023, 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 diff --git a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp index cb63d7e1e29..447a7e84f5c 100644 --- a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp +++ b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.hpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2020, 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 diff --git a/src/hotspot/share/jfr/support/jfrStackTraceMark.hpp b/src/hotspot/share/jfr/support/jfrStackTraceMark.hpp index 1429c48a278..2815d9f0594 100644 --- a/src/hotspot/share/jfr/support/jfrStackTraceMark.hpp +++ b/src/hotspot/share/jfr/support/jfrStackTraceMark.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp b/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp index cf849a7654c..da19080d371 100644 --- a/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp +++ b/src/hotspot/share/jfr/utilities/jfrBigEndian.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp b/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp index 814f15017e0..86b0df60155 100644 --- a/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp +++ b/src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jfr/utilities/jfrEpochQueue.inline.hpp b/src/hotspot/share/jfr/utilities/jfrEpochQueue.inline.hpp index 553d61582c0..28d02f89a26 100644 --- a/src/hotspot/share/jfr/utilities/jfrEpochQueue.inline.hpp +++ b/src/hotspot/share/jfr/utilities/jfrEpochQueue.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/jfr/utilities/jfrRelation.hpp b/src/hotspot/share/jfr/utilities/jfrRelation.hpp index 9c7dce3d451..455f55c7509 100644 --- a/src/hotspot/share/jfr/utilities/jfrRelation.hpp +++ b/src/hotspot/share/jfr/utilities/jfrRelation.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.hpp b/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.hpp index af87f2bc5fb..295901ff567 100644 --- a/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.hpp +++ b/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.inline.hpp b/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.inline.hpp index ad16b7abde3..2381ecc5741 100644 --- a/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.inline.hpp +++ b/src/hotspot/share/jfr/writers/jfrMemoryWriterHost.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp b/src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp index 83451148c70..c032d0c320b 100644 --- a/src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp +++ b/src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/hotspot/share/jvmci/jvmci.hpp b/src/hotspot/share/jvmci/jvmci.hpp index 196007fc7dd..02609fb6bb9 100644 --- a/src/hotspot/share/jvmci/jvmci.hpp +++ b/src/hotspot/share/jvmci/jvmci.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/jvmci/jvmciEnv.hpp b/src/hotspot/share/jvmci/jvmciEnv.hpp index fbe5be88c3f..82d9fe1d56c 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.hpp +++ b/src/hotspot/share/jvmci/jvmciEnv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/jvmci/jvmci_globals.hpp b/src/hotspot/share/jvmci/jvmci_globals.hpp index 05bc9a134c7..730d223e74e 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.hpp +++ b/src/hotspot/share/jvmci/jvmci_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/share/jvmci/vmSymbols_jvmci.hpp b/src/hotspot/share/jvmci/vmSymbols_jvmci.hpp index de965da0f80..5948951ecd7 100644 --- a/src/hotspot/share/jvmci/vmSymbols_jvmci.hpp +++ b/src/hotspot/share/jvmci/vmSymbols_jvmci.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/hotspot/share/libadt/vectset.hpp b/src/hotspot/share/libadt/vectset.hpp index 7dbe70000c7..5cbae2f59a3 100644 --- a/src/hotspot/share/libadt/vectset.hpp +++ b/src/hotspot/share/libadt/vectset.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/logging/log.hpp b/src/hotspot/share/logging/log.hpp index 7820e2c21d1..e2541f34662 100644 --- a/src/hotspot/share/logging/log.hpp +++ b/src/hotspot/share/logging/log.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/logging/logConfiguration.hpp b/src/hotspot/share/logging/logConfiguration.hpp index 6e84199fdde..ed8a7e35adb 100644 --- a/src/hotspot/share/logging/logConfiguration.hpp +++ b/src/hotspot/share/logging/logConfiguration.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/logging/logDecorators.hpp b/src/hotspot/share/logging/logDecorators.hpp index 5b245626ade..fff145729e4 100644 --- a/src/hotspot/share/logging/logDecorators.hpp +++ b/src/hotspot/share/logging/logDecorators.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/memory/heapInspection.hpp b/src/hotspot/share/memory/heapInspection.hpp index 58e91217a32..51498d926ec 100644 --- a/src/hotspot/share/memory/heapInspection.hpp +++ b/src/hotspot/share/memory/heapInspection.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/hotspot/share/memory/iterator.hpp b/src/hotspot/share/memory/iterator.hpp index 25820d6de02..1a639d153fe 100644 --- a/src/hotspot/share/memory/iterator.hpp +++ b/src/hotspot/share/memory/iterator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/memory/memoryReserver.hpp b/src/hotspot/share/memory/memoryReserver.hpp index fd052e5e283..9ef12650b55 100644 --- a/src/hotspot/share/memory/memoryReserver.hpp +++ b/src/hotspot/share/memory/memoryReserver.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/memory/metaspace/metablock.inline.hpp b/src/hotspot/share/memory/metaspace/metablock.inline.hpp index 87dceceeb74..23d5ecc1bec 100644 --- a/src/hotspot/share/memory/metaspace/metablock.inline.hpp +++ b/src/hotspot/share/memory/metaspace/metablock.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2023 Red Hat, Inc. All rights reserved. - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/src/hotspot/share/memory/resourceArea.inline.hpp b/src/hotspot/share/memory/resourceArea.inline.hpp index cd8890c228d..60afc6acd53 100644 --- a/src/hotspot/share/memory/resourceArea.inline.hpp +++ b/src/hotspot/share/memory/resourceArea.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/nmt/mallocHeader.hpp b/src/hotspot/share/nmt/mallocHeader.hpp index acfc7401268..45568243ef3 100644 --- a/src/hotspot/share/nmt/mallocHeader.hpp +++ b/src/hotspot/share/nmt/mallocHeader.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/share/nmt/mallocHeader.inline.hpp b/src/hotspot/share/nmt/mallocHeader.inline.hpp index 7bc8a25028c..0ad0b3ddc81 100644 --- a/src/hotspot/share/nmt/mallocHeader.inline.hpp +++ b/src/hotspot/share/nmt/mallocHeader.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/share/nmt/nativeCallStackPrinter.hpp b/src/hotspot/share/nmt/nativeCallStackPrinter.hpp index 12bd1176485..79bbd4d16d2 100644 --- a/src/hotspot/share/nmt/nativeCallStackPrinter.hpp +++ b/src/hotspot/share/nmt/nativeCallStackPrinter.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2024, Red Hat, Inc. All rights reserved. - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/share/oops/access.hpp b/src/hotspot/share/oops/access.hpp index f10682fdf42..8430e960a27 100644 --- a/src/hotspot/share/oops/access.hpp +++ b/src/hotspot/share/oops/access.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/oops/access.inline.hpp b/src/hotspot/share/oops/access.inline.hpp index b71ed4460fc..fccdfd60862 100644 --- a/src/hotspot/share/oops/access.inline.hpp +++ b/src/hotspot/share/oops/access.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 diff --git a/src/hotspot/share/oops/instanceClassLoaderKlass.hpp b/src/hotspot/share/oops/instanceClassLoaderKlass.hpp index f6aedc312aa..d13bedcc076 100644 --- a/src/hotspot/share/oops/instanceClassLoaderKlass.hpp +++ b/src/hotspot/share/oops/instanceClassLoaderKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/oops/instanceMirrorKlass.hpp b/src/hotspot/share/oops/instanceMirrorKlass.hpp index a89e573503d..0768d383d68 100644 --- a/src/hotspot/share/oops/instanceMirrorKlass.hpp +++ b/src/hotspot/share/oops/instanceMirrorKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/oops/instanceRefKlass.hpp b/src/hotspot/share/oops/instanceRefKlass.hpp index 57126156dd8..fc219d06739 100644 --- a/src/hotspot/share/oops/instanceRefKlass.hpp +++ b/src/hotspot/share/oops/instanceRefKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/oops/instanceStackChunkKlass.hpp b/src/hotspot/share/oops/instanceStackChunkKlass.hpp index 5afbc5d00eb..c2da94cef79 100644 --- a/src/hotspot/share/oops/instanceStackChunkKlass.hpp +++ b/src/hotspot/share/oops/instanceStackChunkKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/oops/metadata.hpp b/src/hotspot/share/oops/metadata.hpp index 5a890a27fa1..d88bd9d087d 100644 --- a/src/hotspot/share/oops/metadata.hpp +++ b/src/hotspot/share/oops/metadata.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/oops/oopCast.inline.hpp b/src/hotspot/share/oops/oopCast.inline.hpp index 1b21b3fd4e7..ecc0f1c173d 100644 --- a/src/hotspot/share/oops/oopCast.inline.hpp +++ b/src/hotspot/share/oops/oopCast.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/oops/oopHandle.inline.hpp b/src/hotspot/share/oops/oopHandle.inline.hpp index 343d677ab04..2080a8984ab 100644 --- a/src/hotspot/share/oops/oopHandle.inline.hpp +++ b/src/hotspot/share/oops/oopHandle.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/oops/stackChunkOop.hpp b/src/hotspot/share/oops/stackChunkOop.hpp index 79944f0326e..55ed9ee237c 100644 --- a/src/hotspot/share/oops/stackChunkOop.hpp +++ b/src/hotspot/share/oops/stackChunkOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/oops/weakHandle.inline.hpp b/src/hotspot/share/oops/weakHandle.inline.hpp index 30bdac5a74e..a6e24c19f58 100644 --- a/src/hotspot/share/oops/weakHandle.inline.hpp +++ b/src/hotspot/share/oops/weakHandle.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/src/hotspot/share/opto/callGenerator.hpp b/src/hotspot/share/opto/callGenerator.hpp index e24ea5e5356..75ba6f709c0 100644 --- a/src/hotspot/share/opto/callGenerator.hpp +++ b/src/hotspot/share/opto/callGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 diff --git a/src/hotspot/share/opto/countbitsnode.hpp b/src/hotspot/share/opto/countbitsnode.hpp index 35465b1835b..9e08ab71013 100644 --- a/src/hotspot/share/opto/countbitsnode.hpp +++ b/src/hotspot/share/opto/countbitsnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/opto/escape.hpp b/src/hotspot/share/opto/escape.hpp index eea6403acdd..04a9dc82982 100644 --- a/src/hotspot/share/opto/escape.hpp +++ b/src/hotspot/share/opto/escape.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/hotspot/share/opto/graphKit.hpp b/src/hotspot/share/opto/graphKit.hpp index 806a211d7e2..56e9a949e6f 100644 --- a/src/hotspot/share/opto/graphKit.hpp +++ b/src/hotspot/share/opto/graphKit.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/opto/idealKit.hpp b/src/hotspot/share/opto/idealKit.hpp index fe07716dcff..280f61fd9a9 100644 --- a/src/hotspot/share/opto/idealKit.hpp +++ b/src/hotspot/share/opto/idealKit.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 diff --git a/src/hotspot/share/opto/indexSet.hpp b/src/hotspot/share/opto/indexSet.hpp index f628bade3fa..1d0aab0142a 100644 --- a/src/hotspot/share/opto/indexSet.hpp +++ b/src/hotspot/share/opto/indexSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 diff --git a/src/hotspot/share/opto/intrinsicnode.hpp b/src/hotspot/share/opto/intrinsicnode.hpp index df34e363259..2672402881e 100644 --- a/src/hotspot/share/opto/intrinsicnode.hpp +++ b/src/hotspot/share/opto/intrinsicnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/hotspot/share/opto/multnode.hpp b/src/hotspot/share/opto/multnode.hpp index 692b69118c9..20ab59aeabc 100644 --- a/src/hotspot/share/opto/multnode.hpp +++ b/src/hotspot/share/opto/multnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/opto/stringopts.hpp b/src/hotspot/share/opto/stringopts.hpp index 21be4109c7d..b893ac8c278 100644 --- a/src/hotspot/share/opto/stringopts.hpp +++ b/src/hotspot/share/opto/stringopts.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 diff --git a/src/hotspot/share/opto/superwordVTransformBuilder.hpp b/src/hotspot/share/opto/superwordVTransformBuilder.hpp index cc9dd225f01..3c5d31cc9c2 100644 --- a/src/hotspot/share/opto/superwordVTransformBuilder.hpp +++ b/src/hotspot/share/opto/superwordVTransformBuilder.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/hotspot/share/prims/foreignGlobals.inline.hpp b/src/hotspot/share/prims/foreignGlobals.inline.hpp index f5c79997764..d983aca11cc 100644 --- a/src/hotspot/share/prims/foreignGlobals.inline.hpp +++ b/src/hotspot/share/prims/foreignGlobals.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/prims/jvmtiAgent.hpp b/src/hotspot/share/prims/jvmtiAgent.hpp index b2e312c8030..f3873ff9559 100644 --- a/src/hotspot/share/prims/jvmtiAgent.hpp +++ b/src/hotspot/share/prims/jvmtiAgent.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/src/hotspot/share/prims/jvmtiEventController.inline.hpp b/src/hotspot/share/prims/jvmtiEventController.inline.hpp index c5dbdcc5f8e..8c00df99838 100644 --- a/src/hotspot/share/prims/jvmtiEventController.inline.hpp +++ b/src/hotspot/share/prims/jvmtiEventController.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/hotspot/share/prims/jvmtiImpl.hpp b/src/hotspot/share/prims/jvmtiImpl.hpp index c359b2fcbc3..0fd63556a78 100644 --- a/src/hotspot/share/prims/jvmtiImpl.hpp +++ b/src/hotspot/share/prims/jvmtiImpl.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 diff --git a/src/hotspot/share/prims/jvmtiTagMapTable.hpp b/src/hotspot/share/prims/jvmtiTagMapTable.hpp index f717552da2b..e408d9dac86 100644 --- a/src/hotspot/share/prims/jvmtiTagMapTable.hpp +++ b/src/hotspot/share/prims/jvmtiTagMapTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/prims/jvmtiThreadState.inline.hpp b/src/hotspot/share/prims/jvmtiThreadState.inline.hpp index 5f9aa842d15..2b060f1a2e4 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.inline.hpp +++ b/src/hotspot/share/prims/jvmtiThreadState.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 diff --git a/src/hotspot/share/prims/methodHandles.hpp b/src/hotspot/share/prims/methodHandles.hpp index 1a419cbb53d..73da28a6cf5 100644 --- a/src/hotspot/share/prims/methodHandles.hpp +++ b/src/hotspot/share/prims/methodHandles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 diff --git a/src/hotspot/share/prims/vectorSupport.hpp b/src/hotspot/share/prims/vectorSupport.hpp index 9ec6500543c..5dd06f31b16 100644 --- a/src/hotspot/share/prims/vectorSupport.hpp +++ b/src/hotspot/share/prims/vectorSupport.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/prims/vmstorage.hpp b/src/hotspot/share/prims/vmstorage.hpp index f605dc28a9f..ea9aa3c5423 100644 --- a/src/hotspot/share/prims/vmstorage.hpp +++ b/src/hotspot/share/prims/vmstorage.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/runtime/continuationHelper.inline.hpp b/src/hotspot/share/runtime/continuationHelper.inline.hpp index 9aadfd8a388..7bbdbd4935d 100644 --- a/src/hotspot/share/runtime/continuationHelper.inline.hpp +++ b/src/hotspot/share/runtime/continuationHelper.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/runtime/continuationJavaClasses.hpp b/src/hotspot/share/runtime/continuationJavaClasses.hpp index 91224b94e1e..8397c7c1493 100644 --- a/src/hotspot/share/runtime/continuationJavaClasses.hpp +++ b/src/hotspot/share/runtime/continuationJavaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/runtime/continuationWrapper.inline.hpp b/src/hotspot/share/runtime/continuationWrapper.inline.hpp index ddf5e0be02d..1f9226f8bd3 100644 --- a/src/hotspot/share/runtime/continuationWrapper.inline.hpp +++ b/src/hotspot/share/runtime/continuationWrapper.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/runtime/flags/flagSetting.hpp b/src/hotspot/share/runtime/flags/flagSetting.hpp index 0f75636621a..f4e20a951d9 100644 --- a/src/hotspot/share/runtime/flags/flagSetting.hpp +++ b/src/hotspot/share/runtime/flags/flagSetting.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp b/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp index 256f674f19c..6459aed60e6 100644 --- a/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp +++ b/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/runtime/handles.hpp b/src/hotspot/share/runtime/handles.hpp index 7b51b4aff1c..68c948a493b 100644 --- a/src/hotspot/share/runtime/handles.hpp +++ b/src/hotspot/share/runtime/handles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/handles.inline.hpp b/src/hotspot/share/runtime/handles.inline.hpp index 15b06315823..4e1e2ed8686 100644 --- a/src/hotspot/share/runtime/handles.inline.hpp +++ b/src/hotspot/share/runtime/handles.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 diff --git a/src/hotspot/share/runtime/icache.hpp b/src/hotspot/share/runtime/icache.hpp index e442c4d88e0..bc153862323 100644 --- a/src/hotspot/share/runtime/icache.hpp +++ b/src/hotspot/share/runtime/icache.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/interfaceSupport.inline.hpp b/src/hotspot/share/runtime/interfaceSupport.inline.hpp index c52c2664faa..ecd7397d81a 100644 --- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp +++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Azul Systems, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/share/runtime/java.hpp b/src/hotspot/share/runtime/java.hpp index f7f1fb5e892..2eb8d6b8ead 100644 --- a/src/hotspot/share/runtime/java.hpp +++ b/src/hotspot/share/runtime/java.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/jfieldIDWorkaround.hpp b/src/hotspot/share/runtime/jfieldIDWorkaround.hpp index 68db2e36d45..fcca5bc244c 100644 --- a/src/hotspot/share/runtime/jfieldIDWorkaround.hpp +++ b/src/hotspot/share/runtime/jfieldIDWorkaround.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/hotspot/share/runtime/monitorDeflationThread.hpp b/src/hotspot/share/runtime/monitorDeflationThread.hpp index 6b681617a4c..29fb5394c6f 100644 --- a/src/hotspot/share/runtime/monitorDeflationThread.hpp +++ b/src/hotspot/share/runtime/monitorDeflationThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/runtime/notificationThread.hpp b/src/hotspot/share/runtime/notificationThread.hpp index e8e72052e4a..b516a147828 100644 --- a/src/hotspot/share/runtime/notificationThread.hpp +++ b/src/hotspot/share/runtime/notificationThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/runtime/park.hpp b/src/hotspot/share/runtime/park.hpp index f353ce34b74..4406a66da0d 100644 --- a/src/hotspot/share/runtime/park.hpp +++ b/src/hotspot/share/runtime/park.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/perfDataTypes.hpp b/src/hotspot/share/runtime/perfDataTypes.hpp index 9928975b8e2..c6ea228bdf1 100644 --- a/src/hotspot/share/runtime/perfDataTypes.hpp +++ b/src/hotspot/share/runtime/perfDataTypes.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/runtime/safefetch.hpp b/src/hotspot/share/runtime/safefetch.hpp index a1781962ec0..43872c781b4 100644 --- a/src/hotspot/share/runtime/safefetch.hpp +++ b/src/hotspot/share/runtime/safefetch.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/hotspot/share/runtime/safepoint.hpp b/src/hotspot/share/runtime/safepoint.hpp index 190095ec30b..c6f3a5cad2c 100644 --- a/src/hotspot/share/runtime/safepoint.hpp +++ b/src/hotspot/share/runtime/safepoint.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/safepointVerifiers.hpp b/src/hotspot/share/runtime/safepointVerifiers.hpp index 8d309a973d8..f652b6e4803 100644 --- a/src/hotspot/share/runtime/safepointVerifiers.hpp +++ b/src/hotspot/share/runtime/safepointVerifiers.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/signature.cpp b/src/hotspot/share/runtime/signature.cpp index 9ae5b3df415..044319d1752 100644 --- a/src/hotspot/share/runtime/signature.cpp +++ b/src/hotspot/share/runtime/signature.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/smallRegisterMap.inline.hpp b/src/hotspot/share/runtime/smallRegisterMap.inline.hpp index 09febdaf450..f3923c01c2f 100644 --- a/src/hotspot/share/runtime/smallRegisterMap.inline.hpp +++ b/src/hotspot/share/runtime/smallRegisterMap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/runtime/stackChunkFrameStream.hpp b/src/hotspot/share/runtime/stackChunkFrameStream.hpp index cb46254d125..921e44f3a3a 100644 --- a/src/hotspot/share/runtime/stackChunkFrameStream.hpp +++ b/src/hotspot/share/runtime/stackChunkFrameStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/runtime/stackChunkFrameStream.inline.hpp b/src/hotspot/share/runtime/stackChunkFrameStream.inline.hpp index 97166950752..e3696d03b4c 100644 --- a/src/hotspot/share/runtime/stackChunkFrameStream.inline.hpp +++ b/src/hotspot/share/runtime/stackChunkFrameStream.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/runtime/stackWatermark.hpp b/src/hotspot/share/runtime/stackWatermark.hpp index 4f1c65c903c..4cb30a26db5 100644 --- a/src/hotspot/share/runtime/stackWatermark.hpp +++ b/src/hotspot/share/runtime/stackWatermark.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/src/hotspot/share/runtime/threadIdentifier.hpp b/src/hotspot/share/runtime/threadIdentifier.hpp index 70e11713841..69956538969 100644 --- a/src/hotspot/share/runtime/threadIdentifier.hpp +++ b/src/hotspot/share/runtime/threadIdentifier.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/hotspot/share/runtime/vframe.hpp b/src/hotspot/share/runtime/vframe.hpp index c8c166f3236..882b84e2b6f 100644 --- a/src/hotspot/share/runtime/vframe.hpp +++ b/src/hotspot/share/runtime/vframe.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/runtime/vmOperations.hpp b/src/hotspot/share/runtime/vmOperations.hpp index 2ed9626652c..86f77f44161 100644 --- a/src/hotspot/share/runtime/vmOperations.hpp +++ b/src/hotspot/share/runtime/vmOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/services/gcNotifier.hpp b/src/hotspot/share/services/gcNotifier.hpp index f74d81b5b6e..1597e2698c4 100644 --- a/src/hotspot/share/services/gcNotifier.hpp +++ b/src/hotspot/share/services/gcNotifier.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/hotspot/share/services/threadIdTable.hpp b/src/hotspot/share/services/threadIdTable.hpp index b295cec2514..15dfb89d670 100644 --- a/src/hotspot/share/services/threadIdTable.hpp +++ b/src/hotspot/share/services/threadIdTable.hpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2019, 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 diff --git a/src/hotspot/share/utilities/elfFile.hpp b/src/hotspot/share/utilities/elfFile.hpp index 1298892533e..8abd846364c 100644 --- a/src/hotspot/share/utilities/elfFile.hpp +++ b/src/hotspot/share/utilities/elfFile.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/utilities/macros.hpp b/src/hotspot/share/utilities/macros.hpp index 9bdf4c2dd1f..8404fc757f0 100644 --- a/src/hotspot/share/utilities/macros.hpp +++ b/src/hotspot/share/utilities/macros.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/hotspot/share/utilities/nativeCallStack.hpp b/src/hotspot/share/utilities/nativeCallStack.hpp index 32635a72d51..cb7823c0c0a 100644 --- a/src/hotspot/share/utilities/nativeCallStack.hpp +++ b/src/hotspot/share/utilities/nativeCallStack.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/utilities/numberSeq.hpp b/src/hotspot/share/utilities/numberSeq.hpp index fff4b416745..b70b081586b 100644 --- a/src/hotspot/share/utilities/numberSeq.hpp +++ b/src/hotspot/share/utilities/numberSeq.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 diff --git a/src/hotspot/share/utilities/objectBitSet.hpp b/src/hotspot/share/utilities/objectBitSet.hpp index 73f1c89dd40..8f3e334b1a5 100644 --- a/src/hotspot/share/utilities/objectBitSet.hpp +++ b/src/hotspot/share/utilities/objectBitSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/hotspot/share/utilities/objectBitSet.inline.hpp b/src/hotspot/share/utilities/objectBitSet.inline.hpp index e1b4d728b10..e204841e6e2 100644 --- a/src/hotspot/share/utilities/objectBitSet.inline.hpp +++ b/src/hotspot/share/utilities/objectBitSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/hotspot/share/utilities/resizableHashTable.hpp b/src/hotspot/share/utilities/resizableHashTable.hpp index b445ed8a55e..a5b53698b11 100644 --- a/src/hotspot/share/utilities/resizableHashTable.hpp +++ b/src/hotspot/share/utilities/resizableHashTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/hotspot/share/utilities/ticks.hpp b/src/hotspot/share/utilities/ticks.hpp index 88dc9a787f9..7822e565f32 100644 --- a/src/hotspot/share/utilities/ticks.hpp +++ b/src/hotspot/share/utilities/ticks.hpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2022, 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 diff --git a/test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java b/test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java index 3df6f956b0f..336abf32480 100644 --- a/test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java +++ b/test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/LShiftINodeIdealizationTests.java b/test/hotspot/jtreg/compiler/c2/irTests/LShiftINodeIdealizationTests.java index c7a35a5a265..a6a9f545d16 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/LShiftINodeIdealizationTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/LShiftINodeIdealizationTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/LShiftLNodeIdealizationTests.java b/test/hotspot/jtreg/compiler/c2/irTests/LShiftLNodeIdealizationTests.java index 6e58d6a04fe..d1a419a9c8c 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/LShiftLNodeIdealizationTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/LShiftLNodeIdealizationTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/RShiftINodeIdealizationTests.java b/test/hotspot/jtreg/compiler/c2/irTests/RShiftINodeIdealizationTests.java index bf500d42540..f1c2c16818e 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/RShiftINodeIdealizationTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/RShiftINodeIdealizationTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/RShiftLNodeIdealizationTests.java b/test/hotspot/jtreg/compiler/c2/irTests/RShiftLNodeIdealizationTests.java index 02ee8063948..4bd9b410243 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/RShiftLNodeIdealizationTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/RShiftLNodeIdealizationTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestConv2BExpansion.java b/test/hotspot/jtreg/compiler/c2/irTests/TestConv2BExpansion.java index 35d676b6ddb..17cc1a227b2 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestConv2BExpansion.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestConv2BExpansion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestFPComparison.java b/test/hotspot/jtreg/compiler/c2/irTests/TestFPComparison.java index a06cb45d59e..f64c4980362 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestFPComparison.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestFPComparison.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestIfMinMax.java b/test/hotspot/jtreg/compiler/c2/irTests/TestIfMinMax.java index bfcc775efeb..9bfa0de38e2 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestIfMinMax.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestIfMinMax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java b/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java index de829f84775..9a06d12b15f 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021, 2022, 2025 Red Hat, Inc. All rights reserved. - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestMinMaxIdentities.java b/test/hotspot/jtreg/compiler/c2/irTests/TestMinMaxIdentities.java index e23c02c8c61..747ad14149a 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestMinMaxIdentities.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestMinMaxIdentities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java index 7d474f942a4..5524b5d7b6c 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestVectorizationMismatchedAccess.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2023, Red Hat, Inc. All rights reserved. - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java b/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java index 8d25706f521..24065bd97b9 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/scalarReplacement/AllocationMergesTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java b/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java index fbe2e89a45d..c4642dc9743 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java index aeeceac4ee2..901fd33bf6b 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/compiler/escapeAnalysis/TestFindInstMemRecursion.java b/test/hotspot/jtreg/compiler/escapeAnalysis/TestFindInstMemRecursion.java index 8fbeae46e59..5fde1c4cb03 100644 --- a/test/hotspot/jtreg/compiler/escapeAnalysis/TestFindInstMemRecursion.java +++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestFindInstMemRecursion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java b/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java index a5688ef8041..bdd5c2aa481 100644 --- a/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java +++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/test/hotspot/jtreg/compiler/gcbarriers/TestZGCBarrierElision.java b/test/hotspot/jtreg/compiler/gcbarriers/TestZGCBarrierElision.java index 4c94cd62c42..ff20f750935 100644 --- a/test/hotspot/jtreg/compiler/gcbarriers/TestZGCBarrierElision.java +++ b/test/hotspot/jtreg/compiler/gcbarriers/TestZGCBarrierElision.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/TestCompareUnsigned.java b/test/hotspot/jtreg/compiler/intrinsics/TestCompareUnsigned.java index 6d09d7c042c..56f9ff7e032 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/TestCompareUnsigned.java +++ b/test/hotspot/jtreg/compiler/intrinsics/TestCompareUnsigned.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMultiplyToLen.java b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMultiplyToLen.java index 25f0941ec68..2a73d131f1d 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMultiplyToLen.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMultiplyToLen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestShift.java b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestShift.java index 61edf1e583b..7aa553629ce 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestShift.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestShift.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestSquareToLen.java b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestSquareToLen.java index b3d7518a204..ba2057b8cab 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestSquareToLen.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestSquareToLen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java index 346169f1aad..881ed37906e 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java index 55d0368b84b..38753762f39 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java index 3841a2f155c..4ea2b3ab841 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java index 17a4034350f..1828e0ba837 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics.java b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics.java index f82a4899d97..a81131c7bf9 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics.java +++ b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java b/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java index 4638c27fe59..542a7b4019b 100644 --- a/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java +++ b/test/hotspot/jtreg/compiler/jsr292/MHInlineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java b/test/hotspot/jtreg/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java index 7e35d0c4e3d..a422e52986c 100644 --- a/test/hotspot/jtreg/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java +++ b/test/hotspot/jtreg/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java b/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java index 1d76655382d..49066d741ed 100644 --- a/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java +++ b/test/hotspot/jtreg/compiler/jvmci/TestJVMCIPrintProperties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java index 8e9be9eda37..706aec05a29 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/test/hotspot/jtreg/compiler/loopopts/TestLoopPredicationDivZeroCheck.java b/test/hotspot/jtreg/compiler/loopopts/TestLoopPredicationDivZeroCheck.java index 82935475aa0..18d0f066cc8 100644 --- a/test/hotspot/jtreg/compiler/loopopts/TestLoopPredicationDivZeroCheck.java +++ b/test/hotspot/jtreg/compiler/loopopts/TestLoopPredicationDivZeroCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java index b7e62c394ec..58cae526479 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestCyclicDependency.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java index d49eab4f62a..2a6e67f5536 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestMulAddS2I.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestMulAddS2I.java index e178d831938..f6a49b6dada 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestMulAddS2I.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestMulAddS2I.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestScheduleReordersScalarMemops.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestScheduleReordersScalarMemops.java index a837136218d..f7e81bc1864 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestScheduleReordersScalarMemops.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestScheduleReordersScalarMemops.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java index c862704da26..e9be6a5ab24 100644 --- a/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java +++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/predicates/assertion/TestTemplateWithoutOpaqueLoopNodes.java b/test/hotspot/jtreg/compiler/predicates/assertion/TestTemplateWithoutOpaqueLoopNodes.java index 9dcc6904270..1f0448b2085 100644 --- a/test/hotspot/jtreg/compiler/predicates/assertion/TestTemplateWithoutOpaqueLoopNodes.java +++ b/test/hotspot/jtreg/compiler/predicates/assertion/TestTemplateWithoutOpaqueLoopNodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/compiler/splitif/TestSplitDivisionThroughPhi.java b/test/hotspot/jtreg/compiler/splitif/TestSplitDivisionThroughPhi.java index e3ee65f454d..a58f5b82309 100644 --- a/test/hotspot/jtreg/compiler/splitif/TestSplitDivisionThroughPhi.java +++ b/test/hotspot/jtreg/compiler/splitif/TestSplitDivisionThroughPhi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java b/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java index 485aed4c032..7977125b9cf 100644 --- a/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java +++ b/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVectorNaN.java b/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVectorNaN.java index dad6e51f2ec..73d038dc7e1 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVectorNaN.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestFloatConversionsVectorNaN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java b/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java index c8c6586675a..a50a2732bba 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestReverseBitsVector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java index 8d4822ade57..c8a3c71bdee 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopArrayIndexComputeTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, 2023, Arm Limited. All rights reserved. - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java b/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java index 32b660d7de7..c46b2e11612 100644 --- a/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java +++ b/test/hotspot/jtreg/compiler/vectorization/runner/LoopCombinedOpTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2022, 2023, Arm Limited. All rights reserved. - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java b/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java index eb0f70af5c4..7e5e638944d 100644 --- a/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.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 diff --git a/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java b/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java index 8e201fb6e8a..f0e76f59217 100644 --- a/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java +++ b/test/hotspot/jtreg/gc/TestPLABAdaptToMinTLABSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java b/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java index 6323e5c50cf..52974d8c143 100644 --- a/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestMinAndInitialSurvivorRatioFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java b/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java index 41fa1826799..014181b2fce 100644 --- a/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java +++ b/test/hotspot/jtreg/gc/arguments/TestNewRatioFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java b/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java index f65f211b812..3f4d5fbea16 100644 --- a/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java +++ b/test/hotspot/jtreg/gc/arguments/TestNewSizeFlags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java b/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java index ea2a20b3dc9..bdf8186bfaa 100644 --- a/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java +++ b/test/hotspot/jtreg/gc/arguments/TestSurvivorRatioFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java index 40f607bf8a1..c9cf7291aaa 100644 --- a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java +++ b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsFlagsWithUlimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/test/hotspot/jtreg/gc/g1/pinnedobjs/TestPinnedOldObjectsEvacuation.java b/test/hotspot/jtreg/gc/g1/pinnedobjs/TestPinnedOldObjectsEvacuation.java index 5e567fb1a46..ff11f1508d9 100644 --- a/test/hotspot/jtreg/gc/g1/pinnedobjs/TestPinnedOldObjectsEvacuation.java +++ b/test/hotspot/jtreg/gc/g1/pinnedobjs/TestPinnedOldObjectsEvacuation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/gc/parallel/TestDynShrinkHeap.java b/test/hotspot/jtreg/gc/parallel/TestDynShrinkHeap.java index 5cb89e146b5..d47c4ffb81f 100644 --- a/test/hotspot/jtreg/gc/parallel/TestDynShrinkHeap.java +++ b/test/hotspot/jtreg/gc/parallel/TestDynShrinkHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithZ.java b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithZ.java index 310c090d017..d4a95fd9791 100644 --- a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithZ.java +++ b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithZ.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/test/hotspot/jtreg/gtest/AsyncLogGtest.java b/test/hotspot/jtreg/gtest/AsyncLogGtest.java index d2d393c12b7..76b04d90ac8 100644 --- a/test/hotspot/jtreg/gtest/AsyncLogGtest.java +++ b/test/hotspot/jtreg/gtest/AsyncLogGtest.java @@ -1,6 +1,6 @@ /* * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/gtest/CompressedKlassGtest.java b/test/hotspot/jtreg/gtest/CompressedKlassGtest.java index 450203357a4..ba801724558 100644 --- a/test/hotspot/jtreg/gtest/CompressedKlassGtest.java +++ b/test/hotspot/jtreg/gtest/CompressedKlassGtest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2024, Red Hat, Inc. All rights reserved. - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/gtest/MetaspaceGtests.java b/test/hotspot/jtreg/gtest/MetaspaceGtests.java index 1379fa05a1c..38fef145125 100644 --- a/test/hotspot/jtreg/gtest/MetaspaceGtests.java +++ b/test/hotspot/jtreg/gtest/MetaspaceGtests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2023 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java index d4b47422c38..0ac19c4a487 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java +++ b/test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java index ccc998bb7e0..6c8522c1881 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/UncaughtNativeExceptionTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/UncaughtNativeExceptionTest.java index d432181aacb..9090188d965 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/UncaughtNativeExceptionTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/UncaughtNativeExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/libNativeException.c b/test/hotspot/jtreg/runtime/ErrorHandling/libNativeException.c index 20216a2e1de..12e670fd4a5 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/libNativeException.c +++ b/test/hotspot/jtreg/runtime/ErrorHandling/libNativeException.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 diff --git a/test/hotspot/jtreg/runtime/NMT/MallocRoundingReportTest.java b/test/hotspot/jtreg/runtime/NMT/MallocRoundingReportTest.java index a0c14d70831..e02a55c6b09 100644 --- a/test/hotspot/jtreg/runtime/NMT/MallocRoundingReportTest.java +++ b/test/hotspot/jtreg/runtime/NMT/MallocRoundingReportTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/NMT/MallocTestType.java b/test/hotspot/jtreg/runtime/NMT/MallocTestType.java index 1612cbd81c0..7b532990a1e 100644 --- a/test/hotspot/jtreg/runtime/NMT/MallocTestType.java +++ b/test/hotspot/jtreg/runtime/NMT/MallocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/NMT/MallocTrackingVerify.java b/test/hotspot/jtreg/runtime/NMT/MallocTrackingVerify.java index 141ef9f2ac3..4d15ce33618 100644 --- a/test/hotspot/jtreg/runtime/NMT/MallocTrackingVerify.java +++ b/test/hotspot/jtreg/runtime/NMT/MallocTrackingVerify.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/NMT/ThreadedMallocTestType.java b/test/hotspot/jtreg/runtime/NMT/ThreadedMallocTestType.java index f6b0f3baf04..e0aefeb2285 100644 --- a/test/hotspot/jtreg/runtime/NMT/ThreadedMallocTestType.java +++ b/test/hotspot/jtreg/runtime/NMT/ThreadedMallocTestType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2023, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java b/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java index b46a5deb70d..06c10fbb7cf 100644 --- a/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java +++ b/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java index fe4688330e3..29be9cdb98f 100644 --- a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java +++ b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 SAP SE. All rights reserved. - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/test/hotspot/jtreg/runtime/cds/ServiceLoaderTest.java b/test/hotspot/jtreg/runtime/cds/ServiceLoaderTest.java index f0c99b24885..c77073fabb2 100644 --- a/test/hotspot/jtreg/runtime/cds/ServiceLoaderTest.java +++ b/test/hotspot/jtreg/runtime/cds/ServiceLoaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java b/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java index da5025b07b5..01516adb648 100644 --- a/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java +++ b/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java b/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java index 5774d71d089..c5396949bd6 100644 --- a/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java +++ b/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/CreateAOTCacheVerifyError.java b/test/hotspot/jtreg/runtime/cds/appcds/CreateAOTCacheVerifyError.java index c478fad7cc2..eec686297ae 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/CreateAOTCacheVerifyError.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/CreateAOTCacheVerifyError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java b/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java index 83840422b58..7c0b5896a98 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/TestZGCWithCDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java index 8b18876aeb4..f69f2be4864 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java index b09c2c944fb..df6367fc676 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/customLoader/PrintSharedArchiveAndExit.java b/test/hotspot/jtreg/runtime/cds/appcds/customLoader/PrintSharedArchiveAndExit.java index bc208fd3df9..52ce47ad0ac 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/customLoader/PrintSharedArchiveAndExit.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/customLoader/PrintSharedArchiveAndExit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/NestHostOldInf.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/NestHostOldInf.java index 99ab68bda49..77ba63bce83 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/NestHostOldInf.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/NestHostOldInf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/PrintSharedArchiveAndExit.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/PrintSharedArchiveAndExit.java index 13fa84ac205..b86a7c7933c 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/PrintSharedArchiveAndExit.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/PrintSharedArchiveAndExit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/src/com.foos/module-info.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/src/com.foos/module-info.java index 70565d9d4ee..5778143db71 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/src/com.foos/module-info.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/src/com.foos/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java index cc470eb68d0..56a16005df2 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java index 2b2e1194c63..e15cfafa3cb 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java index 4ea84def6d9..33216d64be2 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2021, Google and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java index 2c74eab945e..ac5ddf774e1 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 diff --git a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/server/ServerMemoryMXBean.java b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/server/ServerMemoryMXBean.java index 31050b6b8bb..46a7873999c 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/server/ServerMemoryMXBean.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/server/ServerMemoryMXBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 From 3fd7bde31b965e027df423b3c2b5e1f360397195 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Wed, 31 Dec 2025 07:21:32 +0000 Subject: [PATCH 07/56] 8374378: Update copyright year to 2025 for jdk.internal.vm.ci in files where it was missed Reviewed-by: phh --- .../share/classes/jdk/vm/ci/code/BytecodeFrame.java | 2 +- .../share/classes/jdk/vm/ci/code/VirtualObject.java | 2 +- .../share/classes/jdk/vm/ci/code/site/Site.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/CompilerToVM.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCode.java | 2 +- .../classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/HotSpotJavaType.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstant.java | 2 +- .../classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java | 2 +- .../classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java | 2 +- .../jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java | 2 +- .../classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java | 2 +- .../classes/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java | 2 +- .../share/classes/jdk/vm/ci/hotspot/VMField.java | 2 +- .../share/classes/jdk/vm/ci/meta/ConstantPool.java | 2 +- .../share/classes/jdk/vm/ci/meta/EncodedSpeculationReason.java | 2 +- .../share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java | 2 +- .../share/classes/jdk/vm/ci/meta/ResolvedJavaType.java | 2 +- .../share/classes/jdk/vm/ci/services/JVMCIServiceLocator.java | 2 +- .../share/classes/jdk/vm/ci/services/Services.java | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/BytecodeFrame.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/BytecodeFrame.java index 8c698b4ee3d..7b0d3d75387 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/BytecodeFrame.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/BytecodeFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/VirtualObject.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/VirtualObject.java index 1033fa559f8..6f91bfb6c1f 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/VirtualObject.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/VirtualObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/site/Site.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/site/Site.java index 7d1239fea0e..d12a78e5106 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/site/Site.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/site/Site.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java index b25f7a09256..ee578cfd5f1 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCode.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCode.java index 6d1f16d5bd2..dffd54e3117 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCode.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java index 2cd5e839ee8..565b38de96e 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledCodeStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java index e0e93b0f8bc..f532617a09e 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJavaType.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJavaType.java index 792c7bc00a2..d8fcb61079c 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJavaType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotJavaType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstant.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstant.java index bed38f91988..ca54e8325f3 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstant.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java index 1dcc969b3e6..9a067375245 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index b75edb9df08..ba29cad7849 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 224e8b1a070..3c3aaf830fa 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java index ab634568a84..e8c7107cd89 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java index 1fc5f1bfd6a..5cad3d05bf5 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java index 4849750337c..bf9b1875663 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java index 15bd58a5a5d..5f921c767dd 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMField.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMField.java index 21755445ca0..da9db1ddc32 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMField.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/VMField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java index 0b7fd70762d..ebd0df403a3 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/EncodedSpeculationReason.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/EncodedSpeculationReason.java index 2e72896b31d..02f91082fd5 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/EncodedSpeculationReason.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/EncodedSpeculationReason.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java index f401bc30f83..dcd80170ba9 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaType.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaType.java index cdb24c5f1ad..4e11cce4f68 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ResolvedJavaType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/JVMCIServiceLocator.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/JVMCIServiceLocator.java index d5ff0bba9b3..98856337cec 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/JVMCIServiceLocator.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/JVMCIServiceLocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java index 22f8eec7d12..c2bccb1bac1 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/services/Services.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 From 36d2c277c47767ba22208e2e49c46001642bd4f5 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Wed, 31 Dec 2025 09:13:32 +0000 Subject: [PATCH 08/56] 8374327: Update copyright year to 2025 for files in java.base added/updated by commits in 2025 Reviewed-by: jpai --- src/java.base/aix/classes/sun/nio/ch/AixPollPort.java | 2 +- .../share/classes/com/sun/crypto/provider/RSACipher.java | 2 +- .../share/classes/java/lang/CharacterData00.java.template | 2 +- .../share/classes/java/lang/CharacterDataLatin1.java.template | 2 +- .../share/classes/java/lang/CharacterDataPrivateUse.java | 2 +- .../share/classes/java/lang/CharacterDataUndefined.java | 2 +- src/java.base/share/classes/java/lang/ThreadBuilders.java | 2 +- src/java.base/share/classes/java/lang/invoke/VarHandle.java | 2 +- src/java.base/share/classes/java/lang/ref/Cleaner.java | 2 +- src/java.base/share/classes/java/lang/ref/PhantomReference.java | 2 +- src/java.base/share/classes/java/lang/ref/SoftReference.java | 2 +- src/java.base/share/classes/java/lang/ref/WeakReference.java | 2 +- .../classes/java/lang/runtime/ExactConversionsSupport.java | 2 +- src/java.base/share/classes/java/net/Authenticator.java | 2 +- .../share/classes/java/net/doc-files/net-properties.html | 2 +- .../classes/java/nio/charset/Charset-X-Coder.java.template | 2 +- src/java.base/share/classes/java/security/Provider.java | 2 +- src/java.base/share/classes/java/util/Collection.java | 2 +- src/java.base/share/classes/java/util/WeakHashMap.java | 2 +- src/java.base/share/classes/java/util/jar/JarInputStream.java | 2 +- src/java.base/share/classes/java/util/jar/JarVerifier.java | 2 +- src/java.base/share/classes/java/util/stream/GathererOp.java | 2 +- src/java.base/share/classes/java/util/zip/GZIPOutputStream.java | 2 +- .../share/classes/java/util/zip/snippet-files/Snippets.java | 2 +- src/java.base/share/classes/javax/security/auth/Subject.java | 2 +- src/java.base/share/classes/jdk/internal/ValueBased.java | 2 +- .../jdk/internal/access/JavaUtilConcurrentTLRAccess.java | 2 +- .../classfile/components/snippet-files/PackageSnippets.java | 2 +- .../classes/jdk/internal/foreign/abi/NativeEntryPoint.java | 2 +- .../share/classes/jdk/internal/foreign/abi/VMStorage.java | 2 +- .../share/classes/jdk/internal/icu/impl/Norm2AllModes.java | 2 +- .../share/classes/jdk/internal/icu/impl/UBiDiProps.java | 2 +- .../share/classes/jdk/internal/icu/impl/UCharacterProperty.java | 2 +- .../share/classes/jdk/internal/jrtfs/JrtFileSystem.java | 2 +- .../jdk/internal/misc/X-ScopedMemoryAccess.java.template | 2 +- src/java.base/share/classes/jdk/internal/module/ModuleInfo.java | 2 +- src/java.base/share/classes/sun/net/www/MimeTable.java | 2 +- src/java.base/share/classes/sun/nio/ch/ThreadPool.java | 2 +- src/java.base/share/classes/sun/nio/fs/AbstractPoller.java | 2 +- src/java.base/share/classes/sun/nio/fs/Cancellable.java | 2 +- src/java.base/share/classes/sun/nio/fs/PollingWatchService.java | 2 +- .../share/classes/sun/security/ec/ECPrivateKeyImpl.java | 2 +- src/java.base/share/classes/sun/security/rsa/RSAPadding.java | 2 +- .../share/classes/sun/security/ssl/CertStatusExtension.java | 2 +- .../sun/security/ssl/CertificateAuthoritiesExtension.java | 2 +- .../share/classes/sun/security/ssl/CertificateStatus.java | 2 +- .../share/classes/sun/security/ssl/CookieExtension.java | 2 +- .../share/classes/sun/security/ssl/DHServerKeyExchange.java | 2 +- .../share/classes/sun/security/ssl/DTLSOutputRecord.java | 2 +- .../share/classes/sun/security/ssl/ECDHServerKeyExchange.java | 2 +- .../share/classes/sun/security/ssl/ECPointFormatsExtension.java | 2 +- .../share/classes/sun/security/ssl/EncryptedExtensions.java | 2 +- .../classes/sun/security/ssl/ExtendedMasterSecretExtension.java | 2 +- .../share/classes/sun/security/ssl/HandshakeOutStream.java | 2 +- src/java.base/share/classes/sun/security/ssl/HelloRequest.java | 2 +- .../share/classes/sun/security/ssl/HelloVerifyRequest.java | 2 +- .../share/classes/sun/security/ssl/MaxFragExtension.java | 2 +- src/java.base/share/classes/sun/security/ssl/NamedGroup.java | 2 +- .../classes/sun/security/ssl/PredefinedDHParameterSpecs.java | 2 +- .../classes/sun/security/ssl/PskKeyExchangeModesExtension.java | 2 +- .../share/classes/sun/security/ssl/RSAServerKeyExchange.java | 2 +- .../share/classes/sun/security/ssl/RenegoInfoExtension.java | 2 +- .../share/classes/sun/security/ssl/ServerHelloDone.java | 2 +- .../share/classes/sun/security/ssl/ServerNameExtension.java | 2 +- src/java.base/unix/classes/java/lang/ProcessImpl.java | 2 +- src/java.base/unix/classes/sun/nio/ch/FileKey.java | 2 +- .../unix/classes/sun/nio/fs/UnixFileAttributeViews.java | 2 +- src/java.base/unix/classes/sun/nio/fs/UnixFileKey.java | 2 +- src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java | 2 +- src/java.base/unix/native/jspawnhelper/jspawnhelper.c | 2 +- src/java.base/unix/native/launcher/relauncher.c | 2 +- src/java.base/unix/native/libjava/locale_str.h | 2 +- src/java.base/unix/native/libnet/Inet4AddressImpl.c | 2 +- src/java.base/unix/native/libnet/NetworkInterface.c | 2 +- src/java.base/unix/native/libnet/net_util_md.h | 2 +- src/java.base/windows/classes/java/lang/ProcessImpl.java | 2 +- .../sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java | 2 +- src/java.base/windows/classes/sun/nio/ch/PipeImpl.java | 2 +- src/java.base/windows/native/launcher/relauncher.c | 2 +- src/java.base/windows/native/libnet/NTLMAuthSequence.c | 2 +- 80 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java b/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java index b8610655b6c..1d2121cb50f 100644 --- a/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java +++ b/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java b/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java index 9f19e1415bd..458edff7e76 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/java.base/share/classes/java/lang/CharacterData00.java.template b/src/java.base/share/classes/java/lang/CharacterData00.java.template index 247a3ec7050..cb1a9c9cc0b 100644 --- a/src/java.base/share/classes/java/lang/CharacterData00.java.template +++ b/src/java.base/share/classes/java/lang/CharacterData00.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template b/src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template index 8316164c7c5..8513f52fd20 100644 --- a/src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template +++ b/src/java.base/share/classes/java/lang/CharacterDataLatin1.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 diff --git a/src/java.base/share/classes/java/lang/CharacterDataPrivateUse.java b/src/java.base/share/classes/java/lang/CharacterDataPrivateUse.java index 22eae86f4a3..cf6106d47b0 100644 --- a/src/java.base/share/classes/java/lang/CharacterDataPrivateUse.java +++ b/src/java.base/share/classes/java/lang/CharacterDataPrivateUse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/java.base/share/classes/java/lang/CharacterDataUndefined.java b/src/java.base/share/classes/java/lang/CharacterDataUndefined.java index 4db9ff4ed3c..d3281f5a2f3 100644 --- a/src/java.base/share/classes/java/lang/CharacterDataUndefined.java +++ b/src/java.base/share/classes/java/lang/CharacterDataUndefined.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 diff --git a/src/java.base/share/classes/java/lang/ThreadBuilders.java b/src/java.base/share/classes/java/lang/ThreadBuilders.java index 033c237877c..150ce263b01 100644 --- a/src/java.base/share/classes/java/lang/ThreadBuilders.java +++ b/src/java.base/share/classes/java/lang/ThreadBuilders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandle.java b/src/java.base/share/classes/java/lang/invoke/VarHandle.java index 9246fdc0395..0bcb9a660da 100644 --- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 diff --git a/src/java.base/share/classes/java/lang/ref/Cleaner.java b/src/java.base/share/classes/java/lang/ref/Cleaner.java index 20a964be21d..ebe230a2f00 100644 --- a/src/java.base/share/classes/java/lang/ref/Cleaner.java +++ b/src/java.base/share/classes/java/lang/ref/Cleaner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 diff --git a/src/java.base/share/classes/java/lang/ref/PhantomReference.java b/src/java.base/share/classes/java/lang/ref/PhantomReference.java index a6e144dc7b6..5f6f47a14b3 100644 --- a/src/java.base/share/classes/java/lang/ref/PhantomReference.java +++ b/src/java.base/share/classes/java/lang/ref/PhantomReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/java.base/share/classes/java/lang/ref/SoftReference.java b/src/java.base/share/classes/java/lang/ref/SoftReference.java index 0bc372eb105..1409cd89d0f 100644 --- a/src/java.base/share/classes/java/lang/ref/SoftReference.java +++ b/src/java.base/share/classes/java/lang/ref/SoftReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/java.base/share/classes/java/lang/ref/WeakReference.java b/src/java.base/share/classes/java/lang/ref/WeakReference.java index 4b4f834485e..4bdce2ace98 100644 --- a/src/java.base/share/classes/java/lang/ref/WeakReference.java +++ b/src/java.base/share/classes/java/lang/ref/WeakReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java b/src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java index b86891749da..a1a93859c42 100644 --- a/src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java +++ b/src/java.base/share/classes/java/lang/runtime/ExactConversionsSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 diff --git a/src/java.base/share/classes/java/net/Authenticator.java b/src/java.base/share/classes/java/net/Authenticator.java index fb33596feed..d7b64d4bc73 100644 --- a/src/java.base/share/classes/java/net/Authenticator.java +++ b/src/java.base/share/classes/java/net/Authenticator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 diff --git a/src/java.base/share/classes/java/net/doc-files/net-properties.html b/src/java.base/share/classes/java/net/doc-files/net-properties.html index 54d4cd55a9b..f7767655235 100644 --- a/src/java.base/share/classes/java/net/doc-files/net-properties.html +++ b/src/java.base/share/classes/java/net/doc-files/net-properties.html @@ -1,6 +1,6 @@ " + dowDate); + assertEquals(dowExpected, dowResult, "Localized DayOfWeek not correct; " + day + " -->" + dowDate); int weekExpected = day.get(wowbyField) + 1; ValueRange range = day.range(wowbyField); weekExpected = ((weekExpected - 1) % (int)range.getMaximum()) + 1; LocalDate weekDate = day.with(wowbyField, weekExpected); int weekResult = weekDate.get(wowbyField); - assertEquals(weekResult, weekExpected, "Localized WeekOfWeekBasedYear not correct; " + day + " -->" + weekDate); + assertEquals(weekExpected, weekResult, "Localized WeekOfWeekBasedYear not correct; " + day + " -->" + weekDate); int yearExpected = day.get(yowbyField) + 1; LocalDate yearDate = day.with(yowbyField, yearExpected); int yearResult = yearDate.get(yowbyField); - assertEquals(yearResult, yearExpected, "Localized WeekBasedYear not correct; " + day + " --> " + yearDate); + assertEquals(yearExpected, yearResult, "Localized WeekBasedYear not correct; " + day + " --> " + yearDate); range = yearDate.range(wowbyField); weekExpected = Math.min(day.get(wowbyField), (int)range.getMaximum()); int weekActual = yearDate.get(wowbyField); - assertEquals(weekActual, weekExpected, "Localized WeekOfWeekBasedYear week should not change; " + day + " --> " + yearDate + ", actual: " + weekActual + ", weekExpected: " + weekExpected); + assertEquals(weekExpected, weekActual, "Localized WeekOfWeekBasedYear week should not change; " + day + " --> " + yearDate + ", actual: " + weekActual + ", weekExpected: " + weekExpected); } //----------------------------------------------------------------------- - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWom(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -388,13 +403,14 @@ public class TCKWeekFields extends AbstractTCKTest { String str = date.getYear() + ":" + date.getMonthValue() + ":" + date.get(womField) + ":" + date.get(DAY_OF_WEEK); LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date, " ::" + str + "::" + i); + assertEquals(date, parsed, " ::" + str + "::" + i); date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWom_lenient(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -411,14 +427,15 @@ public class TCKWeekFields extends AbstractTCKTest { for (int j = wom - 10; j < wom + 10; j++) { String str = date.getYear() + ":" + date.getMonthValue() + ":" + j + ":" + dow; LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date.plusWeeks(j - wom), " ::" + str + ": :" + i + "::" + j); + assertEquals(date.plusWeeks(j - wom), parsed, " ::" + str + ": :" + i + "::" + j); } date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWom_strict(DayOfWeek firstDayOfWeek, int minDays) { WeekFields week = WeekFields.of(firstDayOfWeek, minDays); TemporalField womField = week.weekOfMonth(); @@ -430,17 +447,18 @@ public class TCKWeekFields extends AbstractTCKTest { String str = "2012:1:0:1"; try { LocalDate date = LocalDate.parse(str, f); - assertEquals(date.getYear(), 2012); - assertEquals(date.getMonthValue(), 1); - assertEquals(date.get(womField), 0); - assertEquals(date.get(DAY_OF_WEEK), 1); + assertEquals(2012, date.getYear()); + assertEquals(1, date.getMonthValue()); + assertEquals(0, date.get(womField)); + assertEquals(1, date.get(DAY_OF_WEEK)); } catch (DateTimeException ex) { // expected } } //----------------------------------------------------------------------- - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWomDow(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -456,13 +474,14 @@ public class TCKWeekFields extends AbstractTCKTest { String str = date.getYear() + ":" + date.getMonthValue() + ":" + date.get(womField) + ":" + date.get(dowField); LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date, " :: " + str + " " + i); + assertEquals(date, parsed, " :: " + str + " " + i); date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWomDow_lenient(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -480,7 +499,7 @@ public class TCKWeekFields extends AbstractTCKTest { for (int j = wom - 10; j < wom + 10; j++) { String str = date.getYear() + ":" + date.getMonthValue() + ":" + j + ":" + dow; LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date.plusWeeks(j - wom), " ::" + str + ": :" + i + "::" + j); + assertEquals(date.plusWeeks(j - wom), parsed, " ::" + str + ": :" + i + "::" + j); } date = date.plusDays(1); @@ -488,7 +507,8 @@ public class TCKWeekFields extends AbstractTCKTest { } //----------------------------------------------------------------------- - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoy(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -502,13 +522,14 @@ public class TCKWeekFields extends AbstractTCKTest { String str = date.getYear() + ":" + date.get(woyField) + ":" + date.get(DAY_OF_WEEK); LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date, " :: " + str + " " + i); + assertEquals(date, parsed, " :: " + str + " " + i); date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoy_lenient(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -524,14 +545,15 @@ public class TCKWeekFields extends AbstractTCKTest { for (int j = woy - 60; j < woy + 60; j++) { String str = date.getYear() + ":" + j + ":" + dow; LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date.plusWeeks(j - woy), " ::" + str + ": :" + i + "::" + j); + assertEquals(date.plusWeeks(j - woy), parsed, " ::" + str + ": :" + i + "::" + j); } date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoy_strict(DayOfWeek firstDayOfWeek, int minDays) { WeekFields week = WeekFields.of(firstDayOfWeek, minDays); TemporalField woyField = week.weekOfYear(); @@ -542,16 +564,17 @@ public class TCKWeekFields extends AbstractTCKTest { String str = "2012:0:1"; try { LocalDate date = LocalDate.parse(str, f); - assertEquals(date.getYear(), 2012); - assertEquals(date.get(woyField), 0); - assertEquals(date.get(DAY_OF_WEEK), 1); + assertEquals(2012, date.getYear()); + assertEquals(0, date.get(woyField)); + assertEquals(1, date.get(DAY_OF_WEEK)); } catch (DateTimeException ex) { // expected } } //----------------------------------------------------------------------- - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoyDow(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -567,13 +590,14 @@ public class TCKWeekFields extends AbstractTCKTest { String str = date.getYear() + ":" + date.getMonthValue() + ":" + date.get(woyField) + ":" + date.get(dowField); LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date, " :: " + str + " " + i); + assertEquals(date, parsed, " :: " + str + " " + i); date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoyDow_lenient(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 15); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -590,7 +614,7 @@ public class TCKWeekFields extends AbstractTCKTest { for (int j = woy - 60; j < woy + 60; j++) { String str = date.getYear() + ":" + j + ":" + dow; LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date.plusWeeks(j - woy), " ::" + str + ": :" + i + "::" + j); + assertEquals(date.plusWeeks(j - woy), parsed, " ::" + str + ": :" + i + "::" + j); } date = date.plusDays(1); @@ -598,7 +622,8 @@ public class TCKWeekFields extends AbstractTCKTest { } //----------------------------------------------------------------------- - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoWBY(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 31); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -613,13 +638,14 @@ public class TCKWeekFields extends AbstractTCKTest { String str = date.get(yowbyField) + ":" + date.get(wowbyField) + ":" + date.get(DAY_OF_WEEK); LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date, " :: " + str + " " + i); + assertEquals(date, parsed, " :: " + str + " " + i); date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoWBY_lenient(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 31); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -636,14 +662,15 @@ public class TCKWeekFields extends AbstractTCKTest { for (int j = wowby - 60; j < wowby + 60; j++) { String str = date.get(yowbyField) + ":" + j + ":" + dow; LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date.plusWeeks(j - wowby), " ::" + str + ": :" + i + "::" + j); + assertEquals(date.plusWeeks(j - wowby), parsed, " ::" + str + ": :" + i + "::" + j); } date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoWBY_strict(DayOfWeek firstDayOfWeek, int minDays) { WeekFields week = WeekFields.of(firstDayOfWeek, minDays); TemporalField wowbyField = week.weekOfWeekBasedYear(); @@ -655,16 +682,17 @@ public class TCKWeekFields extends AbstractTCKTest { String str = "2012:0:1"; try { LocalDate date = LocalDate.parse(str, f); - assertEquals(date.get(yowbyField), 2012); - assertEquals(date.get(wowbyField), 0); - assertEquals(date.get(DAY_OF_WEEK), 1); + assertEquals(2012, date.get(yowbyField)); + assertEquals(0, date.get(wowbyField)); + assertEquals(1, date.get(DAY_OF_WEEK)); } catch (DateTimeException ex) { // expected } } //----------------------------------------------------------------------- - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoWBYDow(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 31); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -680,13 +708,14 @@ public class TCKWeekFields extends AbstractTCKTest { String str = date.get(yowbyField) + ":" + date.get(wowbyField) + ":" + date.get(dowField); LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date, " :: " + str + " " + i); + assertEquals(date, parsed, " :: " + str + " " + i); date = date.plusDays(1); } } - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_parse_resolve_localizedWoWBYDow_lenient(DayOfWeek firstDayOfWeek, int minDays) { LocalDate date = LocalDate.of(2012, 12, 31); WeekFields week = WeekFields.of(firstDayOfWeek, minDays); @@ -704,7 +733,7 @@ public class TCKWeekFields extends AbstractTCKTest { for (int j = wowby - 60; j < wowby + 60; j++) { String str = date.get(yowbyField) + ":" + j + ":" + dow; LocalDate parsed = LocalDate.parse(str, f); - assertEquals(parsed, date.plusWeeks(j - wowby), " ::" + str + ": :" + i + "::" + j); + assertEquals(date.plusWeeks(j - wowby), parsed, " ::" + str + ": :" + i + "::" + j); } date = date.plusDays(1); @@ -713,7 +742,6 @@ public class TCKWeekFields extends AbstractTCKTest { //----------------------------------------------------------------------- - @DataProvider(name="weekFields") Object[][] data_weekFields() { Object[][] objects = new Object[49][]; int i = 0; @@ -726,7 +754,6 @@ public class TCKWeekFields extends AbstractTCKTest { } //----------------------------------------------------------------------- - @DataProvider(name="WeekBasedYearData") Object[][] provider_WeekBasedYearData() { return new Object[][] { {WeekFields.of(DayOfWeek.SUNDAY, 1), 2008, 52, 7, LocalDate.of(2008, 12, 27)}, @@ -741,20 +768,20 @@ public class TCKWeekFields extends AbstractTCKTest { }; } - @Test(dataProvider="WeekBasedYearData") + @ParameterizedTest + @MethodSource("provider_WeekBasedYearData") public void test_weekBasedYears(WeekFields weekDef, int weekBasedYear, int weekOfWeekBasedYear, int dayOfWeek, LocalDate date) { TemporalField dowField = weekDef.dayOfWeek(); TemporalField wowbyField = weekDef.weekOfWeekBasedYear(); TemporalField yowbyField = weekDef.weekBasedYear(); - assertEquals(date.get(dowField), dayOfWeek, "DayOfWeek mismatch"); - assertEquals(date.get(wowbyField), weekOfWeekBasedYear, "Week of WeekBasedYear mismatch"); - assertEquals(date.get(yowbyField), weekBasedYear, "Year of WeekBasedYear mismatch"); + assertEquals(dayOfWeek, date.get(dowField), "DayOfWeek mismatch"); + assertEquals(weekOfWeekBasedYear, date.get(wowbyField), "Week of WeekBasedYear mismatch"); + assertEquals(weekBasedYear, date.get(yowbyField), "Year of WeekBasedYear mismatch"); } //----------------------------------------------------------------------- - @DataProvider(name="IsoWeekData") Object[][] data_week() { return new Object[][] { {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970}, @@ -776,16 +803,17 @@ public class TCKWeekFields extends AbstractTCKTest { // WEEK_OF_WEEK_BASED_YEAR // Validate with the same data used by IsoFields. //----------------------------------------------------------------------- - @Test(dataProvider="IsoWeekData") + @ParameterizedTest + @MethodSource("data_week") public void test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) { WeekFields weekDef = WeekFields.ISO; TemporalField dowField = weekDef.dayOfWeek(); TemporalField wowbyField = weekDef.weekOfWeekBasedYear(); TemporalField yowbyField = weekDef.weekBasedYear(); - assertEquals(date.get(dowField), dow.getValue()); - assertEquals(date.get(wowbyField), week); - assertEquals(date.get(yowbyField), wby); + assertEquals(dow.getValue(), date.get(dowField)); + assertEquals(week, date.get(wowbyField)); + assertEquals(wby, date.get(yowbyField)); } //----------------------------------------------------------------------- @@ -798,11 +826,11 @@ public class TCKWeekFields extends AbstractTCKTest { assertTrue(weekDef_iso.equals(WeekFields.of(DayOfWeek.MONDAY, 4))); assertTrue(weekDef_sundayStart.equals(WeekFields.of(DayOfWeek.SUNDAY, 1))); - assertEquals(weekDef_iso.hashCode(), WeekFields.of(DayOfWeek.MONDAY, 4).hashCode()); - assertEquals(weekDef_sundayStart.hashCode(), WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode()); + assertEquals(WeekFields.of(DayOfWeek.MONDAY, 4).hashCode(), weekDef_iso.hashCode()); + assertEquals(WeekFields.of(DayOfWeek.SUNDAY, 1).hashCode(), weekDef_sundayStart.hashCode()); assertFalse(weekDef_iso.equals(weekDef_sundayStart)); - assertNotEquals(weekDef_iso.hashCode(), weekDef_sundayStart.hashCode()); + assertNotEquals(weekDef_sundayStart.hashCode(), weekDef_iso.hashCode()); } } diff --git a/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoFieldSerialization.java b/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoFieldSerialization.java index bb8c5c566a5..b82a278cb34 100644 --- a/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoFieldSerialization.java +++ b/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoFieldSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -86,21 +86,21 @@ import static java.time.temporal.ChronoField.ERA; import java.io.IOException; import java.time.temporal.ChronoField; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import tck.java.time.AbstractTCKTest; /** * Test serialization of ChronoField. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TCKChronoFieldSerialization extends AbstractTCKTest { //----------------------------------------------------------------------- // List of Fields //----------------------------------------------------------------------- - @DataProvider(name="fieldBased") Object[][] data_fieldBased() { return new Object[][] { {DAY_OF_WEEK}, @@ -135,7 +135,8 @@ public class TCKChronoFieldSerialization extends AbstractTCKTest { }; } - @Test(dataProvider = "fieldBased") + @ParameterizedTest + @MethodSource("data_fieldBased") public void test_fieldSerializable(ChronoField field) throws IOException, ClassNotFoundException { assertSerializableSame(field); } diff --git a/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoUnitSerialization.java b/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoUnitSerialization.java index e97e183d252..9714220b7be 100644 --- a/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoUnitSerialization.java +++ b/test/jdk/java/time/tck/java/time/temporal/serial/TCKChronoUnitSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -74,21 +74,21 @@ import static java.time.temporal.ChronoUnit.YEARS; import java.io.IOException; import java.time.temporal.ChronoUnit; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import tck.java.time.AbstractTCKTest; /** * Test. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TCKChronoUnitSerialization extends AbstractTCKTest { //----------------------------------------------------------------------- // ChronoUnits //----------------------------------------------------------------------- - @DataProvider(name="chronoUnit") Object[][] data_chronoUnit() { return new Object[][] { {FOREVER}, @@ -112,7 +112,8 @@ public class TCKChronoUnitSerialization extends AbstractTCKTest { }; } - @Test(dataProvider = "chronoUnit") + @ParameterizedTest + @MethodSource("data_chronoUnit") public void test_unitType(ChronoUnit unit) throws IOException, ClassNotFoundException { assertSerializableSame(unit); } diff --git a/test/jdk/java/time/tck/java/time/temporal/serial/TCKJulianFieldsSerialization.java b/test/jdk/java/time/tck/java/time/temporal/serial/TCKJulianFieldsSerialization.java index 53047f8441a..a861290ac0e 100644 --- a/test/jdk/java/time/tck/java/time/temporal/serial/TCKJulianFieldsSerialization.java +++ b/test/jdk/java/time/tck/java/time/temporal/serial/TCKJulianFieldsSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -63,19 +63,19 @@ import java.io.IOException; import java.time.temporal.JulianFields; import java.time.temporal.TemporalField; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import tck.java.time.AbstractTCKTest; /** * Test serialization of JulianFields */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TCKJulianFieldsSerialization extends AbstractTCKTest { //----------------------------------------------------------------------- - @DataProvider(name="julian_fields") Object[][] julian_samples() { return new Object[][] { {JulianFields.JULIAN_DAY}, @@ -86,7 +86,8 @@ public class TCKJulianFieldsSerialization extends AbstractTCKTest { //----------------------------------------------------------------------- - @Test(dataProvider="julian_fields") + @ParameterizedTest + @MethodSource("julian_samples") public void test_serializable(TemporalField field) throws IOException, ClassNotFoundException { assertSerializable(field); } diff --git a/test/jdk/java/time/tck/java/time/temporal/serial/TCKValueRangeSerialization.java b/test/jdk/java/time/tck/java/time/temporal/serial/TCKValueRangeSerialization.java index d99efd03535..a3612e7f6a6 100644 --- a/test/jdk/java/time/tck/java/time/temporal/serial/TCKValueRangeSerialization.java +++ b/test/jdk/java/time/tck/java/time/temporal/serial/TCKValueRangeSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,8 +59,7 @@ */ package tck.java.time.temporal.serial; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -71,19 +70,20 @@ import java.io.ObjectOutputStream; import java.time.temporal.ValueRange; import java.util.Arrays; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import tck.java.time.AbstractTCKTest; /** * Test serialization of ValueRange. */ -@Test public class TCKValueRangeSerialization extends AbstractTCKTest { //----------------------------------------------------------------------- // Serialization //----------------------------------------------------------------------- + @Test public void test_serialization() throws Exception { ValueRange range = ValueRange.of(1, 2, 3, 4); assertSerializable(range); @@ -94,6 +94,7 @@ public class TCKValueRangeSerialization extends AbstractTCKTest { * Verify Serialized bytes of a ValueRange. * @throws IOException if thrown during serialization is an unexpected test tailure */ + @Test public void test_valueRangeSerialized() throws IOException { byte[] expected = { (byte)172, (byte)237, 0, 5, 115, 114, 0, 29, 106, 97, /* \u00ac \u00ed \u0000 \u0005 s r \u0000 \u001d j a */ @@ -118,7 +119,7 @@ public class TCKValueRangeSerialization extends AbstractTCKTest { oos.writeObject(range); byte[] actual = baos.toByteArray(); - assertEquals(actual, expected, "Serialized bytes incorrect"); + Assertions.assertArrayEquals(expected, actual, "Serialized bytes incorrect"); } } diff --git a/test/jdk/java/time/tck/java/time/temporal/serial/TCKWeekFieldsSerialization.java b/test/jdk/java/time/tck/java/time/temporal/serial/TCKWeekFieldsSerialization.java index 3523f05c88c..34171276cd1 100644 --- a/test/jdk/java/time/tck/java/time/temporal/serial/TCKWeekFieldsSerialization.java +++ b/test/jdk/java/time/tck/java/time/temporal/serial/TCKWeekFieldsSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -54,13 +54,11 @@ */ package tck.java.time.temporal.serial; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import tck.java.time.AbstractTCKTest; import java.io.IOException; @@ -70,21 +68,26 @@ import java.time.DayOfWeek; import java.time.temporal.WeekFields; import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + /** * Test serialization of WeekFields. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TCKWeekFieldsSerialization extends AbstractTCKTest { //----------------------------------------------------------------------- - @Test(dataProvider="weekFields") + @ParameterizedTest + @MethodSource("data_weekFields") public void test_serializable_singleton(DayOfWeek firstDayOfWeek, int minDays) throws IOException, ClassNotFoundException { WeekFields weekDef = WeekFields.of(firstDayOfWeek, minDays); assertSerializableSame(weekDef); // spec state singleton } //----------------------------------------------------------------------- - @DataProvider(name="weekFields") Object[][] data_weekFields() { Object[][] objects = new Object[49][]; int i = 0; @@ -110,7 +113,7 @@ public class TCKWeekFieldsSerialization extends AbstractTCKTest { System.arraycopy(good1, 0, val, 105, good1.length); try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(val))) { Object o = in.readObject(); - assertEquals(o, WeekFields.of(DayOfWeek.MONDAY, 5), "Should be MONDAY, min = 5"); + assertEquals(WeekFields.of(DayOfWeek.MONDAY, 5), o, "Should be MONDAY, min = 5"); } catch (Exception ioe) { fail("Unexpected exception " + ioe); } diff --git a/test/jdk/java/time/tck/java/time/zone/TCKFixedZoneRules.java b/test/jdk/java/time/tck/java/time/zone/TCKFixedZoneRules.java index 08df5433349..83d8af37306 100644 --- a/test/jdk/java/time/tck/java/time/zone/TCKFixedZoneRules.java +++ b/test/jdk/java/time/tck/java/time/zone/TCKFixedZoneRules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,7 +59,7 @@ */ package tck.java.time.zone; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -76,13 +76,16 @@ import java.time.zone.ZoneOffsetTransitionRule; import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition; import java.time.zone.ZoneRules; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test ZoneRules for fixed offset time-zones. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TCKFixedZoneRules { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); @@ -95,7 +98,6 @@ public class TCKFixedZoneRules { return offset.getRules(); } - @DataProvider(name="rules") Object[][] data_rules() { return new Object[][] { {make(OFFSET_PONE), OFFSET_PONE}, @@ -108,95 +110,111 @@ public class TCKFixedZoneRules { // Basics //----------------------------------------------------------------------- - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getOffset_Instant(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getOffset(INSTANT), expectedOffset); - assertEquals(test.getOffset((Instant) null), expectedOffset); + assertEquals(expectedOffset, test.getOffset(INSTANT)); + assertEquals(expectedOffset, test.getOffset((Instant) null)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getOffset_LocalDateTime(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getOffset(LDT), expectedOffset); - assertEquals(test.getOffset((LocalDateTime) null), expectedOffset); + assertEquals(expectedOffset, test.getOffset(LDT)); + assertEquals(expectedOffset, test.getOffset((LocalDateTime) null)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getValidOffsets_LDT(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getValidOffsets(LDT).size(), 1); - assertEquals(test.getValidOffsets(LDT).get(0), expectedOffset); - assertEquals(test.getValidOffsets(null).size(), 1); - assertEquals(test.getValidOffsets(null).get(0), expectedOffset); + assertEquals(1, test.getValidOffsets(LDT).size()); + assertEquals(expectedOffset, test.getValidOffsets(LDT).get(0)); + assertEquals(1, test.getValidOffsets(null).size()); + assertEquals(expectedOffset, test.getValidOffsets(null).get(0)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getTransition_LDT(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getTransition(LDT), null); - assertEquals(test.getTransition(null), null); + assertEquals(null, test.getTransition(LDT)); + assertEquals(null, test.getTransition(null)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_isValidOffset_LDT_ZO(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.isValidOffset(LDT, expectedOffset), true); - assertEquals(test.isValidOffset(LDT, ZoneOffset.UTC), false); - assertEquals(test.isValidOffset(LDT, null), false); + assertEquals(true, test.isValidOffset(LDT, expectedOffset)); + assertEquals(false, test.isValidOffset(LDT, ZoneOffset.UTC)); + assertEquals(false, test.isValidOffset(LDT, null)); - assertEquals(test.isValidOffset(null, expectedOffset), true); - assertEquals(test.isValidOffset(null, ZoneOffset.UTC), false); - assertEquals(test.isValidOffset(null, null), false); + assertEquals(true, test.isValidOffset(null, expectedOffset)); + assertEquals(false, test.isValidOffset(null, ZoneOffset.UTC)); + assertEquals(false, test.isValidOffset(null, null)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getStandardOffset_Instant(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getStandardOffset(INSTANT), expectedOffset); - assertEquals(test.getStandardOffset(null), expectedOffset); + assertEquals(expectedOffset, test.getStandardOffset(INSTANT)); + assertEquals(expectedOffset, test.getStandardOffset(null)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getDaylightSavings_Instant(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getDaylightSavings(INSTANT), Duration.ZERO); - assertEquals(test.getDaylightSavings(null), Duration.ZERO); + assertEquals(Duration.ZERO, test.getDaylightSavings(INSTANT)); + assertEquals(Duration.ZERO, test.getDaylightSavings(null)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_isDaylightSavings_Instant(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.isDaylightSavings(INSTANT), false); - assertEquals(test.isDaylightSavings(null), false); + assertEquals(false, test.isDaylightSavings(INSTANT)); + assertEquals(false, test.isDaylightSavings(null)); } //------------------------------------------------------------------------- - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_nextTransition_Instant(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.nextTransition(INSTANT), null); - assertEquals(test.nextTransition(null), null); + assertEquals(null, test.nextTransition(INSTANT)); + assertEquals(null, test.nextTransition(null)); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_previousTransition_Instant(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.previousTransition(INSTANT), null); - assertEquals(test.previousTransition(null), null); + assertEquals(null, test.previousTransition(INSTANT)); + assertEquals(null, test.previousTransition(null)); } //------------------------------------------------------------------------- - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getTransitions(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getTransitions().size(), 0); + assertEquals(0, test.getTransitions().size()); } - @Test(expectedExceptions=UnsupportedOperationException.class) + @Test public void test_getTransitions_immutable() { - ZoneRules test = make(OFFSET_PTWO); - test.getTransitions().add(ZoneOffsetTransition.of(LDT, OFFSET_PONE, OFFSET_PTWO)); + Assertions.assertThrows(UnsupportedOperationException.class, () -> { + ZoneRules test = make(OFFSET_PTWO); + test.getTransitions().add(ZoneOffsetTransition.of(LDT, OFFSET_PONE, OFFSET_PTWO)); + }); } - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_getTransitionRules(ZoneRules test, ZoneOffset expectedOffset) { - assertEquals(test.getTransitionRules().size(), 0); + assertEquals(0, test.getTransitionRules().size()); } - @Test(expectedExceptions=UnsupportedOperationException.class) + @Test public void test_getTransitionRules_immutable() { - ZoneRules test = make(OFFSET_PTWO); - test.getTransitionRules().add(ZoneOffsetTransitionRule.of(Month.JULY, 2, null, LocalTime.of(12, 30), false, TimeDefinition.STANDARD, OFFSET_PONE, OFFSET_PTWO, OFFSET_PONE)); + Assertions.assertThrows(UnsupportedOperationException.class, () -> { + ZoneRules test = make(OFFSET_PTWO); + test.getTransitionRules().add(ZoneOffsetTransitionRule.of(Month.JULY, 2, null, LocalTime.of(12, 30), false, TimeDefinition.STANDARD, OFFSET_PONE, OFFSET_PTWO, OFFSET_PONE)); + }); } //----------------------------------------------------------------------- @@ -207,16 +225,16 @@ public class TCKFixedZoneRules { ZoneRules a = make(OFFSET_PONE); ZoneRules b = make(OFFSET_PTWO); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); - assertEquals(a.equals("Rubbish"), false); - assertEquals(a.equals(null), false); + assertEquals(false, a.equals("Rubbish")); + assertEquals(false, a.equals(null)); - assertEquals(a.hashCode() == a.hashCode(), true); - assertEquals(b.hashCode() == b.hashCode(), true); + assertEquals(true, a.hashCode() == a.hashCode()); + assertEquals(true, b.hashCode() == b.hashCode()); } } diff --git a/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransition.java b/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransition.java index 9cd42624bfa..241da3d0519 100644 --- a/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransition.java +++ b/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -60,7 +60,8 @@ package tck.java.time.zone; import static java.time.temporal.ChronoUnit.HOURS; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Duration; import java.time.LocalDateTime; @@ -68,13 +69,14 @@ import java.time.Year; import java.time.ZoneOffset; import java.time.zone.ZoneOffsetTransition; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + import tck.java.time.AbstractTCKTest; /** * Test ZoneOffsetTransition. */ -@Test public class TCKZoneOffsetTransition extends AbstractTCKTest { private static final ZoneOffset OFFSET_0100 = ZoneOffset.ofHours(1); @@ -86,29 +88,29 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { //----------------------------------------------------------------------- // factory //----------------------------------------------------------------------- - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullTransition() { - ZoneOffsetTransition.of(null, OFFSET_0100, OFFSET_0200); + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransition.of(null, OFFSET_0100, OFFSET_0200)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullOffsetBefore() { - ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), null, OFFSET_0200); + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), null, OFFSET_0200)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullOffsetAfter() { - ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), OFFSET_0200, null); + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), OFFSET_0200, null)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_factory_sameOffset() { - ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), OFFSET_0200, OFFSET_0200); + Assertions.assertThrows(IllegalArgumentException.class, () -> ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), OFFSET_0200, OFFSET_0200)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_factory_noNanos() { - ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30, 0, 500), OFFSET_0200, OFFSET_0300); + Assertions.assertThrows(IllegalArgumentException.class, () -> ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30, 0, 500), OFFSET_0200, OFFSET_0300)); } //----------------------------------------------------------------------- @@ -119,14 +121,14 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { LocalDateTime before = LocalDateTime.of(2010, 3, 31, 1, 0); LocalDateTime after = LocalDateTime.of(2010, 3, 31, 2, 0); ZoneOffsetTransition test = ZoneOffsetTransition.of(before, OFFSET_0200, OFFSET_0300); - assertEquals(test.isGap(), true); - assertEquals(test.isOverlap(), false); - assertEquals(test.getDateTimeBefore(), before); - assertEquals(test.getDateTimeAfter(), after); - assertEquals(test.getInstant(), before.toInstant(OFFSET_0200)); - assertEquals(test.getOffsetBefore(), OFFSET_0200); - assertEquals(test.getOffsetAfter(), OFFSET_0300); - assertEquals(test.getDuration(), Duration.of(1, HOURS)); + assertEquals(true, test.isGap()); + assertEquals(false, test.isOverlap()); + assertEquals(before, test.getDateTimeBefore()); + assertEquals(after, test.getDateTimeAfter()); + assertEquals(before.toInstant(OFFSET_0200), test.getInstant()); + assertEquals(OFFSET_0200, test.getOffsetBefore()); + assertEquals(OFFSET_0300, test.getOffsetAfter()); + assertEquals(Duration.of(1, HOURS), test.getDuration()); } @Test @@ -134,14 +136,14 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { LocalDateTime before = LocalDateTime.of(2010, 10, 31, 1, 0); LocalDateTime after = LocalDateTime.of(2010, 10, 31, 0, 0); ZoneOffsetTransition test = ZoneOffsetTransition.of(before, OFFSET_0300, OFFSET_0200); - assertEquals(test.isGap(), false); - assertEquals(test.isOverlap(), true); - assertEquals(test.getDateTimeBefore(), before); - assertEquals(test.getDateTimeAfter(), after); - assertEquals(test.getInstant(), before.toInstant(OFFSET_0300)); - assertEquals(test.getOffsetBefore(), OFFSET_0300); - assertEquals(test.getOffsetAfter(), OFFSET_0200); - assertEquals(test.getDuration(), Duration.of(-1, HOURS)); + assertEquals(false, test.isGap()); + assertEquals(true, test.isOverlap()); + assertEquals(before, test.getDateTimeBefore()); + assertEquals(after, test.getDateTimeAfter()); + assertEquals(before.toInstant(OFFSET_0300), test.getInstant()); + assertEquals(OFFSET_0300, test.getOffsetBefore()); + assertEquals(OFFSET_0200, test.getOffsetAfter()); + assertEquals(Duration.of(-1, HOURS), test.getDuration()); } @@ -152,22 +154,22 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { public void test_isValidOffset_gap() { LocalDateTime ldt = LocalDateTime.of(2010, 3, 31, 1, 0); ZoneOffsetTransition test = ZoneOffsetTransition.of(ldt, OFFSET_0200, OFFSET_0300); - assertEquals(test.isValidOffset(OFFSET_0100), false); - assertEquals(test.isValidOffset(OFFSET_0200), false); - assertEquals(test.isValidOffset(OFFSET_0230), false); - assertEquals(test.isValidOffset(OFFSET_0300), false); - assertEquals(test.isValidOffset(OFFSET_0400), false); + assertEquals(false, test.isValidOffset(OFFSET_0100)); + assertEquals(false, test.isValidOffset(OFFSET_0200)); + assertEquals(false, test.isValidOffset(OFFSET_0230)); + assertEquals(false, test.isValidOffset(OFFSET_0300)); + assertEquals(false, test.isValidOffset(OFFSET_0400)); } @Test public void test_isValidOffset_overlap() { LocalDateTime ldt = LocalDateTime.of(2010, 10, 31, 1, 0); ZoneOffsetTransition test = ZoneOffsetTransition.of(ldt, OFFSET_0300, OFFSET_0200); - assertEquals(test.isValidOffset(OFFSET_0100), false); - assertEquals(test.isValidOffset(OFFSET_0200), true); - assertEquals(test.isValidOffset(OFFSET_0230), false); - assertEquals(test.isValidOffset(OFFSET_0300), true); - assertEquals(test.isValidOffset(OFFSET_0400), false); + assertEquals(false, test.isValidOffset(OFFSET_0100)); + assertEquals(true, test.isValidOffset(OFFSET_0200)); + assertEquals(false, test.isValidOffset(OFFSET_0230)); + assertEquals(true, test.isValidOffset(OFFSET_0300)); + assertEquals(false, test.isValidOffset(OFFSET_0400)); } //----------------------------------------------------------------------- @@ -182,17 +184,17 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { ZoneOffsetTransition c = ZoneOffsetTransition.of( LocalDateTime.ofEpochSecond(23875287L + 1, 0, OFFSET_0100), OFFSET_0100,OFFSET_0400); - assertEquals(a.compareTo(a) == 0, true); - assertEquals(a.compareTo(b) < 0, true); - assertEquals(a.compareTo(c) < 0, true); + assertEquals(true, a.compareTo(a) == 0); + assertEquals(true, a.compareTo(b) < 0); + assertEquals(true, a.compareTo(c) < 0); - assertEquals(b.compareTo(a) > 0, true); - assertEquals(b.compareTo(b) == 0, true); - assertEquals(b.compareTo(c) < 0, true); + assertEquals(true, b.compareTo(a) > 0); + assertEquals(true, b.compareTo(b) == 0); + assertEquals(true, b.compareTo(c) < 0); - assertEquals(c.compareTo(a) > 0, true); - assertEquals(c.compareTo(b) > 0, true); - assertEquals(c.compareTo(c) == 0, true); + assertEquals(true, c.compareTo(a) > 0); + assertEquals(true, c.compareTo(b) > 0); + assertEquals(true, c.compareTo(c) == 0); } @Test @@ -204,17 +206,17 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { ZoneOffsetTransition c = ZoneOffsetTransition.of( LocalDateTime.ofEpochSecond(23875287L, 0, OFFSET_0100), OFFSET_0100, OFFSET_0400); - assertEquals(a.compareTo(a) == 0, true); - assertEquals(a.compareTo(b) == 0, true); - assertEquals(a.compareTo(c) == 0, true); + assertEquals(true, a.compareTo(a) == 0); + assertEquals(true, a.compareTo(b) == 0); + assertEquals(true, a.compareTo(c) == 0); - assertEquals(b.compareTo(a) == 0, true); - assertEquals(b.compareTo(b) == 0, true); - assertEquals(b.compareTo(c) == 0, true); + assertEquals(true, b.compareTo(a) == 0); + assertEquals(true, b.compareTo(b) == 0); + assertEquals(true, b.compareTo(c) == 0); - assertEquals(c.compareTo(a) == 0, true); - assertEquals(c.compareTo(b) == 0, true); - assertEquals(c.compareTo(c) == 0, true); + assertEquals(true, c.compareTo(a) == 0); + assertEquals(true, c.compareTo(b) == 0); + assertEquals(true, c.compareTo(c) == 0); } //----------------------------------------------------------------------- @@ -228,18 +230,18 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { LocalDateTime ldtB = LocalDateTime.of(2010, 10, 31, 1, 0); ZoneOffsetTransition b = ZoneOffsetTransition.of(ldtB, OFFSET_0300, OFFSET_0200); - assertEquals(a1.equals(a1), true); - assertEquals(a1.equals(a2), true); - assertEquals(a1.equals(b), false); - assertEquals(a2.equals(a1), true); - assertEquals(a2.equals(a2), true); - assertEquals(a2.equals(b), false); - assertEquals(b.equals(a1), false); - assertEquals(b.equals(a2), false); - assertEquals(b.equals(b), true); + assertEquals(true, a1.equals(a1)); + assertEquals(true, a1.equals(a2)); + assertEquals(false, a1.equals(b)); + assertEquals(true, a2.equals(a1)); + assertEquals(true, a2.equals(a2)); + assertEquals(false, a2.equals(b)); + assertEquals(false, b.equals(a1)); + assertEquals(false, b.equals(a2)); + assertEquals(true, b.equals(b)); - assertEquals(a1.equals(""), false); - assertEquals(a1.equals(null), false); + assertEquals(false, a1.equals("")); + assertEquals(false, a1.equals(null)); } //----------------------------------------------------------------------- @@ -254,7 +256,7 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { ZoneOffsetTransition b = ZoneOffsetTransition.of(ldtB, OFFSET_0300, OFFSET_0200); assertEquals(a1.hashCode(), a1.hashCode()); - assertEquals(a1.hashCode(), a2.hashCode()); + assertEquals(a2.hashCode(), a1.hashCode()); assertEquals(b.hashCode(), b.hashCode()); } @@ -265,14 +267,14 @@ public class TCKZoneOffsetTransition extends AbstractTCKTest { public void test_toString_gap() { LocalDateTime ldt = LocalDateTime.of(2010, 3, 31, 1, 0); ZoneOffsetTransition test = ZoneOffsetTransition.of(ldt, OFFSET_0200, OFFSET_0300); - assertEquals(test.toString(), "Transition[Gap at 2010-03-31T01:00+02:00 to +03:00]"); + assertEquals("Transition[Gap at 2010-03-31T01:00+02:00 to +03:00]", test.toString()); } @Test public void test_toString_overlap() { LocalDateTime ldt = LocalDateTime.of(2010, 10, 31, 1, 0); ZoneOffsetTransition test = ZoneOffsetTransition.of(ldt, OFFSET_0300, OFFSET_0200); - assertEquals(test.toString(), "Transition[Overlap at 2010-10-31T01:00+03:00 to +02:00]"); + assertEquals("Transition[Overlap at 2010-10-31T01:00+03:00 to +02:00]", test.toString()); } } diff --git a/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransitionRule.java b/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransitionRule.java index 3c0c14c1ca6..e12251c6874 100644 --- a/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransitionRule.java +++ b/test/jdk/java/time/tck/java/time/zone/TCKZoneOffsetTransitionRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,7 +59,7 @@ */ package tck.java.time.zone; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DayOfWeek; import java.time.LocalDateTime; @@ -70,13 +70,14 @@ import java.time.zone.ZoneOffsetTransition; import java.time.zone.ZoneOffsetTransitionRule; import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + import tck.java.time.AbstractTCKTest; /** * Test ZoneOffsetTransitionRule. */ -@Test public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { private static final LocalTime TIME_0100 = LocalTime.of(1, 0); @@ -86,81 +87,81 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { //----------------------------------------------------------------------- // factory //----------------------------------------------------------------------- - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullMonth() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransitionRule.of( null, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, - OFFSET_0200, OFFSET_0200, OFFSET_0300); + OFFSET_0200, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullTime() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, null, false, TimeDefinition.WALL, - OFFSET_0200, OFFSET_0200, OFFSET_0300); + OFFSET_0200, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullTimeDefinition() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, null, - OFFSET_0200, OFFSET_0200, OFFSET_0300); + OFFSET_0200, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullStandardOffset() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, - null, OFFSET_0200, OFFSET_0300); + null, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullOffsetBefore() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, - OFFSET_0200, null, OFFSET_0300); + OFFSET_0200, null, OFFSET_0300)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_factory_nullOffsetAfter() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(NullPointerException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, - OFFSET_0200, OFFSET_0200, null); + OFFSET_0200, OFFSET_0200, null)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_factory_invalidDayOfMonthIndicator_tooSmall() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(IllegalArgumentException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, -29, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, - OFFSET_0200, OFFSET_0200, OFFSET_0300); + OFFSET_0200, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_factory_invalidDayOfMonthIndicator_zero() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(IllegalArgumentException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 0, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, - OFFSET_0200, OFFSET_0200, OFFSET_0300); + OFFSET_0200, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_factory_invalidDayOfMonthIndicator_tooLarge() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(IllegalArgumentException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 32, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, - OFFSET_0200, OFFSET_0200, OFFSET_0300); + OFFSET_0200, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_factory_invalidMidnightFlag() { - ZoneOffsetTransitionRule.of( + Assertions.assertThrows(IllegalArgumentException.class, () -> ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, true, TimeDefinition.WALL, - OFFSET_0200, OFFSET_0200, OFFSET_0300); + OFFSET_0200, OFFSET_0200, OFFSET_0300)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_factory_nonZeroTimeNanos() { - ZoneOffsetTransitionRule.of( - Month.MARCH, 20, DayOfWeek.SUNDAY, LocalTime.of(1, 2, 3, 400_000_000), - false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); + Assertions.assertThrows(IllegalArgumentException.class, () -> ZoneOffsetTransitionRule.of( + Month.MARCH, 20, DayOfWeek.SUNDAY, LocalTime.of(1, 2, 3, 400_000_000), + false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300)); } //----------------------------------------------------------------------- @@ -171,15 +172,15 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(test.getMonth(), Month.MARCH); - assertEquals(test.getDayOfMonthIndicator(), 20); - assertEquals(test.getDayOfWeek(), DayOfWeek.SUNDAY); - assertEquals(test.getLocalTime(), TIME_0100); - assertEquals(test.isMidnightEndOfDay(), false); - assertEquals(test.getTimeDefinition(), TimeDefinition.WALL); - assertEquals(test.getStandardOffset(), OFFSET_0200); - assertEquals(test.getOffsetBefore(), OFFSET_0200); - assertEquals(test.getOffsetAfter(), OFFSET_0300); + assertEquals(Month.MARCH, test.getMonth()); + assertEquals(20, test.getDayOfMonthIndicator()); + assertEquals(DayOfWeek.SUNDAY, test.getDayOfWeek()); + assertEquals(TIME_0100, test.getLocalTime()); + assertEquals(false, test.isMidnightEndOfDay()); + assertEquals(TimeDefinition.WALL, test.getTimeDefinition()); + assertEquals(OFFSET_0200, test.getStandardOffset()); + assertEquals(OFFSET_0200, test.getOffsetBefore()); + assertEquals(OFFSET_0300, test.getOffsetAfter()); } @Test @@ -187,15 +188,15 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.MARCH, -1, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(test.getMonth(), Month.MARCH); - assertEquals(test.getDayOfMonthIndicator(), -1); - assertEquals(test.getDayOfWeek(), DayOfWeek.SUNDAY); - assertEquals(test.getLocalTime(), TIME_0100); - assertEquals(test.isMidnightEndOfDay(), false); - assertEquals(test.getTimeDefinition(), TimeDefinition.WALL); - assertEquals(test.getStandardOffset(), OFFSET_0200); - assertEquals(test.getOffsetBefore(), OFFSET_0200); - assertEquals(test.getOffsetAfter(), OFFSET_0300); + assertEquals(Month.MARCH, test.getMonth()); + assertEquals(-1, test.getDayOfMonthIndicator()); + assertEquals(DayOfWeek.SUNDAY, test.getDayOfWeek()); + assertEquals(TIME_0100, test.getLocalTime()); + assertEquals(false, test.isMidnightEndOfDay()); + assertEquals(TimeDefinition.WALL, test.getTimeDefinition()); + assertEquals(OFFSET_0200, test.getStandardOffset()); + assertEquals(OFFSET_0200, test.getOffsetBefore()); + assertEquals(OFFSET_0300, test.getOffsetAfter()); } @Test @@ -203,15 +204,15 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(test.getMonth(), Month.MARCH); - assertEquals(test.getDayOfMonthIndicator(), 20); - assertEquals(test.getDayOfWeek(), null); - assertEquals(test.getLocalTime(), TIME_0100); - assertEquals(test.isMidnightEndOfDay(), false); - assertEquals(test.getTimeDefinition(), TimeDefinition.WALL); - assertEquals(test.getStandardOffset(), OFFSET_0200); - assertEquals(test.getOffsetBefore(), OFFSET_0200); - assertEquals(test.getOffsetAfter(), OFFSET_0300); + assertEquals(Month.MARCH, test.getMonth()); + assertEquals(20, test.getDayOfMonthIndicator()); + assertEquals(null, test.getDayOfWeek()); + assertEquals(TIME_0100, test.getLocalTime()); + assertEquals(false, test.isMidnightEndOfDay()); + assertEquals(TimeDefinition.WALL, test.getTimeDefinition()); + assertEquals(OFFSET_0200, test.getStandardOffset()); + assertEquals(OFFSET_0200, test.getOffsetBefore()); + assertEquals(OFFSET_0300, test.getOffsetAfter()); } @@ -225,7 +226,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { OFFSET_0200, OFFSET_0200, OFFSET_0300); ZoneOffsetTransition trans = ZoneOffsetTransition.of( LocalDateTime.of(2000, Month.MARCH, 26, 1, 0), OFFSET_0200, OFFSET_0300); - assertEquals(test.createTransition(2000), trans); + assertEquals(trans, test.createTransition(2000)); } @Test @@ -235,7 +236,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { OFFSET_0200, OFFSET_0300, OFFSET_0200); ZoneOffsetTransition trans = ZoneOffsetTransition.of( LocalDateTime.of(2000, Month.MARCH, 27, 0, 0), OFFSET_0300, OFFSET_0200); - assertEquals(test.createTransition(2000), trans); + assertEquals(trans, test.createTransition(2000)); } @Test @@ -245,7 +246,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { OFFSET_0200, OFFSET_0200, OFFSET_0300); ZoneOffsetTransition trans = ZoneOffsetTransition.of( LocalDateTime.of(2000, Month.MARCH, 26, 1, 0), OFFSET_0200, OFFSET_0300); - assertEquals(test.createTransition(2000), trans); + assertEquals(trans, test.createTransition(2000)); } @Test @@ -255,7 +256,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { OFFSET_0200, OFFSET_0200, OFFSET_0300); ZoneOffsetTransition trans = ZoneOffsetTransition.of( LocalDateTime.of(2000, Month.MARCH, 19, 1, 0), OFFSET_0200, OFFSET_0300); - assertEquals(test.createTransition(2000), trans); + assertEquals(trans, test.createTransition(2000)); } @Test @@ -265,7 +266,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { OFFSET_0200, OFFSET_0200, OFFSET_0300); ZoneOffsetTransition trans = ZoneOffsetTransition.of( LocalDateTime.of(2000, Month.MARCH, 26, 1, 0), OFFSET_0200, OFFSET_0300); - assertEquals(test.createTransition(2000), trans); + assertEquals(trans, test.createTransition(2000)); } @Test @@ -275,7 +276,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { OFFSET_0200, OFFSET_0200, OFFSET_0300); ZoneOffsetTransition trans = ZoneOffsetTransition.of( LocalDateTime.of(2000, Month.MARCH, 20, 1, 0), OFFSET_0200, OFFSET_0300); - assertEquals(test.createTransition(2000), trans); + assertEquals(trans, test.createTransition(2000)); } //----------------------------------------------------------------------- @@ -289,10 +290,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.APRIL, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -303,10 +304,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 21, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -317,10 +318,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SATURDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -331,10 +332,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -345,10 +346,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, LocalTime.MIDNIGHT, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -359,10 +360,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, LocalTime.MIDNIGHT, true, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -373,10 +374,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.STANDARD, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -387,10 +388,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0300, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -401,10 +402,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0300, OFFSET_0300); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -415,10 +416,10 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0200); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), false); - assertEquals(b.equals(a), false); - assertEquals(b.equals(b), true); + assertEquals(true, a.equals(a)); + assertEquals(false, a.equals(b)); + assertEquals(false, b.equals(a)); + assertEquals(true, b.equals(b)); } @Test @@ -426,7 +427,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule a = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals("TZDB"), false); + assertEquals(false, a.equals("TZDB")); } @Test @@ -434,7 +435,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule a = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.equals(null), false); + assertEquals(false, a.equals(null)); } //----------------------------------------------------------------------- @@ -448,7 +449,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.hashCode(), b.hashCode()); + assertEquals(b.hashCode(), a.hashCode()); } @Test @@ -459,7 +460,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.OCTOBER, 20, null, LocalTime.MIDNIGHT, true, TimeDefinition.WALL, OFFSET_0200, OFFSET_0300, OFFSET_0200); - assertEquals(a.hashCode(), b.hashCode()); + assertEquals(b.hashCode(), a.hashCode()); } @Test @@ -470,7 +471,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, -1, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.hashCode(), b.hashCode()); + assertEquals(b.hashCode(), a.hashCode()); } @Test @@ -481,7 +482,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule b = ZoneOffsetTransitionRule.of( Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.STANDARD, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(a.hashCode(), b.hashCode()); + assertEquals(b.hashCode(), a.hashCode()); } //----------------------------------------------------------------------- @@ -492,7 +493,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(test.toString(), "TransitionRule[Gap +02:00 to +03:00, SUNDAY on or after MARCH 20 at 01:00 WALL, standard offset +02:00]"); + assertEquals("TransitionRule[Gap +02:00 to +03:00, SUNDAY on or after MARCH 20 at 01:00 WALL, standard offset +02:00]", test.toString()); } @Test @@ -500,7 +501,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.OCTOBER, 20, DayOfWeek.SUNDAY, LocalTime.MIDNIGHT, true, TimeDefinition.WALL, OFFSET_0200, OFFSET_0300, OFFSET_0200); - assertEquals(test.toString(), "TransitionRule[Overlap +03:00 to +02:00, SUNDAY on or after OCTOBER 20 at 24:00 WALL, standard offset +02:00]"); + assertEquals("TransitionRule[Overlap +03:00 to +02:00, SUNDAY on or after OCTOBER 20 at 24:00 WALL, standard offset +02:00]", test.toString()); } @Test @@ -508,7 +509,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.MARCH, -1, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(test.toString(), "TransitionRule[Gap +02:00 to +03:00, SUNDAY on or before last day of MARCH at 01:00 WALL, standard offset +02:00]"); + assertEquals("TransitionRule[Gap +02:00 to +03:00, SUNDAY on or before last day of MARCH at 01:00 WALL, standard offset +02:00]", test.toString()); } @Test @@ -516,7 +517,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.MARCH, -2, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(test.toString(), "TransitionRule[Gap +02:00 to +03:00, SUNDAY on or before last day minus 1 of MARCH at 01:00 WALL, standard offset +02:00]"); + assertEquals("TransitionRule[Gap +02:00 to +03:00, SUNDAY on or before last day minus 1 of MARCH at 01:00 WALL, standard offset +02:00]", test.toString()); } @Test @@ -524,7 +525,7 @@ public class TCKZoneOffsetTransitionRule extends AbstractTCKTest { ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( Month.MARCH, 20, null, TIME_0100, false, TimeDefinition.STANDARD, OFFSET_0200, OFFSET_0200, OFFSET_0300); - assertEquals(test.toString(), "TransitionRule[Gap +02:00 to +03:00, MARCH 20 at 01:00 STANDARD, standard offset +02:00]"); + assertEquals("TransitionRule[Gap +02:00 to +03:00, MARCH 20 at 01:00 STANDARD, standard offset +02:00]", test.toString()); } } diff --git a/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java b/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java index d44216b69b5..265555a1792 100644 --- a/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java +++ b/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,10 +59,10 @@ */ package tck.java.time.zone; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -88,12 +88,12 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Test ZoneRules. */ -@Test public class TCKZoneRules { private static final ZoneOffset OFFSET_ZERO = ZoneOffset.ofHours(0); @@ -115,7 +115,7 @@ public class TCKZoneRules { @Test public void test_London() { ZoneRules test = europeLondon(); - assertEquals(test.isFixedOffset(), false); + assertEquals(false, test.isFixedOffset()); } @Test @@ -124,60 +124,60 @@ public class TCKZoneRules { ZonedDateTime old = createZDT(1800, 1, 1, ZoneOffset.UTC); Instant instant = old.toInstant(); ZoneOffset offset = ZoneOffset.ofHoursMinutesSeconds(0, -1, -15); - assertEquals(test.getOffset(instant), offset); + assertEquals(offset, test.getOffset(instant)); checkOffset(test, old.toLocalDateTime(), offset, 1); - assertEquals(test.getStandardOffset(instant), offset); - assertEquals(test.getDaylightSavings(instant), Duration.ZERO); - assertEquals(test.isDaylightSavings(instant), false); + assertEquals(offset, test.getStandardOffset(instant)); + assertEquals(Duration.ZERO, test.getDaylightSavings(instant)); + assertEquals(false, test.isDaylightSavings(instant)); } @Test public void test_London_getOffset() { ZoneRules test = europeLondon(); - assertEquals(test.getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC)), OFFSET_ZERO); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC))); } @Test public void test_London_getOffset_toDST() { ZoneRules test = europeLondon(); - assertEquals(test.getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC)), OFFSET_PONE); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_PONE); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC))); } @Test public void test_London_getOffset_fromDST() { ZoneRules test = europeLondon(); - assertEquals(test.getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC)), OFFSET_ZERO); - assertEquals(test.getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC)), OFFSET_ZERO); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_ZERO); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(OFFSET_ZERO, test.getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC))); } @Test @@ -234,17 +234,17 @@ public class TCKZoneRules { ZoneRules test = europeLondon(); final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 1, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test, dateTime, OFFSET_ZERO, GAP); - assertEquals(trans.isGap(), true); - assertEquals(trans.isOverlap(), false); - assertEquals(trans.getOffsetBefore(), OFFSET_ZERO); - assertEquals(trans.getOffsetAfter(), OFFSET_PONE); - assertEquals(trans.getInstant(), createInstant(2008, 3, 30, 1, 0, ZoneOffset.UTC)); - assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(2008, 3, 30, 1, 0)); - assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(2008, 3, 30, 2, 0)); - assertEquals(trans.isValidOffset(OFFSET_ZERO), false); - assertEquals(trans.isValidOffset(OFFSET_PONE), false); - assertEquals(trans.isValidOffset(OFFSET_PTWO), false); - assertEquals(trans.toString(), "Transition[Gap at 2008-03-30T01:00Z to +01:00]"); + assertEquals(true, trans.isGap()); + assertEquals(false, trans.isOverlap()); + assertEquals(OFFSET_ZERO, trans.getOffsetBefore()); + assertEquals(OFFSET_PONE, trans.getOffsetAfter()); + assertEquals(createInstant(2008, 3, 30, 1, 0, ZoneOffset.UTC), trans.getInstant()); + assertEquals(LocalDateTime.of(2008, 3, 30, 1, 0), trans.getDateTimeBefore()); + assertEquals(LocalDateTime.of(2008, 3, 30, 2, 0), trans.getDateTimeAfter()); + assertEquals(false, trans.isValidOffset(OFFSET_ZERO)); + assertEquals(false, trans.isValidOffset(OFFSET_PONE)); + assertEquals(false, trans.isValidOffset(OFFSET_PTWO)); + assertEquals("Transition[Gap at 2008-03-30T01:00Z to +01:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(OFFSET_ZERO)); @@ -252,7 +252,7 @@ public class TCKZoneRules { final ZoneOffsetTransition otherTrans = test.getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } @Test @@ -260,18 +260,18 @@ public class TCKZoneRules { ZoneRules test = europeLondon(); final LocalDateTime dateTime = LocalDateTime.of(2008, 10, 26, 1, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test, dateTime, OFFSET_PONE, OVERLAP); - assertEquals(trans.isGap(), false); - assertEquals(trans.isOverlap(), true); - assertEquals(trans.getOffsetBefore(), OFFSET_PONE); - assertEquals(trans.getOffsetAfter(), OFFSET_ZERO); - assertEquals(trans.getInstant(), createInstant(2008, 10, 26, 1, 0, ZoneOffset.UTC)); - assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(2008, 10, 26, 2, 0)); - assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(2008, 10, 26, 1, 0)); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-1)), false); - assertEquals(trans.isValidOffset(OFFSET_ZERO), true); - assertEquals(trans.isValidOffset(OFFSET_PONE), true); - assertEquals(trans.isValidOffset(OFFSET_PTWO), false); - assertEquals(trans.toString(), "Transition[Overlap at 2008-10-26T02:00+01:00 to Z]"); + assertEquals(false, trans.isGap()); + assertEquals(true, trans.isOverlap()); + assertEquals(OFFSET_PONE, trans.getOffsetBefore()); + assertEquals(OFFSET_ZERO, trans.getOffsetAfter()); + assertEquals(createInstant(2008, 10, 26, 1, 0, ZoneOffset.UTC), trans.getInstant()); + assertEquals(LocalDateTime.of(2008, 10, 26, 2, 0), trans.getDateTimeBefore()); + assertEquals(LocalDateTime.of(2008, 10, 26, 1, 0), trans.getDateTimeAfter()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-1))); + assertEquals(true, trans.isValidOffset(OFFSET_ZERO)); + assertEquals(true, trans.isValidOffset(OFFSET_PONE)); + assertEquals(false, trans.isValidOffset(OFFSET_PTWO)); + assertEquals("Transition[Overlap at 2008-10-26T02:00+01:00 to Z]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(OFFSET_PONE)); @@ -279,7 +279,7 @@ public class TCKZoneRules { final ZoneOffsetTransition otherTrans = test.getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } @Test @@ -289,11 +289,11 @@ public class TCKZoneRules { while (zdt.getYear() < 2010) { Instant instant = zdt.toInstant(); if (zdt.getYear() < 1848) { - assertEquals(test.getStandardOffset(instant), ZoneOffset.ofHoursMinutesSeconds(0, -1, -15)); + assertEquals(ZoneOffset.ofHoursMinutesSeconds(0, -1, -15), test.getStandardOffset(instant)); } else if (zdt.getYear() >= 1969 && zdt.getYear() < 1972) { - assertEquals(test.getStandardOffset(instant), OFFSET_PONE); + assertEquals(OFFSET_PONE, test.getStandardOffset(instant)); } else { - assertEquals(test.getStandardOffset(instant), OFFSET_ZERO); + assertEquals(OFFSET_ZERO, test.getStandardOffset(instant)); } zdt = zdt.plusMonths(6); } @@ -305,19 +305,19 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition first = trans.get(0); - assertEquals(first.getDateTimeBefore(), LocalDateTime.of(1847, 12, 1, 0, 0)); - assertEquals(first.getOffsetBefore(), ZoneOffset.ofHoursMinutesSeconds(0, -1, -15)); - assertEquals(first.getOffsetAfter(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1847, 12, 1, 0, 0), first.getDateTimeBefore()); + assertEquals(ZoneOffset.ofHoursMinutesSeconds(0, -1, -15), first.getOffsetBefore()); + assertEquals(OFFSET_ZERO, first.getOffsetAfter()); ZoneOffsetTransition spring1916 = trans.get(1); - assertEquals(spring1916.getDateTimeBefore(), LocalDateTime.of(1916, 5, 21, 2, 0)); - assertEquals(spring1916.getOffsetBefore(), OFFSET_ZERO); - assertEquals(spring1916.getOffsetAfter(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1916, 5, 21, 2, 0), spring1916.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, spring1916.getOffsetBefore()); + assertEquals(OFFSET_PONE, spring1916.getOffsetAfter()); ZoneOffsetTransition autumn1916 = trans.get(2); - assertEquals(autumn1916.getDateTimeBefore(), LocalDateTime.of(1916, 10, 1, 3, 0)); - assertEquals(autumn1916.getOffsetBefore(), OFFSET_PONE); - assertEquals(autumn1916.getOffsetAfter(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1916, 10, 1, 3, 0), autumn1916.getDateTimeBefore()); + assertEquals(OFFSET_PONE, autumn1916.getOffsetBefore()); + assertEquals(OFFSET_ZERO, autumn1916.getOffsetAfter()); ZoneOffsetTransition zot = null; Iterator it = trans.iterator(); @@ -327,81 +327,81 @@ public class TCKZoneRules { break; } } - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1990, 3, 25, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1990, 3, 25, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1990, 10, 28, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1990, 10, 28, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1991, 3, 31, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1991, 3, 31, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1991, 10, 27, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1991, 10, 27, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1992, 3, 29, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1992, 3, 29, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1992, 10, 25, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1992, 10, 25, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1993, 3, 28, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1993, 3, 28, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1993, 10, 24, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1993, 10, 24, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1994, 3, 27, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1994, 3, 27, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1994, 10, 23, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1994, 10, 23, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1995, 3, 26, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1995, 3, 26, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1995, 10, 22, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1995, 10, 22, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1996, 3, 31, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1996, 3, 31, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1996, 10, 27, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); + assertEquals(LocalDateTime.of(1996, 10, 27, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1997, 3, 30, 1, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_ZERO); + assertEquals(LocalDateTime.of(1997, 3, 30, 1, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_ZERO, zot.getOffsetBefore()); zot = it.next(); - assertEquals(zot.getDateTimeBefore(), LocalDateTime.of(1997, 10, 26, 2, 0)); - assertEquals(zot.getOffsetBefore(), OFFSET_PONE); - assertEquals(it.hasNext(), false); + assertEquals(LocalDateTime.of(1997, 10, 26, 2, 0), zot.getDateTimeBefore()); + assertEquals(OFFSET_PONE, zot.getOffsetBefore()); + assertEquals(false, it.hasNext()); } @Test public void test_London_getTransitionRules() { ZoneRules test = europeLondon(); List rules = test.getTransitionRules(); - assertEquals(rules.size(), 2); + assertEquals(2, rules.size()); ZoneOffsetTransitionRule in = rules.get(0); - assertEquals(in.getMonth(), Month.MARCH); - assertEquals(in.getDayOfMonthIndicator(), 25); // optimized from -1 - assertEquals(in.getDayOfWeek(), DayOfWeek.SUNDAY); - assertEquals(in.getLocalTime(), LocalTime.of(1, 0)); - assertEquals(in.getTimeDefinition(), TimeDefinition.UTC); - assertEquals(in.getStandardOffset(), OFFSET_ZERO); - assertEquals(in.getOffsetBefore(), OFFSET_ZERO); - assertEquals(in.getOffsetAfter(), OFFSET_PONE); + assertEquals(Month.MARCH, in.getMonth()); + assertEquals(25, in.getDayOfMonthIndicator()); // optimized from -1 + assertEquals(DayOfWeek.SUNDAY, in.getDayOfWeek()); + assertEquals(LocalTime.of(1, 0), in.getLocalTime()); + assertEquals(TimeDefinition.UTC, in.getTimeDefinition()); + assertEquals(OFFSET_ZERO, in.getStandardOffset()); + assertEquals(OFFSET_ZERO, in.getOffsetBefore()); + assertEquals(OFFSET_PONE, in.getOffsetAfter()); ZoneOffsetTransitionRule out = rules.get(1); - assertEquals(out.getMonth(), Month.OCTOBER); - assertEquals(out.getDayOfMonthIndicator(), 25); // optimized from -1 - assertEquals(out.getDayOfWeek(), DayOfWeek.SUNDAY); - assertEquals(out.getLocalTime(), LocalTime.of(1, 0)); - assertEquals(out.getTimeDefinition(), TimeDefinition.UTC); - assertEquals(out.getStandardOffset(), OFFSET_ZERO); - assertEquals(out.getOffsetBefore(), OFFSET_PONE); - assertEquals(out.getOffsetAfter(), OFFSET_ZERO); + assertEquals(Month.OCTOBER, out.getMonth()); + assertEquals(25, out.getDayOfMonthIndicator()); // optimized from -1 + assertEquals(DayOfWeek.SUNDAY, out.getDayOfWeek()); + assertEquals(LocalTime.of(1, 0), out.getLocalTime()); + assertEquals(TimeDefinition.UTC, out.getTimeDefinition()); + assertEquals(OFFSET_ZERO, out.getStandardOffset()); + assertEquals(OFFSET_PONE, out.getOffsetBefore()); + assertEquals(OFFSET_ZERO, out.getOffsetAfter()); } //----------------------------------------------------------------------- @@ -411,14 +411,14 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition first = trans.get(0); - assertEquals(test.nextTransition(first.getInstant().minusNanos(1)), first); + assertEquals(first, test.nextTransition(first.getInstant().minusNanos(1))); for (int i = 0; i < trans.size() - 1; i++) { ZoneOffsetTransition cur = trans.get(i); ZoneOffsetTransition next = trans.get(i + 1); - assertEquals(test.nextTransition(cur.getInstant()), next); - assertEquals(test.nextTransition(next.getInstant().minusNanos(1)), next); + assertEquals(next, test.nextTransition(cur.getInstant())); + assertEquals(next, test.nextTransition(next.getInstant().minusNanos(1))); } } @@ -429,18 +429,18 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition last = trans.get(trans.size() - 1); - assertEquals(test.nextTransition(last.getInstant()), rules.get(0).createTransition(1998)); + assertEquals(rules.get(0).createTransition(1998), test.nextTransition(last.getInstant())); for (int year = 1998; year < 2010; year++) { ZoneOffsetTransition a = rules.get(0).createTransition(year); ZoneOffsetTransition b = rules.get(1).createTransition(year); ZoneOffsetTransition c = rules.get(0).createTransition(year + 1); - assertEquals(test.nextTransition(a.getInstant()), b); - assertEquals(test.nextTransition(b.getInstant().minusNanos(1)), b); + assertEquals(b, test.nextTransition(a.getInstant())); + assertEquals(b, test.nextTransition(b.getInstant().minusNanos(1))); - assertEquals(test.nextTransition(b.getInstant()), c); - assertEquals(test.nextTransition(c.getInstant().minusNanos(1)), c); + assertEquals(c, test.nextTransition(b.getInstant())); + assertEquals(c, test.nextTransition(c.getInstant().minusNanos(1))); } } @@ -449,7 +449,7 @@ public class TCKZoneRules { ZoneRules test = europeLondon(); List rules = test.getTransitionRules(); ZoneOffsetTransition zot = rules.get(1).createTransition(Year.MAX_VALUE); - assertEquals(test.nextTransition(zot.getInstant()), null); + assertEquals(null, test.nextTransition(zot.getInstant())); } //----------------------------------------------------------------------- @@ -459,16 +459,16 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition first = trans.get(0); - assertEquals(test.previousTransition(first.getInstant()), null); - assertEquals(test.previousTransition(first.getInstant().minusNanos(1)), null); + assertEquals(null, test.previousTransition(first.getInstant())); + assertEquals(null, test.previousTransition(first.getInstant().minusNanos(1))); for (int i = 0; i < trans.size() - 1; i++) { ZoneOffsetTransition prev = trans.get(i); ZoneOffsetTransition cur = trans.get(i + 1); - assertEquals(test.previousTransition(cur.getInstant()), prev); - assertEquals(test.previousTransition(prev.getInstant().plusSeconds(1)), prev); - assertEquals(test.previousTransition(prev.getInstant().plusNanos(1)), prev); + assertEquals(prev, test.previousTransition(cur.getInstant())); + assertEquals(prev, test.previousTransition(prev.getInstant().plusSeconds(1))); + assertEquals(prev, test.previousTransition(prev.getInstant().plusNanos(1))); } } @@ -479,13 +479,13 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition last = trans.get(trans.size() - 1); - assertEquals(test.previousTransition(last.getInstant().plusSeconds(1)), last); - assertEquals(test.previousTransition(last.getInstant().plusNanos(1)), last); + assertEquals(last, test.previousTransition(last.getInstant().plusSeconds(1))); + assertEquals(last, test.previousTransition(last.getInstant().plusNanos(1))); // Jan 1st of year between transitions and rules ZonedDateTime odt = ZonedDateTime.ofInstant(last.getInstant(), last.getOffsetAfter()); odt = odt.withDayOfYear(1).plusYears(1).with(LocalTime.MIDNIGHT); - assertEquals(test.previousTransition(odt.toInstant()), last); + assertEquals(last, test.previousTransition(odt.toInstant())); // later years for (int year = 1998; year < 2010; year++) { @@ -493,13 +493,13 @@ public class TCKZoneRules { ZoneOffsetTransition b = rules.get(1).createTransition(year); ZoneOffsetTransition c = rules.get(0).createTransition(year + 1); - assertEquals(test.previousTransition(c.getInstant()), b); - assertEquals(test.previousTransition(b.getInstant().plusSeconds(1)), b); - assertEquals(test.previousTransition(b.getInstant().plusNanos(1)), b); + assertEquals(b, test.previousTransition(c.getInstant())); + assertEquals(b, test.previousTransition(b.getInstant().plusSeconds(1))); + assertEquals(b, test.previousTransition(b.getInstant().plusNanos(1))); - assertEquals(test.previousTransition(b.getInstant()), a); - assertEquals(test.previousTransition(a.getInstant().plusSeconds(1)), a); - assertEquals(test.previousTransition(a.getInstant().plusNanos(1)), a); + assertEquals(a, test.previousTransition(b.getInstant())); + assertEquals(a, test.previousTransition(a.getInstant().plusSeconds(1))); + assertEquals(a, test.previousTransition(a.getInstant().plusNanos(1))); } } @@ -513,7 +513,7 @@ public class TCKZoneRules { @Test public void test_Paris() { ZoneRules test = europeParis(); - assertEquals(test.isFixedOffset(), false); + assertEquals(false, test.isFixedOffset()); } @Test @@ -522,60 +522,60 @@ public class TCKZoneRules { ZonedDateTime old = createZDT(1800, 1, 1, ZoneOffset.UTC); Instant instant = old.toInstant(); ZoneOffset offset = ZoneOffset.ofHoursMinutesSeconds(0, 9, 21); - assertEquals(test.getOffset(instant), offset); + assertEquals(offset, test.getOffset(instant)); checkOffset(test, old.toLocalDateTime(), offset, 1); - assertEquals(test.getStandardOffset(instant), offset); - assertEquals(test.getDaylightSavings(instant), Duration.ZERO); - assertEquals(test.isDaylightSavings(instant), false); + assertEquals(offset, test.getStandardOffset(instant)); + assertEquals(Duration.ZERO, test.getDaylightSavings(instant)); + assertEquals(false, test.isDaylightSavings(instant)); } @Test public void test_Paris_getOffset() { ZoneRules test = europeParis(); - assertEquals(test.getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC)), OFFSET_PONE); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC))); } @Test public void test_Paris_getOffset_toDST() { ZoneRules test = europeParis(); - assertEquals(test.getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC)), OFFSET_PTWO); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_PTWO); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC))); } @Test public void test_Paris_getOffset_fromDST() { ZoneRules test = europeParis(); - assertEquals(test.getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC)), OFFSET_PONE); - assertEquals(test.getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC)), OFFSET_PONE); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC))); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC)), OFFSET_PTWO); - assertEquals(test.getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_PONE); + assertEquals(OFFSET_PTWO, test.getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(OFFSET_PONE, test.getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC))); } @Test @@ -632,15 +632,15 @@ public class TCKZoneRules { ZoneRules test = europeParis(); final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 2, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test, dateTime, OFFSET_PONE, GAP); - assertEquals(trans.isGap(), true); - assertEquals(trans.isOverlap(), false); - assertEquals(trans.getOffsetBefore(), OFFSET_PONE); - assertEquals(trans.getOffsetAfter(), OFFSET_PTWO); - assertEquals(trans.getInstant(), createInstant(2008, 3, 30, 1, 0, ZoneOffset.UTC)); - assertEquals(trans.isValidOffset(OFFSET_ZERO), false); - assertEquals(trans.isValidOffset(OFFSET_PONE), false); - assertEquals(trans.isValidOffset(OFFSET_PTWO), false); - assertEquals(trans.toString(), "Transition[Gap at 2008-03-30T02:00+01:00 to +02:00]"); + assertEquals(true, trans.isGap()); + assertEquals(false, trans.isOverlap()); + assertEquals(OFFSET_PONE, trans.getOffsetBefore()); + assertEquals(OFFSET_PTWO, trans.getOffsetAfter()); + assertEquals(createInstant(2008, 3, 30, 1, 0, ZoneOffset.UTC), trans.getInstant()); + assertEquals(false, trans.isValidOffset(OFFSET_ZERO)); + assertEquals(false, trans.isValidOffset(OFFSET_PONE)); + assertEquals(false, trans.isValidOffset(OFFSET_PTWO)); + assertEquals("Transition[Gap at 2008-03-30T02:00+01:00 to +02:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(OFFSET_PONE)); @@ -648,7 +648,7 @@ public class TCKZoneRules { final ZoneOffsetTransition otherTrans = test.getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } @Test @@ -656,16 +656,16 @@ public class TCKZoneRules { ZoneRules test = europeParis(); final LocalDateTime dateTime = LocalDateTime.of(2008, 10, 26, 2, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test, dateTime, OFFSET_PTWO, OVERLAP); - assertEquals(trans.isGap(), false); - assertEquals(trans.isOverlap(), true); - assertEquals(trans.getOffsetBefore(), OFFSET_PTWO); - assertEquals(trans.getOffsetAfter(), OFFSET_PONE); - assertEquals(trans.getInstant(), createInstant(2008, 10, 26, 1, 0, ZoneOffset.UTC)); - assertEquals(trans.isValidOffset(OFFSET_ZERO), false); - assertEquals(trans.isValidOffset(OFFSET_PONE), true); - assertEquals(trans.isValidOffset(OFFSET_PTWO), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(3)), false); - assertEquals(trans.toString(), "Transition[Overlap at 2008-10-26T03:00+02:00 to +01:00]"); + assertEquals(false, trans.isGap()); + assertEquals(true, trans.isOverlap()); + assertEquals(OFFSET_PTWO, trans.getOffsetBefore()); + assertEquals(OFFSET_PONE, trans.getOffsetAfter()); + assertEquals(createInstant(2008, 10, 26, 1, 0, ZoneOffset.UTC), trans.getInstant()); + assertEquals(false, trans.isValidOffset(OFFSET_ZERO)); + assertEquals(true, trans.isValidOffset(OFFSET_PONE)); + assertEquals(true, trans.isValidOffset(OFFSET_PTWO)); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(3))); + assertEquals("Transition[Overlap at 2008-10-26T03:00+02:00 to +01:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(OFFSET_PTWO)); @@ -673,7 +673,7 @@ public class TCKZoneRules { final ZoneOffsetTransition otherTrans = test.getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } @Test @@ -683,15 +683,15 @@ public class TCKZoneRules { while (zdt.getYear() < 2010) { Instant instant = zdt.toInstant(); if (zdt.toLocalDate().isBefore(LocalDate.of(1911, 3, 11))) { - assertEquals(test.getStandardOffset(instant), ZoneOffset.ofHoursMinutesSeconds(0, 9, 21)); + assertEquals(ZoneOffset.ofHoursMinutesSeconds(0, 9, 21), test.getStandardOffset(instant)); } else if (zdt.toLocalDate().isBefore(LocalDate.of(1940, 6, 14))) { - assertEquals(test.getStandardOffset(instant), OFFSET_ZERO); + assertEquals(OFFSET_ZERO, test.getStandardOffset(instant)); } else if (zdt.toLocalDate().isBefore(LocalDate.of(1944, 8, 25))) { - assertEquals(test.getStandardOffset(instant), OFFSET_PONE); + assertEquals(OFFSET_PONE, test.getStandardOffset(instant)); } else if (zdt.toLocalDate().isBefore(LocalDate.of(1945, 9, 16))) { - assertEquals(test.getStandardOffset(instant), OFFSET_ZERO); + assertEquals(OFFSET_ZERO, test.getStandardOffset(instant)); } else { - assertEquals(test.getStandardOffset(instant), OFFSET_PONE); + assertEquals(OFFSET_PONE, test.getStandardOffset(instant)); } zdt = zdt.plusMonths(6); } @@ -707,7 +707,7 @@ public class TCKZoneRules { @Test public void test_NewYork() { ZoneRules test = americaNewYork(); - assertEquals(test.isFixedOffset(), false); + assertEquals(false, test.isFixedOffset()); } @Test @@ -716,73 +716,73 @@ public class TCKZoneRules { ZonedDateTime old = createZDT(1800, 1, 1, ZoneOffset.UTC); Instant instant = old.toInstant(); ZoneOffset offset = ZoneOffset.of("-04:56:02"); - assertEquals(test.getOffset(instant), offset); + assertEquals(offset, test.getOffset(instant)); checkOffset(test, old.toLocalDateTime(), offset, 1); - assertEquals(test.getStandardOffset(instant), offset); - assertEquals(test.getDaylightSavings(instant), Duration.ZERO); - assertEquals(test.isDaylightSavings(instant), false); + assertEquals(offset, test.getStandardOffset(instant)); + assertEquals(Duration.ZERO, test.getDaylightSavings(instant)); + assertEquals(false, test.isDaylightSavings(instant)); } @Test public void test_NewYork_getOffset() { ZoneRules test = americaNewYork(); ZoneOffset offset = ZoneOffset.ofHours(-5); - assertEquals(test.getOffset(createInstant(2008, 1, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 2, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 3, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 4, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 5, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 6, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 7, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 8, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 9, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 10, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 11, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 12, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 1, 28, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 2, 28, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 3, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 4, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 5, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 6, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 7, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 8, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 9, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 10, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 11, 28, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 12, 28, offset)), ZoneOffset.ofHours(-5)); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 1, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 2, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 3, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 4, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 5, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 6, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 7, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 8, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 9, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 10, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 11, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 12, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 1, 28, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 2, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 3, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 4, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 5, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 6, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 7, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 8, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 9, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 10, 28, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 11, 28, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 12, 28, offset))); } @Test public void test_NewYork_getOffset_toDST() { ZoneRules test = americaNewYork(); ZoneOffset offset = ZoneOffset.ofHours(-5); - assertEquals(test.getOffset(createInstant(2008, 3, 8, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 3, 9, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 3, 10, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 3, 11, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 3, 12, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 3, 13, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 3, 14, offset)), ZoneOffset.ofHours(-4)); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 3, 8, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 3, 9, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 3, 10, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 3, 11, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 3, 12, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 3, 13, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 3, 14, offset))); // cutover at 02:00 local - assertEquals(test.getOffset(createInstant(2008, 3, 9, 1, 59, 59, 999999999, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 3, 9, 2, 0, 0, 0, offset)), ZoneOffset.ofHours(-4)); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 3, 9, 1, 59, 59, 999999999, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 3, 9, 2, 0, 0, 0, offset))); } @Test public void test_NewYork_getOffset_fromDST() { ZoneRules test = americaNewYork(); ZoneOffset offset = ZoneOffset.ofHours(-4); - assertEquals(test.getOffset(createInstant(2008, 11, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 11, 2, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 11, 3, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 11, 4, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 11, 5, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 11, 6, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getOffset(createInstant(2008, 11, 7, offset)), ZoneOffset.ofHours(-5)); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 11, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 11, 2, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 11, 3, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 11, 4, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 11, 5, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 11, 6, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 11, 7, offset))); // cutover at 02:00 local - assertEquals(test.getOffset(createInstant(2008, 11, 2, 1, 59, 59, 999999999, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getOffset(createInstant(2008, 11, 2, 2, 0, 0, 0, offset)), ZoneOffset.ofHours(-5)); + assertEquals(ZoneOffset.ofHours(-4), test.getOffset(createInstant(2008, 11, 2, 1, 59, 59, 999999999, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getOffset(createInstant(2008, 11, 2, 2, 0, 0, 0, offset))); } @Test @@ -849,15 +849,15 @@ public class TCKZoneRules { ZoneRules test = americaNewYork(); final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 9, 2, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test, dateTime, ZoneOffset.ofHours(-5), GAP); - assertEquals(trans.isGap(), true); - assertEquals(trans.isOverlap(), false); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(-5)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(-4)); - assertEquals(trans.getInstant(), createInstant(2008, 3, 9, 2, 0, ZoneOffset.ofHours(-5))); - assertEquals(trans.isValidOffset(OFFSET_PTWO), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-5)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-4)), false); - assertEquals(trans.toString(), "Transition[Gap at 2008-03-09T02:00-05:00 to -04:00]"); + assertEquals(true, trans.isGap()); + assertEquals(false, trans.isOverlap()); + assertEquals(ZoneOffset.ofHours(-5), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(-4), trans.getOffsetAfter()); + assertEquals(createInstant(2008, 3, 9, 2, 0, ZoneOffset.ofHours(-5)), trans.getInstant()); + assertEquals(false, trans.isValidOffset(OFFSET_PTWO)); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-5))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-4))); + assertEquals("Transition[Gap at 2008-03-09T02:00-05:00 to -04:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(-5))); @@ -865,7 +865,7 @@ public class TCKZoneRules { final ZoneOffsetTransition otherTrans = test.getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } @Test @@ -873,16 +873,16 @@ public class TCKZoneRules { ZoneRules test = americaNewYork(); final LocalDateTime dateTime = LocalDateTime.of(2008, 11, 2, 1, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test, dateTime, ZoneOffset.ofHours(-4), OVERLAP); - assertEquals(trans.isGap(), false); - assertEquals(trans.isOverlap(), true); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(-4)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(-5)); - assertEquals(trans.getInstant(), createInstant(2008, 11, 2, 2, 0, ZoneOffset.ofHours(-4))); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-1)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-5)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-4)), true); - assertEquals(trans.isValidOffset(OFFSET_PTWO), false); - assertEquals(trans.toString(), "Transition[Overlap at 2008-11-02T02:00-04:00 to -05:00]"); + assertEquals(false, trans.isGap()); + assertEquals(true, trans.isOverlap()); + assertEquals(ZoneOffset.ofHours(-4), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(-5), trans.getOffsetAfter()); + assertEquals(createInstant(2008, 11, 2, 2, 0, ZoneOffset.ofHours(-4)), trans.getInstant()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-1))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(-5))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(-4))); + assertEquals(false, trans.isValidOffset(OFFSET_PTWO)); + assertEquals("Transition[Overlap at 2008-11-02T02:00-04:00 to -05:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(-4))); @@ -890,7 +890,7 @@ public class TCKZoneRules { final ZoneOffsetTransition otherTrans = test.getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } @Test @@ -900,9 +900,9 @@ public class TCKZoneRules { while (dateTime.getYear() < 2010) { Instant instant = dateTime.toInstant(); if (dateTime.toLocalDate().isBefore(LocalDate.of(1883, 11, 18))) { - assertEquals(test.getStandardOffset(instant), ZoneOffset.of("-04:56:02")); + assertEquals(ZoneOffset.of("-04:56:02"), test.getStandardOffset(instant)); } else { - assertEquals(test.getStandardOffset(instant), ZoneOffset.ofHours(-5)); + assertEquals(ZoneOffset.ofHours(-5), test.getStandardOffset(instant)); } dateTime = dateTime.plusMonths(6); } @@ -921,14 +921,14 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition first = trans.get(0); - assertEquals(test.nextTransition(first.getInstant().minusNanos(1)), first); + assertEquals(first, test.nextTransition(first.getInstant().minusNanos(1))); for (int i = 0; i < trans.size() - 1; i++) { ZoneOffsetTransition cur = trans.get(i); ZoneOffsetTransition next = trans.get(i + 1); - assertEquals(test.nextTransition(cur.getInstant()), next); - assertEquals(test.nextTransition(next.getInstant().minusNanos(1)), next); + assertEquals(next, test.nextTransition(cur.getInstant())); + assertEquals(next, test.nextTransition(next.getInstant().minusNanos(1))); } } @@ -938,7 +938,7 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition last = trans.get(trans.size() - 1); - assertEquals(test.nextTransition(last.getInstant()), null); + assertEquals(null, test.nextTransition(last.getInstant())); } //----------------------------------------------------------------------- @@ -954,14 +954,14 @@ public class TCKZoneRules { List trans = test.getTransitions(); ZoneOffsetTransition first = trans.get(0); - assertEquals(test.nextTransition(first.getInstant().minusNanos(1)), first); + assertEquals(first, test.nextTransition(first.getInstant().minusNanos(1))); for (int i = 0; i < trans.size() - 1; i++) { ZoneOffsetTransition cur = trans.get(i); ZoneOffsetTransition next = trans.get(i + 1); - assertEquals(test.nextTransition(cur.getInstant()), next); - assertEquals(test.nextTransition(next.getInstant().minusNanos(1)), next); + assertEquals(next, test.nextTransition(cur.getInstant())); + assertEquals(next, test.nextTransition(next.getInstant().minusNanos(1))); } } @@ -971,17 +971,17 @@ public class TCKZoneRules { ZoneRules test = pacificApia(); Instant instantBefore = LocalDate.of(2011, 12, 27).atStartOfDay(ZoneOffset.UTC).toInstant(); ZoneOffsetTransition trans = test.nextTransition(instantBefore); - assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(2011, 12, 30, 0, 0)); - assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(2011, 12, 31, 0, 0)); - assertEquals(trans.isGap(), true); - assertEquals(trans.isOverlap(), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-10)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(+14)), false); - assertEquals(trans.getDuration(), Duration.ofHours(24)); - assertEquals(trans.getInstant(), LocalDateTime.of(2011, 12, 31, 0, 0).toInstant(ZoneOffset.ofHours(+14))); + assertEquals(LocalDateTime.of(2011, 12, 30, 0, 0), trans.getDateTimeBefore()); + assertEquals(LocalDateTime.of(2011, 12, 31, 0, 0), trans.getDateTimeAfter()); + assertEquals(true, trans.isGap()); + assertEquals(false, trans.isOverlap()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-10))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(+14))); + assertEquals(Duration.ofHours(24), trans.getDuration()); + assertEquals(LocalDateTime.of(2011, 12, 31, 0, 0).toInstant(ZoneOffset.ofHours(+14)), trans.getInstant()); ZonedDateTime zdt = ZonedDateTime.of(2011, 12, 29, 23, 0, 0, 0, ZoneId.of("Pacific/Apia")); - assertEquals(zdt.plusHours(2).toLocalDateTime(), LocalDateTime.of(2011, 12, 31, 1, 0)); + assertEquals(LocalDateTime.of(2011, 12, 31, 1, 0), zdt.plusHours(2).toLocalDateTime()); } @Test @@ -990,30 +990,34 @@ public class TCKZoneRules { ZoneRules test = pacificApia(); Instant instantBefore = LocalDate.of(1892, 7, 2).atStartOfDay(ZoneOffset.UTC).toInstant(); ZoneOffsetTransition trans = test.nextTransition(instantBefore); - assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(1892, 7, 5, 0, 0)); - assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(1892, 7, 4, 0, 0)); - assertEquals(trans.isGap(), false); - assertEquals(trans.isOverlap(), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(+12, 33, 4)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)), true); - assertEquals(trans.getDuration(), Duration.ofHours(-24)); - assertEquals(trans.getInstant(), LocalDateTime.of(1892, 7, 4, 0, 0).toInstant(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56))); + assertEquals(LocalDateTime.of(1892, 7, 5, 0, 0), trans.getDateTimeBefore()); + assertEquals(LocalDateTime.of(1892, 7, 4, 0, 0), trans.getDateTimeAfter()); + assertEquals(false, trans.isGap()); + assertEquals(true, trans.isOverlap()); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(+12, 33, 4))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56))); + assertEquals(Duration.ofHours(-24), trans.getDuration()); + assertEquals(LocalDateTime.of(1892, 7, 4, 0, 0).toInstant(ZoneOffset.ofHoursMinutesSeconds(-11, -26, -56)), trans.getInstant()); ZonedDateTime zdt = ZonedDateTime.of(1892, 7, 4, 23, 0, 0, 0, ZoneId.of("Pacific/Apia")); - assertEquals(zdt.plusHours(2).toLocalDateTime(), LocalDateTime.of(1892, 7, 4, 1, 0, 0)); + assertEquals(LocalDateTime.of(1892, 7, 4, 1, 0, 0), zdt.plusHours(2).toLocalDateTime()); } //------------------------------------------------------------------------- - @Test(expectedExceptions=UnsupportedOperationException.class) + @Test public void test_getTransitions_immutable() { - ZoneRules test = europeParis(); - test.getTransitions().clear(); + Assertions.assertThrows(UnsupportedOperationException.class, () -> { + ZoneRules test = europeParis(); + test.getTransitions().clear(); + }); } - @Test(expectedExceptions=UnsupportedOperationException.class) + @Test public void test_getTransitionRules_immutable() { - ZoneRules test = europeParis(); - test.getTransitionRules().clear(); + Assertions.assertThrows(UnsupportedOperationException.class, () -> { + ZoneRules test = europeParis(); + test.getTransitionRules().clear(); + }); } //----------------------------------------------------------------------- @@ -1073,23 +1077,23 @@ public class TCKZoneRules { OffsetDateTime before_time_of_stdOffsetTransition1 = OffsetDateTime.of(time_of_stdOffsetTransition1, stdOffset1).minusSeconds(1); OffsetDateTime after_time_of_stdOffsetTransition1 = OffsetDateTime.of(time_of_stdOffsetTransition1, stdOffset1).plusSeconds(1); - assertEquals(zoneRule.getStandardOffset(before_time_of_stdOffsetTransition1.toInstant()), stdOffset1); - assertEquals(zoneRule.getStandardOffset(after_time_of_stdOffsetTransition1.toInstant()), stdOffset2); + assertEquals(stdOffset1, zoneRule.getStandardOffset(before_time_of_stdOffsetTransition1.toInstant())); + assertEquals(stdOffset2, zoneRule.getStandardOffset(after_time_of_stdOffsetTransition1.toInstant())); OffsetDateTime before_time_of_wallOffsetTransition1 = OffsetDateTime.of(time_of_wallOffsetTransition1, wallOffset1).minusSeconds(1); OffsetDateTime after_time_of_wallOffsetTransition1 = OffsetDateTime.of(time_of_wallOffsetTransition1, wallOffset1).plusSeconds(1); - assertEquals(zoneRule.nextTransition(before_time_of_wallOffsetTransition1.toInstant()), wallOffsetTransition1); - assertEquals(zoneRule.nextTransition(after_time_of_wallOffsetTransition1.toInstant()), wallOffsetTransition2); + assertEquals(wallOffsetTransition1, zoneRule.nextTransition(before_time_of_wallOffsetTransition1.toInstant())); + assertEquals(wallOffsetTransition2, zoneRule.nextTransition(after_time_of_wallOffsetTransition1.toInstant())); OffsetDateTime before_time_of_wallOffsetTransition2 = OffsetDateTime.of(time_of_wallOffsetTransition2, wallOffset2).minusSeconds(1); OffsetDateTime after_time_of_wallOffsetTransition2 = OffsetDateTime.of(time_of_wallOffsetTransition2, wallOffset2).plusSeconds(1); - assertEquals(zoneRule.nextTransition(before_time_of_wallOffsetTransition2.toInstant()), wallOffsetTransition2); - assertEquals(zoneRule.nextTransition(after_time_of_wallOffsetTransition2.toInstant()), wallOffsetTransition3); + assertEquals(wallOffsetTransition2, zoneRule.nextTransition(before_time_of_wallOffsetTransition2.toInstant())); + assertEquals(wallOffsetTransition3, zoneRule.nextTransition(after_time_of_wallOffsetTransition2.toInstant())); OffsetDateTime before_time_of_wallOffsetTransition3 = OffsetDateTime.of(time_of_wallOffsetTransition3, wallOffset3).minusSeconds(1); OffsetDateTime after_time_of_wallOffsetTransition3 = OffsetDateTime.of(time_of_wallOffsetTransition3, wallOffset3).plusSeconds(1); - assertEquals(zoneRule.nextTransition(before_time_of_wallOffsetTransition3.toInstant()), wallOffsetTransition3); - assertEquals(zoneRule.nextTransition(after_time_of_wallOffsetTransition3.toInstant()), rule1.createTransition(2014)); + assertEquals(wallOffsetTransition3, zoneRule.nextTransition(before_time_of_wallOffsetTransition3.toInstant())); + assertEquals(rule1.createTransition(2014), zoneRule.nextTransition(after_time_of_wallOffsetTransition3.toInstant())); } //----------------------------------------------------------------------- @@ -1100,31 +1104,31 @@ public class TCKZoneRules { ZoneRules test1 = europeLondon(); ZoneRules test2 = europeParis(); ZoneRules test2b = europeParis(); - assertEquals(test1.equals(test2), false); - assertEquals(test2.equals(test1), false); + assertEquals(false, test1.equals(test2)); + assertEquals(false, test2.equals(test1)); - assertEquals(test1.equals(test1), true); - assertEquals(test2.equals(test2), true); - assertEquals(test2.equals(test2b), true); + assertEquals(true, test1.equals(test1)); + assertEquals(true, test2.equals(test2)); + assertEquals(true, test2.equals(test2b)); - assertEquals(test1.hashCode() == test1.hashCode(), true); - assertEquals(test2.hashCode() == test2.hashCode(), true); - assertEquals(test2.hashCode() == test2b.hashCode(), true); + assertEquals(true, test1.hashCode() == test1.hashCode()); + assertEquals(true, test2.hashCode() == test2.hashCode()); + assertEquals(true, test2.hashCode() == test2b.hashCode()); } @Test public void test_equals_null() { - assertEquals(europeLondon().equals(null), false); + assertEquals(false, europeLondon().equals(null)); } @Test public void test_equals_notZoneRules() { - assertEquals(europeLondon().equals("Europe/London"), false); + assertEquals(false, europeLondon().equals("Europe/London")); } @Test public void test_toString() { - assertEquals(europeLondon().toString().contains("ZoneRules"), true); + assertEquals(true, europeLondon().toString().contains("ZoneRules")); } //----------------------------------------------------------------------- @@ -1152,17 +1156,17 @@ public class TCKZoneRules { private ZoneOffsetTransition checkOffset(ZoneRules rules, LocalDateTime dateTime, ZoneOffset offset, int type) { List validOffsets = rules.getValidOffsets(dateTime); - assertEquals(validOffsets.size(), type); - assertEquals(rules.getOffset(dateTime), offset); + assertEquals(type, validOffsets.size()); + assertEquals(offset, rules.getOffset(dateTime)); if (type == 1) { - assertEquals(validOffsets.get(0), offset); + assertEquals(offset, validOffsets.get(0)); return null; } else { ZoneOffsetTransition zot = rules.getTransition(dateTime); assertNotNull(zot); - assertEquals(zot.isOverlap(), type == 2); - assertEquals(zot.isGap(), type == 0); - assertEquals(zot.isValidOffset(offset), type == 2); + assertEquals(type == 2, zot.isOverlap()); + assertEquals(type == 0, zot.isGap()); + assertEquals(type == 2, zot.isValidOffset(offset)); return zot; } } diff --git a/test/jdk/java/time/tck/java/time/zone/TCKZoneRulesProvider.java b/test/jdk/java/time/tck/java/time/zone/TCKZoneRulesProvider.java index f51bb396f50..32b1a688b54 100644 --- a/test/jdk/java/time/tck/java/time/zone/TCKZoneRulesProvider.java +++ b/test/jdk/java/time/tck/java/time/zone/TCKZoneRulesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,9 +59,9 @@ */ package tck.java.time.zone; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.ZoneId; import java.time.ZoneOffset; @@ -74,12 +74,12 @@ import java.util.NavigableMap; import java.util.Set; import java.util.TreeMap; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Test ZoneRulesProvider. */ -@Test public class TCKZoneRulesProvider { private static String TZDB_VERSION = "2012i"; @@ -90,12 +90,12 @@ public class TCKZoneRulesProvider { @Test public void test_getAvailableGroupIds() { Set zoneIds = ZoneRulesProvider.getAvailableZoneIds(); - assertEquals(zoneIds.contains("Europe/London"), true); + assertEquals(true, zoneIds.contains("Europe/London")); } - @Test(expectedExceptions=UnsupportedOperationException.class) + @Test public void test_getAvailableGroupIds_modifyZoneId() { - ZoneRulesProvider.getAvailableZoneIds().clear(); + Assertions.assertThrows(UnsupportedOperationException.class, () -> ZoneRulesProvider.getAvailableZoneIds().clear()); } //----------------------------------------------------------------------- @@ -106,17 +106,17 @@ public class TCKZoneRulesProvider { ZoneRules rules = ZoneRulesProvider.getRules("Europe/London", false); assertNotNull(rules); ZoneRules rules2 = ZoneRulesProvider.getRules("Europe/London", false); - assertEquals(rules2, rules); + assertEquals(rules, rules2); } - @Test(expectedExceptions=ZoneRulesException.class) + @Test public void test_getRules_StringBoolean_unknownId() { - ZoneRulesProvider.getRules("Europe/Lon", false); + Assertions.assertThrows(ZoneRulesException.class, () -> ZoneRulesProvider.getRules("Europe/Lon", false)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_getRules_StringBoolean_null() { - ZoneRulesProvider.getRules(null, false); + Assertions.assertThrows(NullPointerException.class, () -> ZoneRulesProvider.getRules(null, false)); } @Test @@ -124,13 +124,13 @@ public class TCKZoneRulesProvider { MockDynamicProvider dynamicProvider = new MockDynamicProvider(); ZoneRulesProvider.registerProvider(dynamicProvider); - assertEquals(dynamicProvider.count, 0); + assertEquals(0, dynamicProvider.count); ZoneRules rules1 = ZoneId.of("DynamicLocation").getRules(); - assertEquals(dynamicProvider.count, 2); - assertEquals(rules1, dynamicProvider.BASE); + assertEquals(2, dynamicProvider.count); + assertEquals(dynamicProvider.BASE, rules1); ZoneRules rules2 = ZoneId.of("DynamicLocation").getRules(); - assertEquals(dynamicProvider.count, 4); - assertEquals(rules2, dynamicProvider.ALTERNATE); + assertEquals(4, dynamicProvider.count); + assertEquals(dynamicProvider.ALTERNATE, rules2); } //----------------------------------------------------------------------- @@ -141,23 +141,23 @@ public class TCKZoneRulesProvider { NavigableMap versions = ZoneRulesProvider.getVersions("Europe/London"); assertTrue(versions.size() >= 1); ZoneRules rules = ZoneRulesProvider.getRules("Europe/London", false); - assertEquals(versions.lastEntry().getValue(), rules); + assertEquals(rules, versions.lastEntry().getValue()); NavigableMap copy = new TreeMap<>(versions); versions.clear(); - assertEquals(versions.size(), 0); + assertEquals(0, versions.size()); NavigableMap versions2 = ZoneRulesProvider.getVersions("Europe/London"); - assertEquals(versions2, copy); + assertEquals(copy, versions2); } - @Test(expectedExceptions=ZoneRulesException.class) + @Test public void test_getVersions_String_unknownId() { - ZoneRulesProvider.getVersions("Europe/Lon"); + Assertions.assertThrows(ZoneRulesException.class, () -> ZoneRulesProvider.getVersions("Europe/Lon")); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_getVersions_String_null() { - ZoneRulesProvider.getVersions(null); + Assertions.assertThrows(NullPointerException.class, () -> ZoneRulesProvider.getVersions(null)); } //----------------------------------------------------------------------- @@ -165,7 +165,7 @@ public class TCKZoneRulesProvider { //----------------------------------------------------------------------- @Test public void test_refresh() { - assertEquals(ZoneRulesProvider.refresh(), false); + assertEquals(false, ZoneRulesProvider.refresh()); } //----------------------------------------------------------------------- @@ -174,12 +174,12 @@ public class TCKZoneRulesProvider { @Test public void test_registerProvider() { Set pre = ZoneRulesProvider.getAvailableZoneIds(); - assertEquals(pre.contains("FooLocation"), false); + assertEquals(false, pre.contains("FooLocation")); ZoneRulesProvider.registerProvider(new MockTempProvider()); - assertEquals(pre.contains("FooLocation"), false); + assertEquals(false, pre.contains("FooLocation")); Set post = ZoneRulesProvider.getAvailableZoneIds(); - assertEquals(post.contains("FooLocation"), true); - assertEquals(ZoneRulesProvider.getRules("FooLocation", false), ZoneOffset.of("+01:45").getRules()); + assertEquals(true, post.contains("FooLocation")); + assertEquals(ZoneOffset.of("+01:45").getRules(), ZoneRulesProvider.getRules("FooLocation", false)); } static class MockTempProvider extends ZoneRulesProvider { diff --git a/test/jdk/java/time/tck/java/time/zone/serial/TCKFixedZoneRulesSerialization.java b/test/jdk/java/time/tck/java/time/zone/serial/TCKFixedZoneRulesSerialization.java index 790e54fbb6d..719d5aab5f7 100644 --- a/test/jdk/java/time/tck/java/time/zone/serial/TCKFixedZoneRulesSerialization.java +++ b/test/jdk/java/time/tck/java/time/zone/serial/TCKFixedZoneRulesSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,8 +59,6 @@ */ package tck.java.time.zone.serial; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -69,12 +67,15 @@ import java.io.ObjectOutputStream; import java.time.ZoneOffset; import java.time.zone.ZoneRules; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test serialization of ZoneRules for fixed offset time-zones. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TCKFixedZoneRulesSerialization { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); @@ -85,7 +86,6 @@ public class TCKFixedZoneRulesSerialization { return offset.getRules(); } - @DataProvider(name="rules") Object[][] data_rules() { return new Object[][] { {make(OFFSET_PONE), OFFSET_PONE}, @@ -97,7 +97,8 @@ public class TCKFixedZoneRulesSerialization { //----------------------------------------------------------------------- // Basics //----------------------------------------------------------------------- - @Test(dataProvider="rules") + @ParameterizedTest + @MethodSource("data_rules") public void test_serialization(ZoneRules test, ZoneOffset expectedOffset) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(baos); @@ -109,8 +110,8 @@ public class TCKFixedZoneRulesSerialization { ObjectInputStream in = new ObjectInputStream(bais); ZoneRules result = (ZoneRules) in.readObject(); - assertEquals(result, test); - assertEquals(result.getClass(), test.getClass()); + assertEquals(test, result); + assertEquals(test.getClass(), result.getClass()); } diff --git a/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionRuleSerialization.java b/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionRuleSerialization.java index 42796f66f8f..ded4772cd9f 100644 --- a/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionRuleSerialization.java +++ b/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionRuleSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -66,13 +66,13 @@ import java.time.ZoneOffset; import java.time.zone.ZoneOffsetTransitionRule; import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; + import tck.java.time.AbstractTCKTest; /** * Test ZoneOffsetTransitionRule serialization. */ -@Test public class TCKZoneOffsetTransitionRuleSerialization extends AbstractTCKTest { private static final LocalTime TIME_0100 = LocalTime.of(1, 0); diff --git a/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionSerialization.java b/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionSerialization.java index 01ffefe09df..b6ae7dae76b 100644 --- a/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionSerialization.java +++ b/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneOffsetTransitionSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -62,7 +62,6 @@ package tck.java.time.zone.serial; import static java.time.temporal.ChronoUnit.HOURS; import java.time.Duration; -import org.testng.annotations.Test; import tck.java.time.AbstractTCKTest; import java.time.LocalDateTime; @@ -70,10 +69,11 @@ import java.time.Year; import java.time.ZoneOffset; import java.time.zone.ZoneOffsetTransition; +import org.junit.jupiter.api.Test; + /** * Test serialization of ZoneOffsetTransition. */ -@Test public class TCKZoneOffsetTransitionSerialization extends AbstractTCKTest { private static final ZoneOffset OFFSET_0200 = ZoneOffset.ofHours(2); diff --git a/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneRulesSerialization.java b/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneRulesSerialization.java index 5262d68eea0..1ba549ba916 100644 --- a/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneRulesSerialization.java +++ b/test/jdk/java/time/tck/java/time/zone/serial/TCKZoneRulesSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,7 +59,6 @@ */ package tck.java.time.zone.serial; -import org.testng.annotations.Test; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -68,16 +67,17 @@ import java.io.ObjectOutputStream; import java.time.ZoneId; import java.time.zone.ZoneRules; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; import tck.java.time.AbstractTCKTest; /** * Test serialization of ZoneRules. */ -@Test public class TCKZoneRulesSerialization extends AbstractTCKTest{ + @Test public void test_serialization_loaded() throws Exception { assertSerialization(europeLondon()); assertSerialization(europeParis()); @@ -95,7 +95,7 @@ public class TCKZoneRulesSerialization extends AbstractTCKTest{ ObjectInputStream in = new ObjectInputStream(bais); ZoneRules result = (ZoneRules) in.readObject(); - assertEquals(result, test); + assertEquals(test, result); } //----------------------------------------------------------------------- diff --git a/test/jdk/java/time/test/TEST.properties b/test/jdk/java/time/test/TEST.properties index 4cc5775e862..e2ecb3e5dc3 100644 --- a/test/jdk/java/time/test/TEST.properties +++ b/test/jdk/java/time/test/TEST.properties @@ -1,5 +1,5 @@ -# java.time tests use TestNG -TestNG.dirs = .. +# java.time tests use JUnit +JUnit.dirs = .. othervm.dirs = java/time lib.dirs = /test/lib /test/jdk/tools/lib lib.build = jdk.test.lib.RandomFactory diff --git a/test/jdk/java/time/test/java/time/AbstractTest.java b/test/jdk/java/time/test/java/time/AbstractTest.java index 6e4734b8e4c..2a117011533 100644 --- a/test/jdk/java/time/test/java/time/AbstractTest.java +++ b/test/jdk/java/time/test/java/time/AbstractTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,9 +59,7 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/test/jdk/java/time/test/java/time/TestClock_Fixed.java b/test/jdk/java/time/test/java/time/TestClock_Fixed.java index cf07ceea07b..1c82a092c6a 100644 --- a/test/jdk/java/time/test/java/time/TestClock_Fixed.java +++ b/test/jdk/java/time/test/java/time/TestClock_Fixed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,8 +59,8 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.time.Clock; import java.time.Instant; @@ -68,18 +68,18 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test fixed clock. */ -@Test public class TestClock_Fixed { private static final ZoneId PARIS = ZoneId.of("Europe/Paris"); private static final Instant INSTANT = LocalDateTime.of(2008, 6, 30, 11, 30, 10, 500).atZone(ZoneOffset.ofHours(2)).toInstant(); //------------------------------------------------------------------------- + @Test public void test_withZone_same() { Clock test = Clock.fixed(INSTANT, PARIS); Clock changed = test.withZone(PARIS); @@ -87,9 +87,10 @@ public class TestClock_Fixed { } //----------------------------------------------------------------------- + @Test public void test_toString() { Clock test = Clock.fixed(INSTANT, PARIS); - assertEquals(test.toString(), "FixedClock[2008-06-30T09:30:10.000000500Z,Europe/Paris]"); + assertEquals("FixedClock[2008-06-30T09:30:10.000000500Z,Europe/Paris]", test.toString()); } } diff --git a/test/jdk/java/time/test/java/time/TestClock_Offset.java b/test/jdk/java/time/test/java/time/TestClock_Offset.java index ed62300e681..03fc2974955 100644 --- a/test/jdk/java/time/test/java/time/TestClock_Offset.java +++ b/test/jdk/java/time/test/java/time/TestClock_Offset.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,25 +59,25 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.time.Clock; import java.time.Duration; import java.time.ZoneId; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test offset clock. */ -@Test public class TestClock_Offset { private static final ZoneId PARIS = ZoneId.of("Europe/Paris"); private static final Duration OFFSET = Duration.ofSeconds(2); //------------------------------------------------------------------------- + @Test public void test_withZone_same() { Clock test = Clock.offset(Clock.system(PARIS), OFFSET); Clock changed = test.withZone(PARIS); @@ -85,9 +85,10 @@ public class TestClock_Offset { } //----------------------------------------------------------------------- + @Test public void test_toString() { Clock test = Clock.offset(Clock.systemUTC(), OFFSET); - assertEquals(test.toString(), "OffsetClock[SystemClock[Z],PT2S]"); + assertEquals("OffsetClock[SystemClock[Z],PT2S]", test.toString()); } } diff --git a/test/jdk/java/time/test/java/time/TestClock_System.java b/test/jdk/java/time/test/java/time/TestClock_System.java index 05d235e3b3c..4d685e78cc1 100644 --- a/test/jdk/java/time/test/java/time/TestClock_System.java +++ b/test/jdk/java/time/test/java/time/TestClock_System.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,8 +59,8 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.lang.reflect.Field; import java.time.Clock; @@ -68,18 +68,21 @@ import java.time.Instant; import java.time.ZoneId; import java.time.ZoneOffset; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test system clock. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestClock_System { private static final ZoneId PARIS = ZoneId.of("Europe/Paris"); private static final Clock systemUTC = Clock.systemUTC(); + @Test public void test_withZone_same() { Clock test = Clock.system(PARIS); Clock changed = test.withZone(PARIS); @@ -87,13 +90,13 @@ public class TestClock_System { } //----------------------------------------------------------------------- + @Test public void test_toString() { Clock test = Clock.system(PARIS); - assertEquals(test.toString(), "SystemClock[Europe/Paris]"); + assertEquals("SystemClock[Europe/Paris]", test.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="sampleSystemUTC") Object[][] provider_sampleSystemUTC() { return new Object[][] { {"Clock.systemUTC()#1", Clock.systemUTC()}, @@ -104,7 +107,8 @@ public class TestClock_System { } // Test for 8073394 - @Test(dataProvider="sampleSystemUTC") + @ParameterizedTest + @MethodSource("provider_sampleSystemUTC") public void test_systemUTC(String s, Clock clock) { if (clock != systemUTC) { throw new RuntimeException("Unexpected clock instance for " + s + ": " @@ -126,6 +130,7 @@ public class TestClock_System { + time.getNano(); } + @Test public void test_ClockResolution() { Clock highestUTC = Clock.systemUTC(); @@ -392,6 +397,7 @@ public class TestClock_System { } } + @Test public void test_OffsetRegular() throws IllegalAccessException { System.out.println("*** Testing regular cases ***"); SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000", @@ -402,6 +408,7 @@ public class TestClock_System { System.currentTimeMillis()/1000 + 1024); } + @Test public void test_OffsetLimits() throws IllegalAccessException { System.out.println("*** Testing limits ***"); SystemClockOffset.testWithOffset("System.currentTimeMillis()/1000 - MAX_OFFSET + 1", diff --git a/test/jdk/java/time/test/java/time/TestClock_Tick.java b/test/jdk/java/time/test/java/time/TestClock_Tick.java index 53e27541764..5e23ed74ca2 100644 --- a/test/jdk/java/time/test/java/time/TestClock_Tick.java +++ b/test/jdk/java/time/test/java/time/TestClock_Tick.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,8 +59,8 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.time.Clock; import java.time.Duration; @@ -69,12 +69,11 @@ import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test tick clock. */ -@Test public class TestClock_Tick { private static final ZoneId MOSCOW = ZoneId.of("Europe/Moscow"); @@ -82,6 +81,7 @@ public class TestClock_Tick { private static final ZonedDateTime ZDT = LocalDateTime.of(2008, 6, 30, 11, 30, 10, 500).atZone(ZoneOffset.ofHours(2)); //------------------------------------------------------------------------- + @Test public void test_withZone_same() { Clock test = Clock.tick(Clock.system(PARIS), Duration.ofMillis(500)); Clock changed = test.withZone(PARIS); @@ -89,14 +89,16 @@ public class TestClock_Tick { } //----------------------------------------------------------------------- + @Test public void test_toString() { Clock test = Clock.tick(Clock.systemUTC(), Duration.ofMillis(500)); - assertEquals(test.toString(), "TickClock[SystemClock[Z],PT0.5S]"); + assertEquals("TickClock[SystemClock[Z],PT0.5S]", test.toString()); } //----------------------------------------------------------------------- // Ensure divide-by-zero will not be thrown // @bug 8310232 + @Test public void test_millis() { var test = Clock.tick(Clock.systemUTC(), Duration.ofNanos(1000)); test.millis(); diff --git a/test/jdk/java/time/test/java/time/TestDuration.java b/test/jdk/java/time/test/java/time/TestDuration.java index 2b2043377f3..37147687511 100644 --- a/test/jdk/java/time/test/java/time/TestDuration.java +++ b/test/jdk/java/time/test/java/time/TestDuration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,18 +59,16 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.time.Duration; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test Duration. */ -@Test public class TestDuration extends AbstractTest { //----------------------------------------------------------------------- @@ -187,14 +185,14 @@ public class TestDuration extends AbstractTest { for (int j = 0; j < durations.length; j++) { Duration b = durations[j]; if (i < j) { - assertEquals(a.compareTo(b)< 0, true, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(true, a.compareTo(b)< 0, a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else if (i > j) { - assertEquals(a.compareTo(b) > 0, true, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(true, a.compareTo(b) > 0, a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else { - assertEquals(a.compareTo(b), 0, a + " <=> " + b); - assertEquals(a.equals(b), true, a + " <=> " + b); + assertEquals(0, a.compareTo(b), a + " <=> " + b); + assertEquals(true, a.equals(b), a + " <=> " + b); } } } diff --git a/test/jdk/java/time/test/java/time/TestInstant.java b/test/jdk/java/time/test/java/time/TestInstant.java index 8dbd951bde1..40f3138ac28 100644 --- a/test/jdk/java/time/test/java/time/TestInstant.java +++ b/test/jdk/java/time/test/java/time/TestInstant.java @@ -66,16 +66,18 @@ import java.time.ZoneOffset; import java.time.format.DateTimeParseException; import java.time.temporal.ChronoUnit; -import org.testng.annotations.Test; -import org.testng.annotations.DataProvider; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test Instant. * @bug 8273369 8331202 8364752 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestInstant extends AbstractTest { @Test @@ -83,7 +85,6 @@ public class TestInstant extends AbstractTest { assertImmutable(Instant.class); } - @DataProvider(name="sampleEpochMillis") private Object[][] provider_sampleEpochMillis() { return new Object[][] { {"Long.MAX_VALUE", Long.MAX_VALUE}, @@ -96,11 +97,12 @@ public class TestInstant extends AbstractTest { }; } - @Test(dataProvider="sampleEpochMillis") + @ParameterizedTest + @MethodSource("provider_sampleEpochMillis") public void test_epochMillis(String name, long millis) { Instant t1 = Instant.ofEpochMilli(millis); long m = t1.toEpochMilli(); - assertEquals(millis, m, name); + assertEquals(m, millis, name); } /** @@ -113,7 +115,7 @@ public class TestInstant extends AbstractTest { var nanoMax = Instant.EPOCH.plusNanos(Long.MAX_VALUE); var totalMicros = Instant.EPOCH.until(nanoMax, ChronoUnit.MICROS); var plusOneMicro = Instant.EPOCH.until(nanoMax.plusNanos(1000), ChronoUnit.MICROS); - assertEquals(plusOneMicro - totalMicros, 1L); + assertEquals(1L, plusOneMicro - totalMicros); } /** @@ -122,11 +124,10 @@ public class TestInstant extends AbstractTest { */ @Test public void test_millisUntil() { - assertEquals(Instant.MIN.until(Instant.MIN.plusSeconds(1), ChronoUnit.MILLIS), 1000L); - assertEquals(Instant.MAX.plusSeconds(-1).until(Instant.MAX, ChronoUnit.MILLIS), 1000L); + assertEquals(1000L, Instant.MIN.until(Instant.MIN.plusSeconds(1), ChronoUnit.MILLIS)); + assertEquals(1000L, Instant.MAX.plusSeconds(-1).until(Instant.MAX, ChronoUnit.MILLIS)); } - @DataProvider private Object[][] provider_until_1arg() { Instant t1 = Instant.ofEpochSecond(0, 10); Instant t2 = Instant.ofEpochSecond(10, -20); @@ -138,24 +139,22 @@ public class TestInstant extends AbstractTest { }; } - @Test(dataProvider = "provider_until_1arg") + @ParameterizedTest + @MethodSource("provider_until_1arg") public void test_until_1arg(Instant start, Instant end) { Duration result = start.until(end); Duration expected = Duration.ofSeconds(end.getEpochSecond() - start.getEpochSecond(), end.getNano() - start.getNano()); - assertEquals(result, expected); + assertEquals(expected, result); expected = Duration.between(start, end); - assertEquals(result, expected); + assertEquals(expected, result); } @Test public void test_until_1arg_NPE() { - assertThrows(NullPointerException.class, () -> { - Instant.now().until(null); - }); + assertThrows(NullPointerException.class, () -> Instant.now().until(null)); } - @DataProvider private Object[][] valid_instants() { var I1 = OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.of("+02")).toInstant(); var I2 = OffsetDateTime.of(2017, 1, 1, 0, 0, 0, 0, ZoneOffset.of("+02:02")).toInstant(); @@ -178,12 +177,12 @@ public class TestInstant extends AbstractTest { }; } - @Test(dataProvider = "valid_instants") + @ParameterizedTest + @MethodSource("valid_instants") public void test_parse_valid(String instant, Instant expected) { - assertEquals(Instant.parse(instant), expected); + assertEquals(expected, Instant.parse(instant)); } - @DataProvider private Object[][] invalid_instants() { return new Object[][] { {"2017-01-01T00:00:00.000"}, @@ -204,7 +203,8 @@ public class TestInstant extends AbstractTest { }; } - @Test(dataProvider = "invalid_instants") + @ParameterizedTest + @MethodSource("invalid_instants") public void test_parse_invalid(String instant) { assertThrows(DateTimeParseException.class, () -> Instant.parse(instant)); } diff --git a/test/jdk/java/time/test/java/time/TestInstantSource.java b/test/jdk/java/time/test/java/time/TestInstantSource.java index 31fe7874e62..e0f70047718 100644 --- a/test/jdk/java/time/test/java/time/TestInstantSource.java +++ b/test/jdk/java/time/test/java/time/TestInstantSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 @@ -23,9 +23,10 @@ package test.java.time; import static java.time.temporal.ChronoUnit.SECONDS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.Clock; import java.time.Duration; @@ -34,67 +35,70 @@ import java.time.InstantSource; import java.time.ZoneId; import java.time.ZoneOffset; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test instant source. */ -@Test public class TestInstantSource { private static final ZoneId PARIS = ZoneId.of("Europe/Paris"); + @Test public void test_system() { // main tests for Clock.currentInstant() are in TestClock_System var test = InstantSource.system(); assertSame(test.withZone(ZoneOffset.UTC), Clock.systemUTC()); - assertEquals(test.withZone(PARIS), Clock.system(PARIS)); + assertEquals(Clock.system(PARIS), test.withZone(PARIS)); var millis = System.currentTimeMillis(); var testMillis = test.millis(); var testInstantMillis = test.instant().toEpochMilli(); assertTrue(Math.abs(testMillis - millis) < 1000); assertTrue(Math.abs(testInstantMillis - millis) < 1000); assertSame(test, InstantSource.system()); - assertEquals(test.hashCode(), InstantSource.system().hashCode()); - assertEquals(test.toString(), "SystemInstantSource"); + assertEquals(InstantSource.system().hashCode(), test.hashCode()); + assertEquals("SystemInstantSource", test.toString()); } + @Test public void test_tick() { var millis = 257265861691L; var instant = Instant.ofEpochMilli(millis); var duration = Duration.ofSeconds(1); var test = InstantSource.tick(InstantSource.fixed(instant), duration); - assertEquals(test.withZone(ZoneOffset.UTC), Clock.tick(Clock.fixed(instant, ZoneOffset.UTC), duration)); - assertEquals(test.withZone(PARIS), Clock.tick(Clock.fixed(instant, PARIS), duration)); - assertEquals(test.millis(), (millis / 1000) * 1000); - assertEquals(test.instant(), instant.truncatedTo(SECONDS)); - assertEquals(test, InstantSource.tick(InstantSource.fixed(instant), duration)); - assertEquals(test.hashCode(), InstantSource.tick(InstantSource.fixed(instant), duration).hashCode()); + assertEquals(Clock.tick(Clock.fixed(instant, ZoneOffset.UTC), duration), test.withZone(ZoneOffset.UTC)); + assertEquals(Clock.tick(Clock.fixed(instant, PARIS), duration), test.withZone(PARIS)); + assertEquals((millis / 1000) * 1000, test.millis()); + assertEquals(instant.truncatedTo(SECONDS), test.instant()); + assertEquals(InstantSource.tick(InstantSource.fixed(instant), duration), test); + assertEquals(InstantSource.tick(InstantSource.fixed(instant), duration).hashCode(), test.hashCode()); } + @Test public void test_fixed() { var millis = 257265861691L; var instant = Instant.ofEpochMilli(millis); var test = InstantSource.fixed(instant); - assertEquals(test.withZone(ZoneOffset.UTC), Clock.fixed(instant, ZoneOffset.UTC)); - assertEquals(test.withZone(PARIS), Clock.fixed(instant, PARIS)); - assertEquals(test.millis(), millis); - assertEquals(test.instant(), instant); - assertEquals(test, InstantSource.fixed(instant)); - assertEquals(test.hashCode(), InstantSource.fixed(instant).hashCode()); + assertEquals(Clock.fixed(instant, ZoneOffset.UTC), test.withZone(ZoneOffset.UTC)); + assertEquals(Clock.fixed(instant, PARIS), test.withZone(PARIS)); + assertEquals(millis, test.millis()); + assertEquals(instant, test.instant()); + assertEquals(InstantSource.fixed(instant), test); + assertEquals(InstantSource.fixed(instant).hashCode(), test.hashCode()); } + @Test public void test_offset() { var millis = 257265861691L; var instant = Instant.ofEpochMilli(millis); var duration = Duration.ofSeconds(120); var test = InstantSource.offset(InstantSource.fixed(instant), duration); - assertEquals(test.withZone(ZoneOffset.UTC), Clock.offset(Clock.fixed(instant, ZoneOffset.UTC), duration)); - assertEquals(test.withZone(PARIS), Clock.offset(Clock.fixed(instant, PARIS), duration)); - assertEquals(test.millis(), millis + 120_000); - assertEquals(test.instant(), instant.plusSeconds(120)); - assertEquals(test, InstantSource.offset(InstantSource.fixed(instant), duration)); - assertEquals(test.hashCode(), InstantSource.offset(InstantSource.fixed(instant), duration).hashCode()); + assertEquals(Clock.offset(Clock.fixed(instant, ZoneOffset.UTC), duration), test.withZone(ZoneOffset.UTC)); + assertEquals(Clock.offset(Clock.fixed(instant, PARIS), duration), test.withZone(PARIS)); + assertEquals(millis + 120_000, test.millis()); + assertEquals(instant.plusSeconds(120), test.instant()); + assertEquals(InstantSource.offset(InstantSource.fixed(instant), duration), test); + assertEquals(InstantSource.offset(InstantSource.fixed(instant), duration).hashCode(), test.hashCode()); } static class MockInstantSource implements InstantSource { @@ -106,13 +110,14 @@ public class TestInstantSource { } } + @Test public void test_mock() { var test = new MockInstantSource(); - assertEquals(test.withZone(ZoneOffset.UTC).getZone(), ZoneOffset.UTC); - assertEquals(test.withZone(PARIS).getZone(), PARIS); - assertEquals(test.withZone(ZoneOffset.UTC).withZone(PARIS).getZone(), PARIS); - assertEquals(test.millis(), MockInstantSource.FIXED.toEpochMilli()); - assertEquals(test.instant(), MockInstantSource.FIXED); + assertEquals(ZoneOffset.UTC, test.withZone(ZoneOffset.UTC).getZone()); + assertEquals(PARIS, test.withZone(PARIS).getZone()); + assertEquals(PARIS, test.withZone(ZoneOffset.UTC).withZone(PARIS).getZone()); + assertEquals(MockInstantSource.FIXED.toEpochMilli(), test.millis()); + assertEquals(MockInstantSource.FIXED, test.instant()); assertEquals(test.withZone(ZoneOffset.UTC), test.withZone(ZoneOffset.UTC)); assertEquals(test.withZone(ZoneOffset.UTC).hashCode(), test.withZone(ZoneOffset.UTC).hashCode()); } diff --git a/test/jdk/java/time/test/java/time/TestLocalDate.java b/test/jdk/java/time/test/java/time/TestLocalDate.java index ef7a10ac687..b7f232665d0 100644 --- a/test/jdk/java/time/test/java/time/TestLocalDate.java +++ b/test/jdk/java/time/test/java/time/TestLocalDate.java @@ -60,10 +60,11 @@ package test.java.time; import static java.time.temporal.ChronoField.YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ObjectStreamClass; import java.io.ObjectStreamField; @@ -74,19 +75,21 @@ import java.time.temporal.ChronoField; import java.time.temporal.ChronoUnit; import java.time.temporal.IsoFields; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test LocalDate. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestLocalDate extends AbstractTest { private LocalDate TEST_2007_07_15; - @BeforeMethod + @BeforeEach public void setUp() { TEST_2007_07_15 = LocalDate.of(2007, 7, 15); } @@ -180,7 +183,6 @@ public class TestLocalDate extends AbstractTest { //----------------------------------------------------------------------- // plusWeeks() //----------------------------------------------------------------------- - @DataProvider(name="samplePlusWeeksSymmetry") Object[][] provider_samplePlusWeeksSymmetry() { return new Object[][] { {LocalDate.of(-1, 1, 1)}, @@ -212,14 +214,15 @@ public class TestLocalDate extends AbstractTest { }; } - @Test(dataProvider="samplePlusWeeksSymmetry") + @ParameterizedTest + @MethodSource("provider_samplePlusWeeksSymmetry") public void test_plusWeeks_symmetry(LocalDate reference) { for (int weeks = 0; weeks < 365 * 8; weeks++) { LocalDate t = reference.plusWeeks(weeks).plusWeeks(-weeks); - assertEquals(t, reference); + assertEquals(reference, t); t = reference.plusWeeks(-weeks).plusWeeks(weeks); - assertEquals(t, reference); + assertEquals(reference, t); } } @@ -232,7 +235,6 @@ public class TestLocalDate extends AbstractTest { //----------------------------------------------------------------------- // plusDays() //----------------------------------------------------------------------- - @DataProvider(name="samplePlusDaysSymmetry") Object[][] provider_samplePlusDaysSymmetry() { return new Object[][] { {LocalDate.of(-1, 1, 1)}, @@ -264,14 +266,15 @@ public class TestLocalDate extends AbstractTest { }; } - @Test(dataProvider="samplePlusDaysSymmetry") + @ParameterizedTest + @MethodSource("provider_samplePlusDaysSymmetry") public void test_plusDays_symmetry(LocalDate reference) { for (int days = 0; days < 365 * 8; days++) { LocalDate t = reference.plusDays(days).plusDays(-days); - assertEquals(t, reference); + assertEquals(reference, t); t = reference.plusDays(-days).plusDays(days); - assertEquals(t, reference); + assertEquals(reference, t); } } @@ -308,7 +311,6 @@ public class TestLocalDate extends AbstractTest { //----------------------------------------------------------------------- // minusWeeks() //----------------------------------------------------------------------- - @DataProvider(name="sampleMinusWeeksSymmetry") Object[][] provider_sampleMinusWeeksSymmetry() { return new Object[][] { {LocalDate.of(-1, 1, 1)}, @@ -340,14 +342,15 @@ public class TestLocalDate extends AbstractTest { }; } - @Test(dataProvider="sampleMinusWeeksSymmetry") + @ParameterizedTest + @MethodSource("provider_sampleMinusWeeksSymmetry") public void test_minusWeeks_symmetry(LocalDate reference) { for (int weeks = 0; weeks < 365 * 8; weeks++) { LocalDate t = reference.minusWeeks(weeks).minusWeeks(-weeks); - assertEquals(t, reference); + assertEquals(reference, t); t = reference.minusWeeks(-weeks).minusWeeks(weeks); - assertEquals(t, reference); + assertEquals(reference, t); } } @@ -360,7 +363,6 @@ public class TestLocalDate extends AbstractTest { //----------------------------------------------------------------------- // minusDays() //----------------------------------------------------------------------- - @DataProvider(name="sampleMinusDaysSymmetry") Object[][] provider_sampleMinusDaysSymmetry() { return new Object[][] { {LocalDate.of(-1, 1, 1)}, @@ -392,14 +394,15 @@ public class TestLocalDate extends AbstractTest { }; } - @Test(dataProvider="sampleMinusDaysSymmetry") + @ParameterizedTest + @MethodSource("provider_sampleMinusDaysSymmetry") public void test_minusDays_symmetry(LocalDate reference) { for (int days = 0; days < 365 * 8; days++) { LocalDate t = reference.minusDays(days).minusDays(-days); - assertEquals(t, reference); + assertEquals(reference, t); t = reference.minusDays(-days).minusDays(days); - assertEquals(t, reference); + assertEquals(reference, t); } } @@ -415,12 +418,12 @@ public class TestLocalDate extends AbstractTest { LocalDate test = LocalDate.of(0, 1, 1); for (long i = date_0000_01_01; i < 700000; i++) { - assertEquals(LocalDate.ofEpochDay(test.toEpochDay()), test); + assertEquals(test, LocalDate.ofEpochDay(test.toEpochDay())); test = next(test); } test = LocalDate.of(0, 1, 1); for (long i = date_0000_01_01; i > -2000000; i--) { - assertEquals(LocalDate.ofEpochDay(test.toEpochDay()), test); + assertEquals(test, LocalDate.ofEpochDay(test.toEpochDay())); test = previous(test); } } @@ -434,11 +437,11 @@ public class TestLocalDate extends AbstractTest { int[] offsets = new int[] { 0, 1, 2, 3, 28, 29, 30, 31, 32, 363, 364, 365, 366, 367 }; for (int offset : offsets) { LocalDate minDate = LocalDate.ofEpochDay(minDay + offset); - assertEquals(minDate, LocalDate.MIN.plusDays(offset)); + assertEquals(LocalDate.MIN.plusDays(offset), minDate); assertTrue(ChronoField.YEAR.range().isValidValue(minDate.getYear())); LocalDate maxDate = LocalDate.ofEpochDay(maxDay - offset); - assertEquals(maxDate, LocalDate.MAX.minusDays(offset)); + assertEquals(LocalDate.MAX.minusDays(offset), maxDate); assertTrue(ChronoField.YEAR.range().isValidValue(maxDate.getYear())); try { @@ -463,25 +466,24 @@ public class TestLocalDate extends AbstractTest { LocalDate b = localDates[j]; if (i < j) { assertTrue(a.compareTo(b) < 0, a + " <=> " + b); - assertEquals(a.isBefore(b), true, a + " <=> " + b); - assertEquals(a.isAfter(b), false, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(true, a.isBefore(b), a + " <=> " + b); + assertEquals(false, a.isAfter(b), a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else if (i > j) { assertTrue(a.compareTo(b) > 0, a + " <=> " + b); - assertEquals(a.isBefore(b), false, a + " <=> " + b); - assertEquals(a.isAfter(b), true, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(false, a.isBefore(b), a + " <=> " + b); + assertEquals(true, a.isAfter(b), a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else { - assertEquals(a.compareTo(b), 0, a + " <=> " + b); - assertEquals(a.isBefore(b), false, a + " <=> " + b); - assertEquals(a.isAfter(b), false, a + " <=> " + b); - assertEquals(a.equals(b), true, a + " <=> " + b); + assertEquals(0, a.compareTo(b), a + " <=> " + b); + assertEquals(false, a.isBefore(b), a + " <=> " + b); + assertEquals(false, a.isAfter(b), a + " <=> " + b); + assertEquals(true, a.equals(b), a + " <=> " + b); } } } } - @DataProvider(name="quarterYearsToAdd") Object[][] provider_quarterYearsToAdd() { return new Object[][] { {Long.valueOf(-1000000000)}, @@ -496,7 +498,8 @@ public class TestLocalDate extends AbstractTest { }; } - @Test(dataProvider="quarterYearsToAdd") + @ParameterizedTest + @MethodSource("provider_quarterYearsToAdd") public void test_plus_QuarterYears(long quarterYears) { LocalDate t0 = TEST_2007_07_15 .plus(quarterYears, IsoFields.QUARTER_YEARS); @@ -504,10 +507,11 @@ public class TestLocalDate extends AbstractTest { .plus(quarterYears, ChronoUnit.MONTHS) .plus(quarterYears, ChronoUnit.MONTHS) .plus(quarterYears, ChronoUnit.MONTHS); - assertEquals(t0, t1); + assertEquals(t1, t0); } - @Test(dataProvider="quarterYearsToAdd") + @ParameterizedTest + @MethodSource("provider_quarterYearsToAdd") public void test_minus_QuarterYears(long quarterYears) { LocalDate t0 = TEST_2007_07_15 .minus(quarterYears, IsoFields.QUARTER_YEARS); @@ -515,7 +519,7 @@ public class TestLocalDate extends AbstractTest { .minus(quarterYears, ChronoUnit.MONTHS) .minus(quarterYears, ChronoUnit.MONTHS) .minus(quarterYears, ChronoUnit.MONTHS); - assertEquals(t0, t1); + assertEquals(t1, t0); } // Verify serialized fields types are backward compatible @@ -524,9 +528,9 @@ public class TestLocalDate extends AbstractTest { var osc = ObjectStreamClass.lookup(LocalDate.class); for (ObjectStreamField f : osc.getFields()) { switch (f.getName()) { - case "year" -> assertEquals(f.getType(), int.class, f.getName()); + case "year" -> assertEquals(int.class, f.getType(), f.getName()); case "month", - "day" -> assertEquals(f.getType(), short.class); + "day" -> assertEquals(short.class, f.getType()); default -> fail("unknown field in LocalDate: " + f.getName()); } } diff --git a/test/jdk/java/time/test/java/time/TestLocalDateTime.java b/test/jdk/java/time/test/java/time/TestLocalDateTime.java index 80469ed0621..fb53ec70ede 100644 --- a/test/jdk/java/time/test/java/time/TestLocalDateTime.java +++ b/test/jdk/java/time/test/java/time/TestLocalDateTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,9 +59,9 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.LocalDate; import java.time.LocalDateTime; @@ -69,13 +69,15 @@ import java.time.LocalTime; import java.time.Period; import java.time.temporal.ChronoUnit; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test LocalDateTime. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestLocalDateTime extends AbstractTest { private LocalDateTime TEST_2007_07_15_12_30_40_987654321 = LocalDateTime.of(2007, 7, 15, 12, 30, 40, 987654321); @@ -87,7 +89,6 @@ public class TestLocalDateTime extends AbstractTest { } //----------------------------------------------------------------------- - @DataProvider(name="sampleDates") Object[][] provider_sampleDates() { return new Object[][] { {2008, 7, 5}, @@ -99,7 +100,6 @@ public class TestLocalDateTime extends AbstractTest { }; } - @DataProvider(name="sampleTimes") Object[][] provider_sampleTimes() { return new Object[][] { {0, 0, 0, 0}, @@ -444,7 +444,7 @@ public class TestLocalDateTime extends AbstractTest { @Test public void test_minusSeconds_noChange_oneDay() { LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.minusSeconds(24 * 60 * 60); - assertEquals(t.toLocalDate(), TEST_2007_07_15_12_30_40_987654321.toLocalDate().minusDays(1)); + assertEquals(TEST_2007_07_15_12_30_40_987654321.toLocalDate().minusDays(1), t.toLocalDate()); assertSame(t.toLocalTime(), TEST_2007_07_15_12_30_40_987654321.toLocalTime()); } @@ -469,7 +469,7 @@ public class TestLocalDateTime extends AbstractTest { @Test public void test_minusNanos_noChange_oneDay() { LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.minusNanos(24 * 60 * 60 * 1000000000L); - assertEquals(t.toLocalDate(), TEST_2007_07_15_12_30_40_987654321.toLocalDate().minusDays(1)); + assertEquals(TEST_2007_07_15_12_30_40_987654321.toLocalDate().minusDays(1), t.toLocalDate()); assertSame(t.toLocalTime(), TEST_2007_07_15_12_30_40_987654321.toLocalTime()); } @@ -488,7 +488,8 @@ public class TestLocalDateTime extends AbstractTest { //----------------------------------------------------------------------- // toLocalDate() //----------------------------------------------------------------------- - @Test(dataProvider="sampleDates") + @ParameterizedTest + @MethodSource("provider_sampleDates") public void test_getDate(int year, int month, int day) { LocalDate d = LocalDate.of(year, month, day); LocalDateTime dt = LocalDateTime.of(d, LocalTime.MIDNIGHT); @@ -498,7 +499,8 @@ public class TestLocalDateTime extends AbstractTest { //----------------------------------------------------------------------- // toLocalTime() //----------------------------------------------------------------------- - @Test(dataProvider="sampleTimes") + @ParameterizedTest + @MethodSource("provider_sampleTimes") public void test_getTime(int h, int m, int s, int ns) { LocalTime t = LocalTime.of(h, m, s, ns); LocalDateTime dt = LocalDateTime.of(LocalDate.of(2011, 7, 30), t); @@ -549,19 +551,19 @@ public class TestLocalDateTime extends AbstractTest { LocalDateTime b = localDateTimes[j]; if (i < j) { assertTrue(a.compareTo(b) < 0, a + " <=> " + b); - assertEquals(a.isBefore(b), true, a + " <=> " + b); - assertEquals(a.isAfter(b), false, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(true, a.isBefore(b), a + " <=> " + b); + assertEquals(false, a.isAfter(b), a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else if (i > j) { assertTrue(a.compareTo(b) > 0, a + " <=> " + b); - assertEquals(a.isBefore(b), false, a + " <=> " + b); - assertEquals(a.isAfter(b), true, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(false, a.isBefore(b), a + " <=> " + b); + assertEquals(true, a.isAfter(b), a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else { - assertEquals(a.compareTo(b), 0, a + " <=> " + b); - assertEquals(a.isBefore(b), false, a + " <=> " + b); - assertEquals(a.isAfter(b), false, a + " <=> " + b); - assertEquals(a.equals(b), true, a + " <=> " + b); + assertEquals(0, a.compareTo(b), a + " <=> " + b); + assertEquals(false, a.isBefore(b), a + " <=> " + b); + assertEquals(false, a.isAfter(b), a + " <=> " + b); + assertEquals(true, a.equals(b), a + " <=> " + b); } } } diff --git a/test/jdk/java/time/test/java/time/TestLocalTime.java b/test/jdk/java/time/test/java/time/TestLocalTime.java index 8e25a85f198..24a456683fd 100644 --- a/test/jdk/java/time/test/java/time/TestLocalTime.java +++ b/test/jdk/java/time/test/java/time/TestLocalTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,19 +59,18 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.Clock; import java.time.LocalTime; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test LocalTime. */ -@Test public class TestLocalTime extends AbstractTest { static final long NANOS_PER_SECOND = 1_000_000_000L; static final long NANOS_PER_MINUTE = 60 * NANOS_PER_SECOND; @@ -85,10 +84,10 @@ public class TestLocalTime extends AbstractTest { //----------------------------------------------------------------------- private void check(LocalTime time, int h, int m, int s, int n) { - assertEquals(time.getHour(), h); - assertEquals(time.getMinute(), m); - assertEquals(time.getSecond(), s); - assertEquals(time.getNano(), n); + assertEquals(h, time.getHour()); + assertEquals(m, time.getMinute()); + assertEquals(s, time.getSecond()); + assertEquals(n, time.getNano()); } //----------------------------------------------------------------------- @@ -184,8 +183,8 @@ public class TestLocalTime extends AbstractTest { //----------------------------------------------------------------------- // now() //----------------------------------------------------------------------- - @Test @SuppressWarnings("unused") + @Test public void now() { // Warmup the TimeZone data so the following test does not include // one-time initialization diff --git a/test/jdk/java/time/test/java/time/TestMonthDay.java b/test/jdk/java/time/test/java/time/TestMonthDay.java index 311a40030c1..a5195387d2b 100644 --- a/test/jdk/java/time/test/java/time/TestMonthDay.java +++ b/test/jdk/java/time/test/java/time/TestMonthDay.java @@ -59,10 +59,10 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ObjectStreamClass; import java.io.ObjectStreamField; @@ -70,18 +70,17 @@ import java.time.LocalDate; import java.time.Month; import java.time.MonthDay; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Test MonthDay. */ -@Test public class TestMonthDay extends AbstractTest { private MonthDay TEST_07_15; - @BeforeMethod + @BeforeEach public void setUp() { TEST_07_15 = MonthDay.of(7, 15); } @@ -94,8 +93,8 @@ public class TestMonthDay extends AbstractTest { //----------------------------------------------------------------------- void check(MonthDay test, int m, int d) { - assertEquals(test.getMonth().getValue(), m); - assertEquals(test.getDayOfMonth(), d); + assertEquals(m, test.getMonth().getValue()); + assertEquals(d, test.getDayOfMonth()); } @Test @@ -129,19 +128,19 @@ public class TestMonthDay extends AbstractTest { MonthDay b = localDates[j]; if (i < j) { assertTrue(a.compareTo(b) < 0, a + " <=> " + b); - assertEquals(a.isBefore(b), true, a + " <=> " + b); - assertEquals(a.isAfter(b), false, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(true, a.isBefore(b), a + " <=> " + b); + assertEquals(false, a.isAfter(b), a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else if (i > j) { assertTrue(a.compareTo(b) > 0, a + " <=> " + b); - assertEquals(a.isBefore(b), false, a + " <=> " + b); - assertEquals(a.isAfter(b), true, a + " <=> " + b); - assertEquals(a.equals(b), false, a + " <=> " + b); + assertEquals(false, a.isBefore(b), a + " <=> " + b); + assertEquals(true, a.isAfter(b), a + " <=> " + b); + assertEquals(false, a.equals(b), a + " <=> " + b); } else { - assertEquals(a.compareTo(b), 0, a + " <=> " + b); - assertEquals(a.isBefore(b), false, a + " <=> " + b); - assertEquals(a.isAfter(b), false, a + " <=> " + b); - assertEquals(a.equals(b), true, a + " <=> " + b); + assertEquals(0, a.compareTo(b), a + " <=> " + b); + assertEquals(false, a.isBefore(b), a + " <=> " + b); + assertEquals(false, a.isAfter(b), a + " <=> " + b); + assertEquals(true, a.equals(b), a + " <=> " + b); } } } @@ -155,7 +154,7 @@ public class TestMonthDay extends AbstractTest { for (ObjectStreamField f : osc.getFields()) { switch (f.getName()) { case "month", - "day" -> assertEquals(f.getType(), int.class, f.getName()); + "day" -> assertEquals(int.class, f.getType(), f.getName()); default -> fail("unknown field in MonthDay: " + f.getName()); } } diff --git a/test/jdk/java/time/test/java/time/TestOffsetDateTime.java b/test/jdk/java/time/test/java/time/TestOffsetDateTime.java index bd145fa9663..3caf4d13c88 100644 --- a/test/jdk/java/time/test/java/time/TestOffsetDateTime.java +++ b/test/jdk/java/time/test/java/time/TestOffsetDateTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,8 +59,8 @@ */ package test.java.time; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Duration; import java.time.LocalDate; @@ -69,23 +69,25 @@ import java.time.LocalTime; import java.time.OffsetDateTime; import java.time.ZoneOffset; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test OffsetDateTime. * * @bug 8211990 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestOffsetDateTime extends AbstractTest { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); private static final ZoneOffset OFFSET_PTWO = ZoneOffset.ofHours(2); private OffsetDateTime TEST_2008_6_30_11_30_59_000000500; - @BeforeMethod + @BeforeEach public void setUp() { TEST_2008_6_30_11_30_59_000000500 = OffsetDateTime.of(LocalDate.of(2008, 6, 30), LocalTime.of(11, 30, 59, 500), OFFSET_PONE); } @@ -98,7 +100,6 @@ public class TestOffsetDateTime extends AbstractTest { //----------------------------------------------------------------------- // basics //----------------------------------------------------------------------- - @DataProvider(name="sampleTimes") Object[][] provider_sampleTimes() { return new Object[][] { {2008, 6, 30, 11, 30, 20, 500, OFFSET_PONE}, @@ -108,7 +109,8 @@ public class TestOffsetDateTime extends AbstractTest { }; } - @Test(dataProvider="sampleTimes") + @ParameterizedTest + @MethodSource("provider_sampleTimes") public void test_get_same(int y, int o, int d, int h, int m, int s, int n, ZoneOffset offset) { LocalDate localDate = LocalDate.of(y, o, d); LocalTime localTime = LocalTime.of(h, m, s, n); @@ -329,6 +331,6 @@ public class TestOffsetDateTime extends AbstractTest { OffsetDateTime start = OffsetDateTime.MAX .withOffsetSameLocal(ZoneOffset.ofHours(-17)); OffsetDateTime end = OffsetDateTime.MAX; - assertEquals(Duration.between(start, end), Duration.ofHours(1)); + assertEquals(Duration.ofHours(1), Duration.between(start, end)); } } diff --git a/test/jdk/java/time/test/java/time/TestOffsetDateTime_instants.java b/test/jdk/java/time/test/java/time/TestOffsetDateTime_instants.java index 28b32ba2811..9131a7b02b6 100644 --- a/test/jdk/java/time/test/java/time/TestOffsetDateTime_instants.java +++ b/test/jdk/java/time/test/java/time/TestOffsetDateTime_instants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,7 +59,7 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DateTimeException; import java.time.Instant; @@ -70,12 +70,12 @@ import java.time.OffsetDateTime; import java.time.Year; import java.time.ZoneOffset; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Test OffsetDateTime creation. */ -@Test public class TestOffsetDateTime_instants { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); @@ -83,148 +83,167 @@ public class TestOffsetDateTime_instants { private static final ZoneOffset OFFSET_MIN = ZoneOffset.ofHours(-18); //----------------------------------------------------------------------- - @Test(expectedExceptions=NullPointerException.class) + @Test public void factory_ofInstant_nullInstant() { - OffsetDateTime.ofInstant((Instant) null, OFFSET_PONE); + Assertions.assertThrows(NullPointerException.class, () -> OffsetDateTime.ofInstant((Instant) null, OFFSET_PONE)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void factory_ofInstant_nullOffset() { - Instant instant = Instant.ofEpochSecond(0L); - OffsetDateTime.ofInstant(instant, (ZoneOffset) null); + Assertions.assertThrows(NullPointerException.class, () -> { + Instant instant = Instant.ofEpochSecond(0L); + OffsetDateTime.ofInstant(instant, (ZoneOffset) null); + }); } + @Test public void factory_ofInstant_allSecsInDay() { for (int i = 0; i < (24 * 60 * 60); i++) { Instant instant = Instant.ofEpochSecond(i); OffsetDateTime test = OffsetDateTime.ofInstant(instant, OFFSET_PONE); - assertEquals(test.getYear(), 1970); - assertEquals(test.getMonth(), Month.JANUARY); - assertEquals(test.getDayOfMonth(), 1 + (i >= 23 * 60 * 60 ? 1 : 0)); - assertEquals(test.getHour(), ((i / (60 * 60)) + 1) % 24); - assertEquals(test.getMinute(), (i / 60) % 60); - assertEquals(test.getSecond(), i % 60); + assertEquals(1970, test.getYear()); + assertEquals(Month.JANUARY, test.getMonth()); + assertEquals(1 + (i >= 23 * 60 * 60 ? 1 : 0), test.getDayOfMonth()); + assertEquals(((i / (60 * 60)) + 1) % 24, test.getHour()); + assertEquals((i / 60) % 60, test.getMinute()); + assertEquals(i % 60, test.getSecond()); } } + @Test public void factory_ofInstant_allDaysInCycle() { // sanity check using different algorithm OffsetDateTime expected = OffsetDateTime.of(LocalDate.of(1970, 1, 1), LocalTime.of(0, 0, 0, 0), ZoneOffset.UTC); for (long i = 0; i < 146097; i++) { Instant instant = Instant.ofEpochSecond(i * 24L * 60L * 60L); OffsetDateTime test = OffsetDateTime.ofInstant(instant, ZoneOffset.UTC); - assertEquals(test, expected); + assertEquals(expected, test); expected = expected.plusDays(1); } } + @Test public void factory_ofInstant_history() { doTest_factory_ofInstant_all(-2820, 2820); } //----------------------------------------------------------------------- + @Test public void factory_ofInstant_minYear() { doTest_factory_ofInstant_all(Year.MIN_VALUE, Year.MIN_VALUE + 420); } - @Test(expectedExceptions=DateTimeException.class) + @Test public void factory_ofInstant_tooLow() { - long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); - int year = Year.MIN_VALUE - 1; - long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; - Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L); - OffsetDateTime.ofInstant(instant, ZoneOffset.UTC); + Assertions.assertThrows(DateTimeException.class, () -> { + long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); + int year = Year.MIN_VALUE - 1; + long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; + Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L); + OffsetDateTime.ofInstant(instant, ZoneOffset.UTC); + }); } + @Test public void factory_ofInstant_maxYear() { doTest_factory_ofInstant_all(Year.MAX_VALUE - 420, Year.MAX_VALUE); } - @Test(expectedExceptions=DateTimeException.class) + @Test public void factory_ofInstant_tooBig() { - long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); - long year = Year.MAX_VALUE + 1L; - long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; - Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L); - OffsetDateTime.ofInstant(instant, ZoneOffset.UTC); + Assertions.assertThrows(DateTimeException.class, () -> { + long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); + long year = Year.MAX_VALUE + 1L; + long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; + Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L); + OffsetDateTime.ofInstant(instant, ZoneOffset.UTC); + }); } //----------------------------------------------------------------------- + @Test public void factory_ofInstant_minWithMinOffset() { long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); int year = Year.MIN_VALUE; long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L - OFFSET_MIN.getTotalSeconds()); OffsetDateTime test = OffsetDateTime.ofInstant(instant, OFFSET_MIN); - assertEquals(test.getYear(), Year.MIN_VALUE); - assertEquals(test.getMonth().getValue(), 1); - assertEquals(test.getDayOfMonth(), 1); - assertEquals(test.getOffset(), OFFSET_MIN); - assertEquals(test.getHour(), 0); - assertEquals(test.getMinute(), 0); - assertEquals(test.getSecond(), 0); - assertEquals(test.getNano(), 0); + assertEquals(Year.MIN_VALUE, test.getYear()); + assertEquals(1, test.getMonth().getValue()); + assertEquals(1, test.getDayOfMonth()); + assertEquals(OFFSET_MIN, test.getOffset()); + assertEquals(0, test.getHour()); + assertEquals(0, test.getMinute()); + assertEquals(0, test.getSecond()); + assertEquals(0, test.getNano()); } + @Test public void factory_ofInstant_minWithMaxOffset() { long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); int year = Year.MIN_VALUE; long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L - OFFSET_MAX.getTotalSeconds()); OffsetDateTime test = OffsetDateTime.ofInstant(instant, OFFSET_MAX); - assertEquals(test.getYear(), Year.MIN_VALUE); - assertEquals(test.getMonth().getValue(), 1); - assertEquals(test.getDayOfMonth(), 1); - assertEquals(test.getOffset(), OFFSET_MAX); - assertEquals(test.getHour(), 0); - assertEquals(test.getMinute(), 0); - assertEquals(test.getSecond(), 0); - assertEquals(test.getNano(), 0); + assertEquals(Year.MIN_VALUE, test.getYear()); + assertEquals(1, test.getMonth().getValue()); + assertEquals(1, test.getDayOfMonth()); + assertEquals(OFFSET_MAX, test.getOffset()); + assertEquals(0, test.getHour()); + assertEquals(0, test.getMinute()); + assertEquals(0, test.getSecond()); + assertEquals(0, test.getNano()); } + @Test public void factory_ofInstant_maxWithMinOffset() { long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); int year = Year.MAX_VALUE; long days = (year * 365L + (year / 4 - year / 100 + year / 400)) + 365 - days_0000_to_1970; Instant instant = Instant.ofEpochSecond((days + 1) * 24L * 60L * 60L - 1 - OFFSET_MIN.getTotalSeconds()); OffsetDateTime test = OffsetDateTime.ofInstant(instant, OFFSET_MIN); - assertEquals(test.getYear(), Year.MAX_VALUE); - assertEquals(test.getMonth().getValue(), 12); - assertEquals(test.getDayOfMonth(), 31); - assertEquals(test.getOffset(), OFFSET_MIN); - assertEquals(test.getHour(), 23); - assertEquals(test.getMinute(), 59); - assertEquals(test.getSecond(), 59); - assertEquals(test.getNano(), 0); + assertEquals(Year.MAX_VALUE, test.getYear()); + assertEquals(12, test.getMonth().getValue()); + assertEquals(31, test.getDayOfMonth()); + assertEquals(OFFSET_MIN, test.getOffset()); + assertEquals(23, test.getHour()); + assertEquals(59, test.getMinute()); + assertEquals(59, test.getSecond()); + assertEquals(0, test.getNano()); } + @Test public void factory_ofInstant_maxWithMaxOffset() { long days_0000_to_1970 = (146097 * 5) - (30 * 365 + 7); int year = Year.MAX_VALUE; long days = (year * 365L + (year / 4 - year / 100 + year / 400)) + 365 - days_0000_to_1970; Instant instant = Instant.ofEpochSecond((days + 1) * 24L * 60L * 60L - 1 - OFFSET_MAX.getTotalSeconds()); OffsetDateTime test = OffsetDateTime.ofInstant(instant, OFFSET_MAX); - assertEquals(test.getYear(), Year.MAX_VALUE); - assertEquals(test.getMonth().getValue(), 12); - assertEquals(test.getDayOfMonth(), 31); - assertEquals(test.getOffset(), OFFSET_MAX); - assertEquals(test.getHour(), 23); - assertEquals(test.getMinute(), 59); - assertEquals(test.getSecond(), 59); - assertEquals(test.getNano(), 0); + assertEquals(Year.MAX_VALUE, test.getYear()); + assertEquals(12, test.getMonth().getValue()); + assertEquals(31, test.getDayOfMonth()); + assertEquals(OFFSET_MAX, test.getOffset()); + assertEquals(23, test.getHour()); + assertEquals(59, test.getMinute()); + assertEquals(59, test.getSecond()); + assertEquals(0, test.getNano()); } //----------------------------------------------------------------------- - @Test(expectedExceptions=DateTimeException.class) + @Test public void factory_ofInstant_maxInstantWithMaxOffset() { - Instant instant = Instant.ofEpochSecond(Long.MAX_VALUE); - OffsetDateTime.ofInstant(instant, OFFSET_MAX); + Assertions.assertThrows(DateTimeException.class, () -> { + Instant instant = Instant.ofEpochSecond(Long.MAX_VALUE); + OffsetDateTime.ofInstant(instant, OFFSET_MAX); + }); } - @Test(expectedExceptions=DateTimeException.class) + @Test public void factory_ofInstant_maxInstantWithMinOffset() { - Instant instant = Instant.ofEpochSecond(Long.MAX_VALUE); - OffsetDateTime.ofInstant(instant, OFFSET_MIN); + Assertions.assertThrows(DateTimeException.class, () -> { + Instant instant = Instant.ofEpochSecond(Long.MAX_VALUE); + OffsetDateTime.ofInstant(instant, OFFSET_MIN); + }); } //----------------------------------------------------------------------- @@ -241,7 +260,7 @@ public class TestOffsetDateTime_instants { Instant instant = Instant.ofEpochSecond(i * 24L * 60L * 60L); try { OffsetDateTime test = OffsetDateTime.ofInstant(instant, ZoneOffset.UTC); - assertEquals(test, expected); + assertEquals(expected, test); if (expected.toLocalDate().equals(maxDate) == false) { expected = expected.plusDays(1); } @@ -282,65 +301,75 @@ public class TestOffsetDateTime_instants { // } //----------------------------------------------------------------------- + @Test public void test_toInstant_19700101() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1970, 1, 1), LocalTime.of(0, 0, 0, 0), ZoneOffset.UTC); Instant test = dt.toInstant(); - assertEquals(test.getEpochSecond(), 0); - assertEquals(test.getNano(), 0); + assertEquals(0, test.getEpochSecond()); + assertEquals(0, test.getNano()); } + @Test public void test_toInstant_19700101_oneNano() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1970, 1, 1), LocalTime.of(0, 0, 0, 1), ZoneOffset.UTC); Instant test = dt.toInstant(); - assertEquals(test.getEpochSecond(), 0); - assertEquals(test.getNano(), 1); + assertEquals(0, test.getEpochSecond()); + assertEquals(1, test.getNano()); } + @Test public void test_toInstant_19700101_minusOneNano() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1969, 12, 31), LocalTime.of(23, 59, 59, 999999999), ZoneOffset.UTC); Instant test = dt.toInstant(); - assertEquals(test.getEpochSecond(), -1); - assertEquals(test.getNano(), 999999999); + assertEquals(-1, test.getEpochSecond()); + assertEquals(999999999, test.getNano()); } + @Test public void test_toInstant_19700102() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1970, 1, 2), LocalTime.of(0, 0, 0, 0), ZoneOffset.UTC); Instant test = dt.toInstant(); - assertEquals(test.getEpochSecond(), 24L * 60L * 60L); - assertEquals(test.getNano(), 0); + assertEquals(24L * 60L * 60L, test.getEpochSecond()); + assertEquals(0, test.getNano()); } + @Test public void test_toInstant_19691231() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1969, 12, 31), LocalTime.of(0, 0, 0, 0), ZoneOffset.UTC); Instant test = dt.toInstant(); - assertEquals(test.getEpochSecond(), -24L * 60L * 60L); - assertEquals(test.getNano(), 0); + assertEquals(-24L * 60L * 60L, test.getEpochSecond()); + assertEquals(0, test.getNano()); } //----------------------------------------------------------------------- + @Test public void test_toEpochSecond_19700101() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1970, 1, 1), LocalTime.of(0, 0, 0, 0), ZoneOffset.UTC); - assertEquals(dt.toEpochSecond(), 0); + assertEquals(0, dt.toEpochSecond()); } + @Test public void test_toEpochSecond_19700101_oneNano() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1970, 1, 1), LocalTime.of( 0, 0, 0, 1), ZoneOffset.UTC); - assertEquals(dt.toEpochSecond(), 0); + assertEquals(0, dt.toEpochSecond()); } + @Test public void test_toEpochSecond_19700101_minusOneNano() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1969, 12, 31), LocalTime.of(23, 59, 59, 999999999), ZoneOffset.UTC); - assertEquals(dt.toEpochSecond(), -1); + assertEquals(-1, dt.toEpochSecond()); } + @Test public void test_toEpochSecond_19700102() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1970, 1, 2), LocalTime.of(0, 0, 0, 0), ZoneOffset.UTC); - assertEquals(dt.toEpochSecond(), 24L * 60L * 60L); + assertEquals(24L * 60L * 60L, dt.toEpochSecond()); } + @Test public void test_toEpochSecond_19691231() { OffsetDateTime dt = OffsetDateTime.of(LocalDate.of(1969, 12, 31), LocalTime.of(0, 0, 0, 0), ZoneOffset.UTC); - assertEquals(dt.toEpochSecond(), -24L * 60L * 60L); + assertEquals(-24L * 60L * 60L, dt.toEpochSecond()); } } diff --git a/test/jdk/java/time/test/java/time/TestOffsetTime.java b/test/jdk/java/time/test/java/time/TestOffsetTime.java index 41116a7c964..ce3a73aa987 100644 --- a/test/jdk/java/time/test/java/time/TestOffsetTime.java +++ b/test/jdk/java/time/test/java/time/TestOffsetTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -61,12 +61,11 @@ package test.java.time; import java.time.OffsetTime; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test OffsetTime. */ -@Test public class TestOffsetTime extends AbstractTest { @Test diff --git a/test/jdk/java/time/test/java/time/TestPeriod.java b/test/jdk/java/time/test/java/time/TestPeriod.java index 2c6d4030d84..a74fbf4c8d2 100644 --- a/test/jdk/java/time/test/java/time/TestPeriod.java +++ b/test/jdk/java/time/test/java/time/TestPeriod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,17 +59,16 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import java.time.Period; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test. */ -@Test public class TestPeriod extends AbstractTest { @Test @@ -98,10 +97,10 @@ public class TestPeriod extends AbstractTest { Period test6 = Period.ofDays(6); Period test5M = Period.ofMonths(5); Period test5Y = Period.ofYears(5); - assertEquals(test5.hashCode() == test5.hashCode(), true); - assertEquals(test5.hashCode() == test6.hashCode(), false); - assertEquals(test5.hashCode() == test5M.hashCode(), false); - assertEquals(test5.hashCode() == test5Y.hashCode(), false); + assertEquals(true, test5.hashCode() == test5.hashCode()); + assertEquals(false, test5.hashCode() == test6.hashCode()); + assertEquals(false, test5.hashCode() == test5M.hashCode()); + assertEquals(false, test5.hashCode() == test5Y.hashCode()); } } diff --git a/test/jdk/java/time/test/java/time/TestYear.java b/test/jdk/java/time/test/java/time/TestYear.java index 71791ab5fa7..ddb82d91b26 100644 --- a/test/jdk/java/time/test/java/time/TestYear.java +++ b/test/jdk/java/time/test/java/time/TestYear.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -61,12 +61,11 @@ package test.java.time; import java.time.Year; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test Year. */ -@Test public class TestYear extends AbstractTest { @Test diff --git a/test/jdk/java/time/test/java/time/TestYearMonth.java b/test/jdk/java/time/test/java/time/TestYearMonth.java index 0552994b8c2..51202c902f9 100644 --- a/test/jdk/java/time/test/java/time/TestYearMonth.java +++ b/test/jdk/java/time/test/java/time/TestYearMonth.java @@ -64,15 +64,13 @@ import java.io.ObjectStreamField; import java.time.LocalDate; import java.time.YearMonth; -import org.testng.annotations.Test; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; /** * Test YearMonth. */ -@Test public class TestYearMonth extends AbstractTest { //----------------------------------------------------------------------- @@ -87,8 +85,8 @@ public class TestYearMonth extends AbstractTest { var osc = ObjectStreamClass.lookup(YearMonth.class); for (ObjectStreamField f : osc.getFields()) { switch (f.getName()) { - case "year" -> assertEquals(f.getType(), int.class, f.getName()); - case "month" -> assertEquals(f.getType(), int.class, f.getName()); + case "year" -> assertEquals(int.class, f.getType(), f.getName()); + case "month" -> assertEquals(int.class, f.getType(), f.getName()); default -> fail("unknown field in YearMonth: " + f.getName()); } } diff --git a/test/jdk/java/time/test/java/time/TestZoneId.java b/test/jdk/java/time/test/java/time/TestZoneId.java index df2bbbc519e..fa8727560af 100644 --- a/test/jdk/java/time/test/java/time/TestZoneId.java +++ b/test/jdk/java/time/test/java/time/TestZoneId.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,10 +59,10 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -81,12 +81,12 @@ import java.util.Locale; import java.util.SimpleTimeZone; import java.util.TimeZone; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Test ZoneId. */ -@Test public class TestZoneId extends AbstractTest { private static final int OVERLAP = 2; @@ -95,6 +95,7 @@ public class TestZoneId extends AbstractTest { //----------------------------------------------------------------------- // Basics //----------------------------------------------------------------------- + @Test public void test_immutable() { // cannot use standard test as ZoneId is abstract Class cls = ZoneId.class; @@ -112,100 +113,111 @@ public class TestZoneId extends AbstractTest { //----------------------------------------------------------------------- // UTC //----------------------------------------------------------------------- + @Test public void test_constant_UTC() { ZoneId test = ZoneOffset.UTC; - assertEquals(test.getId(), "Z"); - assertEquals(test.getDisplayName(TextStyle.FULL, Locale.UK), "Z"); - assertEquals(test.getRules().isFixedOffset(), true); - assertEquals(test.getRules().getOffset(Instant.ofEpochSecond(0L)), ZoneOffset.UTC); + assertEquals("Z", test.getId()); + assertEquals("Z", test.getDisplayName(TextStyle.FULL, Locale.UK)); + assertEquals(true, test.getRules().isFixedOffset()); + assertEquals(ZoneOffset.UTC, test.getRules().getOffset(Instant.ofEpochSecond(0L))); checkOffset(test.getRules(), createLDT(2008, 6, 30), ZoneOffset.UTC, 1); } //----------------------------------------------------------------------- // system default //----------------------------------------------------------------------- + @Test public void test_systemDefault() { ZoneId test = ZoneId.systemDefault(); - assertEquals(test.getId(), TimeZone.getDefault().getID()); + assertEquals(TimeZone.getDefault().getID(), test.getId()); } - @Test(expectedExceptions = DateTimeException.class) + @Test public void test_systemDefault_unableToConvert_badFormat() { - TimeZone current = TimeZone.getDefault(); - try { - TimeZone.setDefault(new SimpleTimeZone(127, "Something Weird")); - ZoneId.systemDefault(); - } finally { - TimeZone.setDefault(current); - } + Assertions.assertThrows(DateTimeException.class, () -> { + TimeZone current = TimeZone.getDefault(); + try { + TimeZone.setDefault(new SimpleTimeZone(127, "Something Weird")); + ZoneId.systemDefault(); + } finally { + TimeZone.setDefault(current); + } + }); } - @Test(expectedExceptions = ZoneRulesException.class) + @Test public void test_systemDefault_unableToConvert_unknownId() { - TimeZone current = TimeZone.getDefault(); - try { - TimeZone.setDefault(new SimpleTimeZone(127, "SomethingWeird")); - ZoneId.systemDefault(); - } finally { - TimeZone.setDefault(current); - } + Assertions.assertThrows(ZoneRulesException.class, () -> { + TimeZone current = TimeZone.getDefault(); + try { + TimeZone.setDefault(new SimpleTimeZone(127, "SomethingWeird")); + ZoneId.systemDefault(); + } finally { + TimeZone.setDefault(current); + } + }); } //----------------------------------------------------------------------- // Europe/London //----------------------------------------------------------------------- + @Test public void test_London() { ZoneId test = ZoneId.of("Europe/London"); - assertEquals(test.getId(), "Europe/London"); - assertEquals(test.getRules().isFixedOffset(), false); + assertEquals("Europe/London", test.getId()); + assertEquals(false, test.getRules().isFixedOffset()); } + @Test public void test_London_getOffset() { ZoneId test = ZoneId.of("Europe/London"); - assertEquals(test.getRules().getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC))); } + @Test public void test_London_getOffset_toDST() { ZoneId test = ZoneId.of("Europe/London"); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC))); } + @Test public void test_London_getOffset_fromDST() { ZoneId test = ZoneId.of("Europe/London"); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC)), ZoneOffset.ofHours(0)); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(0), test.getRules().getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC))); } + @Test public void test_London_getOffsetInfo() { ZoneId test = ZoneId.of("Europe/London"); checkOffset(test.getRules(), createLDT(2008, 1, 1), ZoneOffset.ofHours(0), 1); @@ -222,6 +234,7 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), createLDT(2008, 12, 1), ZoneOffset.ofHours(0), 1); } + @Test public void test_London_getOffsetInfo_toDST() { ZoneId test = ZoneId.of("Europe/London"); checkOffset(test.getRules(), createLDT(2008, 3, 24), ZoneOffset.ofHours(0), 1); @@ -238,6 +251,7 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), LocalDateTime.of(2008, 3, 30, 2, 0, 0, 0), ZoneOffset.ofHours(1), 1); } + @Test public void test_London_getOffsetInfo_fromDST() { ZoneId test = ZoneId.of("Europe/London"); checkOffset(test.getRules(), createLDT(2008, 10, 24), ZoneOffset.ofHours(1), 1); @@ -254,22 +268,23 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), LocalDateTime.of(2008, 10, 26, 2, 0, 0, 0), ZoneOffset.ofHours(0), 1); } + @Test public void test_London_getOffsetInfo_gap() { ZoneId test = ZoneId.of("Europe/London"); final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 1, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test.getRules(), dateTime, ZoneOffset.ofHours(0), GAP); - assertEquals(trans.isGap(), true); - assertEquals(trans.isOverlap(), false); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(0)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(1)); - assertEquals(trans.getInstant(), dateTime.toInstant(ZoneOffset.UTC)); - assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(2008, 3, 30, 1, 0)); - assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(2008, 3, 30, 2, 0)); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-1)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(0)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(1)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(2)), false); - assertEquals(trans.toString(), "Transition[Gap at 2008-03-30T01:00Z to +01:00]"); + assertEquals(true, trans.isGap()); + assertEquals(false, trans.isOverlap()); + assertEquals(ZoneOffset.ofHours(0), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(1), trans.getOffsetAfter()); + assertEquals(dateTime.toInstant(ZoneOffset.UTC), trans.getInstant()); + assertEquals(LocalDateTime.of(2008, 3, 30, 1, 0), trans.getDateTimeBefore()); + assertEquals(LocalDateTime.of(2008, 3, 30, 2, 0), trans.getDateTimeAfter()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-1))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(0))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(1))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(2))); + assertEquals("Transition[Gap at 2008-03-30T01:00Z to +01:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(0))); @@ -277,25 +292,26 @@ public class TestZoneId extends AbstractTest { final ZoneOffsetTransition otherTrans = test.getRules().getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } + @Test public void test_London_getOffsetInfo_overlap() { ZoneId test = ZoneId.of("Europe/London"); final LocalDateTime dateTime = LocalDateTime.of(2008, 10, 26, 1, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test.getRules(), dateTime, ZoneOffset.ofHours(1), OVERLAP); - assertEquals(trans.isGap(), false); - assertEquals(trans.isOverlap(), true); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(1)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(0)); - assertEquals(trans.getInstant(), dateTime.toInstant(ZoneOffset.UTC)); - assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(2008, 10, 26, 2, 0)); - assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(2008, 10, 26, 1, 0)); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-1)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(0)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(1)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(2)), false); - assertEquals(trans.toString(), "Transition[Overlap at 2008-10-26T02:00+01:00 to Z]"); + assertEquals(false, trans.isGap()); + assertEquals(true, trans.isOverlap()); + assertEquals(ZoneOffset.ofHours(1), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(0), trans.getOffsetAfter()); + assertEquals(dateTime.toInstant(ZoneOffset.UTC), trans.getInstant()); + assertEquals(LocalDateTime.of(2008, 10, 26, 2, 0), trans.getDateTimeBefore()); + assertEquals(LocalDateTime.of(2008, 10, 26, 1, 0), trans.getDateTimeAfter()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-1))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(0))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(1))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(2))); + assertEquals("Transition[Overlap at 2008-10-26T02:00+01:00 to Z]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(1))); @@ -303,64 +319,69 @@ public class TestZoneId extends AbstractTest { final ZoneOffsetTransition otherTrans = test.getRules().getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } //----------------------------------------------------------------------- // Europe/Paris //----------------------------------------------------------------------- + @Test public void test_Paris() { ZoneId test = ZoneId.of("Europe/Paris"); - assertEquals(test.getId(), "Europe/Paris"); - assertEquals(test.getRules().isFixedOffset(), false); + assertEquals("Europe/Paris", test.getId()); + assertEquals(false, test.getRules().isFixedOffset()); } + @Test public void test_Paris_getOffset() { ZoneId test = ZoneId.of("Europe/Paris"); - assertEquals(test.getRules().getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 2, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 4, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 5, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 6, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 7, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 8, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 9, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 10, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 11, 1, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC))); } + @Test public void test_Paris_getOffset_toDST() { ZoneId test = ZoneId.of("Europe/Paris"); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 25, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 26, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 27, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 28, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 29, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 30, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 3, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 3, 30, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC))); } + @Test public void test_Paris_getOffset_fromDST() { ZoneId test = ZoneId.of("Europe/Paris"); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 10, 25, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 10, 26, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 27, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 28, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 29, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 30, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 31, ZoneOffset.UTC))); // cutover at 01:00Z - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC)), ZoneOffset.ofHours(2)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC)), ZoneOffset.ofHours(1)); + assertEquals(ZoneOffset.ofHours(2), test.getRules().getOffset(createInstant(2008, 10, 26, 0, 59, 59, 999999999, ZoneOffset.UTC))); + assertEquals(ZoneOffset.ofHours(1), test.getRules().getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC))); } + @Test public void test_Paris_getOffsetInfo() { ZoneId test = ZoneId.of("Europe/Paris"); checkOffset(test.getRules(), createLDT(2008, 1, 1), ZoneOffset.ofHours(1), 1); @@ -377,6 +398,7 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), createLDT(2008, 12, 1), ZoneOffset.ofHours(1), 1); } + @Test public void test_Paris_getOffsetInfo_toDST() { ZoneId test = ZoneId.of("Europe/Paris"); checkOffset(test.getRules(), createLDT(2008, 3, 24), ZoneOffset.ofHours(1), 1); @@ -393,6 +415,7 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), LocalDateTime.of(2008, 3, 30, 3, 0, 0, 0), ZoneOffset.ofHours(2), 1); } + @Test public void test_Paris_getOffsetInfo_fromDST() { ZoneId test = ZoneId.of("Europe/Paris"); checkOffset(test.getRules(), createLDT(2008, 10, 24), ZoneOffset.ofHours(2), 1); @@ -409,20 +432,21 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), LocalDateTime.of(2008, 10, 26, 3, 0, 0, 0), ZoneOffset.ofHours(1), 1); } + @Test public void test_Paris_getOffsetInfo_gap() { ZoneId test = ZoneId.of("Europe/Paris"); final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 2, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test.getRules(), dateTime, ZoneOffset.ofHours(1), GAP); - assertEquals(trans.isGap(), true); - assertEquals(trans.isOverlap(), false); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(1)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(2)); - assertEquals(trans.getInstant(), createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC)); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(0)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(1)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(2)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(3)), false); - assertEquals(trans.toString(), "Transition[Gap at 2008-03-30T02:00+01:00 to +02:00]"); + assertEquals(true, trans.isGap()); + assertEquals(false, trans.isOverlap()); + assertEquals(ZoneOffset.ofHours(1), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(2), trans.getOffsetAfter()); + assertEquals(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC), trans.getInstant()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(0))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(1))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(2))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(3))); + assertEquals("Transition[Gap at 2008-03-30T02:00+01:00 to +02:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(1))); @@ -430,23 +454,24 @@ public class TestZoneId extends AbstractTest { final ZoneOffsetTransition otherDis = test.getRules().getTransition(dateTime); assertTrue(trans.equals(otherDis)); - assertEquals(trans.hashCode(), otherDis.hashCode()); + assertEquals(otherDis.hashCode(), trans.hashCode()); } + @Test public void test_Paris_getOffsetInfo_overlap() { ZoneId test = ZoneId.of("Europe/Paris"); final LocalDateTime dateTime = LocalDateTime.of(2008, 10, 26, 2, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test.getRules(), dateTime, ZoneOffset.ofHours(2), OVERLAP); - assertEquals(trans.isGap(), false); - assertEquals(trans.isOverlap(), true); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(2)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(1)); - assertEquals(trans.getInstant(), createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC)); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(0)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(1)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(2)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(3)), false); - assertEquals(trans.toString(), "Transition[Overlap at 2008-10-26T03:00+02:00 to +01:00]"); + assertEquals(false, trans.isGap()); + assertEquals(true, trans.isOverlap()); + assertEquals(ZoneOffset.ofHours(2), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(1), trans.getOffsetAfter()); + assertEquals(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC), trans.getInstant()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(0))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(1))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(2))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(3))); + assertEquals("Transition[Overlap at 2008-10-26T03:00+02:00 to +01:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(2))); @@ -454,77 +479,82 @@ public class TestZoneId extends AbstractTest { final ZoneOffsetTransition otherDis = test.getRules().getTransition(dateTime); assertTrue(trans.equals(otherDis)); - assertEquals(trans.hashCode(), otherDis.hashCode()); + assertEquals(otherDis.hashCode(), trans.hashCode()); } //----------------------------------------------------------------------- // America/New_York //----------------------------------------------------------------------- + @Test public void test_NewYork() { ZoneId test = ZoneId.of("America/New_York"); - assertEquals(test.getId(), "America/New_York"); - assertEquals(test.getRules().isFixedOffset(), false); + assertEquals("America/New_York", test.getId()); + assertEquals(false, test.getRules().isFixedOffset()); } + @Test public void test_NewYork_getOffset() { ZoneId test = ZoneId.of("America/New_York"); ZoneOffset offset = ZoneOffset.ofHours(-5); - assertEquals(test.getRules().getOffset(createInstant(2008, 1, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 2, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 4, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 5, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 6, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 7, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 8, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 9, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 12, 1, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 1, 28, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 2, 28, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 4, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 5, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 6, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 7, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 8, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 9, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 10, 28, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 28, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 12, 28, offset)), ZoneOffset.ofHours(-5)); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 1, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 2, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 3, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 4, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 5, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 6, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 7, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 8, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 9, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 10, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 11, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 12, 1, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 1, 28, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 2, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 3, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 4, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 5, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 6, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 7, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 8, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 9, 28, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 10, 28, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 11, 28, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 12, 28, offset))); } + @Test public void test_NewYork_getOffset_toDST() { ZoneId test = ZoneId.of("America/New_York"); ZoneOffset offset = ZoneOffset.ofHours(-5); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 8, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 9, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 10, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 11, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 12, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 13, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 14, offset)), ZoneOffset.ofHours(-4)); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 3, 8, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 3, 9, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 3, 10, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 3, 11, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 3, 12, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 3, 13, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 3, 14, offset))); // cutover at 02:00 local - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 9, 1, 59, 59, 999999999, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 3, 9, 2, 0, 0, 0, offset)), ZoneOffset.ofHours(-4)); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 3, 9, 1, 59, 59, 999999999, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 3, 9, 2, 0, 0, 0, offset))); } + @Test public void test_NewYork_getOffset_fromDST() { ZoneId test = ZoneId.of("America/New_York"); ZoneOffset offset = ZoneOffset.ofHours(-4); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 1, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 2, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 3, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 4, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 5, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 6, offset)), ZoneOffset.ofHours(-5)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 7, offset)), ZoneOffset.ofHours(-5)); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 11, 1, offset))); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 11, 2, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 11, 3, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 11, 4, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 11, 5, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 11, 6, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 11, 7, offset))); // cutover at 02:00 local - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 2, 1, 59, 59, 999999999, offset)), ZoneOffset.ofHours(-4)); - assertEquals(test.getRules().getOffset(createInstant(2008, 11, 2, 2, 0, 0, 0, offset)), ZoneOffset.ofHours(-5)); + assertEquals(ZoneOffset.ofHours(-4), test.getRules().getOffset(createInstant(2008, 11, 2, 1, 59, 59, 999999999, offset))); + assertEquals(ZoneOffset.ofHours(-5), test.getRules().getOffset(createInstant(2008, 11, 2, 2, 0, 0, 0, offset))); } + @Test public void test_NewYork_getOffsetInfo() { ZoneId test = ZoneId.of("America/New_York"); checkOffset(test.getRules(), createLDT(2008, 1, 1), ZoneOffset.ofHours(-5), 1); @@ -553,6 +583,7 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), createLDT(2008, 12, 28), ZoneOffset.ofHours(-5), 1); } + @Test public void test_NewYork_getOffsetInfo_toDST() { ZoneId test = ZoneId.of("America/New_York"); checkOffset(test.getRules(), createLDT(2008, 3, 8), ZoneOffset.ofHours(-5), 1); @@ -568,6 +599,7 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), LocalDateTime.of(2008, 3, 9, 3, 0, 0, 0), ZoneOffset.ofHours(-4), 1); } + @Test public void test_NewYork_getOffsetInfo_fromDST() { ZoneId test = ZoneId.of("America/New_York"); checkOffset(test.getRules(), createLDT(2008, 11, 1), ZoneOffset.ofHours(-4), 1); @@ -583,18 +615,19 @@ public class TestZoneId extends AbstractTest { checkOffset(test.getRules(), LocalDateTime.of(2008, 11, 2, 2, 0, 0, 0), ZoneOffset.ofHours(-5), 1); } + @Test public void test_NewYork_getOffsetInfo_gap() { ZoneId test = ZoneId.of("America/New_York"); final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 9, 2, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test.getRules(), dateTime, ZoneOffset.ofHours(-5), GAP); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(-5)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(-4)); - assertEquals(trans.getInstant(), createInstant(2008, 3, 9, 2, 0, 0, 0, ZoneOffset.ofHours(-5))); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-6)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-5)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-4)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-3)), false); - assertEquals(trans.toString(), "Transition[Gap at 2008-03-09T02:00-05:00 to -04:00]"); + assertEquals(ZoneOffset.ofHours(-5), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(-4), trans.getOffsetAfter()); + assertEquals(createInstant(2008, 3, 9, 2, 0, 0, 0, ZoneOffset.ofHours(-5)), trans.getInstant()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-6))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-5))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-4))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-3))); + assertEquals("Transition[Gap at 2008-03-09T02:00-05:00 to -04:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(-5))); @@ -603,21 +636,22 @@ public class TestZoneId extends AbstractTest { final ZoneOffsetTransition otherTrans = test.getRules().getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } + @Test public void test_NewYork_getOffsetInfo_overlap() { ZoneId test = ZoneId.of("America/New_York"); final LocalDateTime dateTime = LocalDateTime.of(2008, 11, 2, 1, 0, 0, 0); ZoneOffsetTransition trans = checkOffset(test.getRules(), dateTime, ZoneOffset.ofHours(-4), OVERLAP); - assertEquals(trans.getOffsetBefore(), ZoneOffset.ofHours(-4)); - assertEquals(trans.getOffsetAfter(), ZoneOffset.ofHours(-5)); - assertEquals(trans.getInstant(), createInstant(2008, 11, 2, 2, 0, 0, 0, ZoneOffset.ofHours(-4))); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-1)), false); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-5)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(-4)), true); - assertEquals(trans.isValidOffset(ZoneOffset.ofHours(2)), false); - assertEquals(trans.toString(), "Transition[Overlap at 2008-11-02T02:00-04:00 to -05:00]"); + assertEquals(ZoneOffset.ofHours(-4), trans.getOffsetBefore()); + assertEquals(ZoneOffset.ofHours(-5), trans.getOffsetAfter()); + assertEquals(createInstant(2008, 11, 2, 2, 0, 0, 0, ZoneOffset.ofHours(-4)), trans.getInstant()); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(-1))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(-5))); + assertEquals(true, trans.isValidOffset(ZoneOffset.ofHours(-4))); + assertEquals(false, trans.isValidOffset(ZoneOffset.ofHours(2))); + assertEquals("Transition[Overlap at 2008-11-02T02:00-04:00 to -05:00]", trans.toString()); assertFalse(trans.equals(null)); assertFalse(trans.equals(ZoneOffset.ofHours(-4))); @@ -626,22 +660,24 @@ public class TestZoneId extends AbstractTest { final ZoneOffsetTransition otherTrans = test.getRules().getTransition(dateTime); assertTrue(trans.equals(otherTrans)); - assertEquals(trans.hashCode(), otherTrans.hashCode()); + assertEquals(otherTrans.hashCode(), trans.hashCode()); } //----------------------------------------------------------------------- // getXxx() isXxx() //----------------------------------------------------------------------- + @Test public void test_get_Tzdb() { ZoneId test = ZoneId.of("Europe/London"); - assertEquals(test.getId(), "Europe/London"); - assertEquals(test.getRules().isFixedOffset(), false); + assertEquals("Europe/London", test.getId()); + assertEquals(false, test.getRules().isFixedOffset()); } + @Test public void test_get_TzdbFixed() { ZoneId test = ZoneId.of("+01:30"); - assertEquals(test.getId(), "+01:30"); - assertEquals(test.getRules().isFixedOffset(), true); + assertEquals("+01:30", test.getId()); + assertEquals(true, test.getRules().isFixedOffset()); } //----------------------------------------------------------------------- @@ -665,17 +701,17 @@ public class TestZoneId extends AbstractTest { private ZoneOffsetTransition checkOffset(ZoneRules rules, LocalDateTime dateTime, ZoneOffset offset, int type) { List validOffsets = rules.getValidOffsets(dateTime); - assertEquals(validOffsets.size(), type); - assertEquals(rules.getOffset(dateTime), offset); + assertEquals(type, validOffsets.size()); + assertEquals(offset, rules.getOffset(dateTime)); if (type == 1) { - assertEquals(validOffsets.get(0), offset); + assertEquals(offset, validOffsets.get(0)); return null; } else { ZoneOffsetTransition zot = rules.getTransition(dateTime); assertNotNull(zot); - assertEquals(zot.isOverlap(), type == 2); - assertEquals(zot.isGap(), type == 0); - assertEquals(zot.isValidOffset(offset), type == 2); + assertEquals(type == 2, zot.isOverlap()); + assertEquals(type == 0, zot.isGap()); + assertEquals(type == 2, zot.isValidOffset(offset)); return zot; } } diff --git a/test/jdk/java/time/test/java/time/TestZoneOffset.java b/test/jdk/java/time/test/java/time/TestZoneOffset.java index b85a629aefc..8a42fe2a0ab 100644 --- a/test/jdk/java/time/test/java/time/TestZoneOffset.java +++ b/test/jdk/java/time/test/java/time/TestZoneOffset.java @@ -60,17 +60,16 @@ */ package test.java.time; -import static org.testng.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertSame; import java.util.Set; import java.time.ZoneOffset; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test ZoneOffset. */ -@Test public class TestZoneOffset extends AbstractTest { @Test diff --git a/test/jdk/java/time/test/java/time/TestZonedDateTime.java b/test/jdk/java/time/test/java/time/TestZonedDateTime.java index 15a95d1f3bc..436187cf3d0 100644 --- a/test/jdk/java/time/test/java/time/TestZonedDateTime.java +++ b/test/jdk/java/time/test/java/time/TestZonedDateTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,21 +59,20 @@ */ package test.java.time; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Duration; import java.time.LocalDateTime; import java.time.ZonedDateTime; import java.time.ZoneId; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test ZonedDateTime. * * @bug 8211990 */ -@Test public class TestZonedDateTime extends AbstractTest { @Test @@ -89,6 +88,6 @@ public class TestZonedDateTime extends AbstractTest { ZonedDateTime end = ZonedDateTime.of(LocalDateTime.MAX, sanJose); ZonedDateTime start = end.withZoneSameLocal(tokyo); - assertEquals(Duration.between(start, end), Duration.ofHours(17)); + assertEquals(Duration.ofHours(17), Duration.between(start, end)); } } diff --git a/test/jdk/java/time/test/java/time/chrono/TestChronoLocalDate.java b/test/jdk/java/time/test/java/time/chrono/TestChronoLocalDate.java index 79410941206..bb738feee05 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestChronoLocalDate.java +++ b/test/jdk/java/time/test/java/time/chrono/TestChronoLocalDate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -54,8 +54,8 @@ */ package test.java.time.chrono; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.LocalDate; import java.time.LocalDateTime; @@ -69,16 +69,16 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test chrono local date. */ -@Test public class TestChronoLocalDate { // this class primarily tests whether the generics work OK //----------------------------------------------------------------------- + @Test public void test_date_comparator_checkGenerics_ISO() { List dates = new ArrayList<>(); ChronoLocalDate date = LocalDate.of(2013, 1, 1); @@ -99,10 +99,11 @@ public class TestChronoLocalDate { List copy = new ArrayList<>(dates); Collections.shuffle(copy); Collections.sort(copy, ChronoLocalDate.timeLineOrder()); - assertEquals(copy, dates); + assertEquals(dates, copy); assertTrue(ChronoLocalDate.timeLineOrder().compare(copy.get(0), copy.get(1)) < 0); } + @Test public void test_date_comparator_checkGenerics_LocalDate() { List dates = new ArrayList<>(); LocalDate date = LocalDate.of(2013, 1, 1); @@ -123,11 +124,12 @@ public class TestChronoLocalDate { List copy = new ArrayList<>(dates); Collections.shuffle(copy); Collections.sort(copy, ChronoLocalDate.timeLineOrder()); - assertEquals(copy, dates); + assertEquals(dates, copy); assertTrue(ChronoLocalDate.timeLineOrder().compare(copy.get(0), copy.get(1)) < 0); } //----------------------------------------------------------------------- + @Test public void test_date_checkGenerics_genericsMethod() { Chronology chrono = ThaiBuddhistChronology.INSTANCE; ChronoLocalDate date = chrono.dateNow(); @@ -138,6 +140,7 @@ public class TestChronoLocalDate { date = processClassWeird(ThaiBuddhistDate.class); } + @Test public void test_date_checkGenerics_genericsMethod_concreteType() { ThaiBuddhistChronology chrono = ThaiBuddhistChronology.INSTANCE; ThaiBuddhistDate date = chrono.dateNow(); @@ -149,6 +152,7 @@ public class TestChronoLocalDate { // date = processClassWeird(ThaiBuddhistDate.class); // does not compile (correct) } + @Test public void test_date_checkGenerics_genericsMethod_withType() { Chronology chrono = ThaiBuddhistChronology.INSTANCE; @SuppressWarnings("unchecked") @@ -180,6 +184,7 @@ public class TestChronoLocalDate { return null; } + @Test public void test_date_checkGenerics_chronoLocalDateTime1() { LocalDateTime now = LocalDateTime.now(); Chronology chrono = ThaiBuddhistChronology.INSTANCE; @@ -187,6 +192,7 @@ public class TestChronoLocalDate { ldt = processCLDT(ldt); } + @Test public void test_date_checkGenerics_chronoLocalDateTime2() { LocalDateTime now = LocalDateTime.now(); Chronology chrono = ThaiBuddhistChronology.INSTANCE; diff --git a/test/jdk/java/time/test/java/time/chrono/TestChronologyPerf.java b/test/jdk/java/time/test/java/time/chrono/TestChronologyPerf.java index 5026ebf1700..ab6bdd7ee1d 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestChronologyPerf.java +++ b/test/jdk/java/time/test/java/time/chrono/TestChronologyPerf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 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 @@ -29,7 +29,7 @@ import java.time.chrono.HijrahDate; import java.time.temporal.ChronoUnit; import java.util.Set; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test the speed of initializing all calendars. diff --git a/test/jdk/java/time/test/java/time/chrono/TestEraDisplayName.java b/test/jdk/java/time/test/java/time/chrono/TestEraDisplayName.java index 4e20ceb5495..99cd7499adb 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestEraDisplayName.java +++ b/test/jdk/java/time/test/java/time/chrono/TestEraDisplayName.java @@ -30,10 +30,11 @@ import java.util.Arrays; import java.util.Locale; import java.util.stream.Stream; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Tests Era.getDisplayName() correctly returns the name based on each @@ -42,7 +43,7 @@ import static org.testng.Assert.assertFalse; * * @bug 8171049 8224105 8240626 8354548 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestEraDisplayName { private static final Locale THAI = Locale.forLanguageTag("th-TH"); private static final Locale EGYPT = Locale.forLanguageTag("ar-EG"); @@ -52,7 +53,6 @@ public class TestEraDisplayName { DateTimeFormatter.ofPattern("yyyy MM dd GGGG G GGGGG") .withChronology(JapaneseChronology.INSTANCE); - @DataProvider(name="eraDisplayName") Object[][] eraDisplayName() { return new Object[][] { // Era, text style, displyay locale, expected name @@ -141,7 +141,6 @@ public class TestEraDisplayName { }; } - @DataProvider Object[][] allLocales() { return Arrays.stream(Locale.getAvailableLocales()) .map(Stream::of) @@ -149,7 +148,6 @@ public class TestEraDisplayName { .toArray(Object[][]::new); } - @DataProvider Object[][] allEras() { return Stream.of(IsoEra.values(), JapaneseEra.values(), @@ -162,29 +160,28 @@ public class TestEraDisplayName { .toArray(Object[][]::new); } - @Test(dataProvider="eraDisplayName") + @ParameterizedTest + @MethodSource("eraDisplayName") public void test_eraDisplayName(Era era, TextStyle style, Locale locale, String expected) { - assertEquals(era.getDisplayName(style, locale), expected); + assertEquals(expected, era.getDisplayName(style, locale)); } - @Test(dataProvider="allLocales") + @ParameterizedTest + @MethodSource("allLocales") public void test_reiwaNames(Locale locale) throws DateTimeParseException { DateTimeFormatter f = JAPANESE_FORMATTER.withLocale(locale); - assertEquals(LocalDate.parse(REIWA_1ST.format(f), f), REIWA_1ST); + assertEquals(REIWA_1ST, LocalDate.parse(REIWA_1ST.format(f), f)); } // Make sure era display names aren't empty // @bug 8240626 - @Test(dataProvider="allEras") + @ParameterizedTest + @MethodSource("allEras") public void test_noEmptyEraNames(Era era) { Arrays.stream(Locale.getAvailableLocales()) - .forEach(l -> { - Arrays.stream(TextStyle.values()) - .forEach(s -> { - assertFalse(era.getDisplayName(s, l).isEmpty(), - "getDisplayName() returns empty display name for era: " + era - + ", style: " + s + ", locale: " + l); - }); - }); + .forEach(l -> Arrays.stream(TextStyle.values()) + .forEach(s -> assertFalse(era.getDisplayName(s, l).isEmpty(), + "getDisplayName() returns empty display name for era: " + era + + ", style: " + s + ", locale: " + l))); } } diff --git a/test/jdk/java/time/test/java/time/chrono/TestExampleCode.java b/test/jdk/java/time/test/java/time/chrono/TestExampleCode.java index 5258a0b8062..b4e3c41d5e3 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestExampleCode.java +++ b/test/jdk/java/time/test/java/time/chrono/TestExampleCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -55,7 +55,7 @@ package test.java.time.chrono; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.LocalDate; import java.time.LocalTime; @@ -72,13 +72,16 @@ import java.time.temporal.ChronoUnit; import java.util.Locale; import java.util.Set; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test case verify that the example code in the package-info.java compiles * and runs. */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestExampleCode { @Test @@ -113,14 +116,14 @@ public class TestExampleCode { //----------------------------------------------------------------------- // Data provider for Hijrah Type names //----------------------------------------------------------------------- - @DataProvider(name = "HijrahTypeNames") Object[][] data_of_ummalqura() { return new Object[][]{ { "Hijrah-umalqura", "islamic-umalqura"}, }; } - @Test(dataProvider= "HijrahTypeNames") + @ParameterizedTest + @MethodSource("data_of_ummalqura") public void test_HijrahTypeViaLocale(String calendarId, String calendarType) { Locale.Builder builder = new Locale.Builder(); builder.setLanguage("en").setRegion("US"); @@ -130,7 +133,7 @@ public class TestExampleCode { System.out.printf(" Locale language tag: %s, Chronology ID: %s, type: %s%n", locale.toLanguageTag(), chrono, chrono.getCalendarType()); Chronology expected = Chronology.of(calendarId); - assertEquals(chrono, expected, "Expected chronology not found"); + assertEquals(expected, chrono, "Expected chronology not found"); } @Test diff --git a/test/jdk/java/time/test/java/time/chrono/TestIsoChronoImpl.java b/test/jdk/java/time/test/java/time/chrono/TestIsoChronoImpl.java index 59f5016a6fc..adc8949e61e 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestIsoChronoImpl.java +++ b/test/jdk/java/time/test/java/time/chrono/TestIsoChronoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -58,7 +58,8 @@ import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.ChronoField.YEAR; import static java.time.temporal.ChronoField.YEAR_OF_ERA; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DayOfWeek; import java.time.LocalDate; @@ -69,16 +70,16 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.TimeZone; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestIsoChronoImpl { - @DataProvider(name = "RangeVersusCalendar") Object[][] provider_rangeVersusCalendar() { return new Object[][]{ {LocalDate.of(1583, 1, 1), LocalDate.of(2100, 1, 1)}, @@ -88,10 +89,11 @@ public class TestIsoChronoImpl { //----------------------------------------------------------------------- // Verify ISO Calendar matches java.util.Calendar for range //----------------------------------------------------------------------- - @Test(dataProvider = "RangeVersusCalendar") + @ParameterizedTest + @MethodSource("provider_rangeVersusCalendar") public void test_IsoChrono_vsCalendar(LocalDate isoStartDate, LocalDate isoEndDate) { GregorianCalendar cal = new GregorianCalendar(); - assertEquals(cal.getCalendarType(), "gregory", "Unexpected calendar type"); + assertEquals("gregory", cal.getCalendarType(), "Unexpected calendar type"); LocalDate isoDate = IsoChronology.INSTANCE.date(isoStartDate); cal.setTimeZone(TimeZone.getTimeZone("GMT+00")); @@ -100,9 +102,9 @@ public class TestIsoChronoImpl { cal.set(Calendar.DAY_OF_MONTH, isoDate.get(DAY_OF_MONTH)); while (isoDate.isBefore(isoEndDate)) { - assertEquals(isoDate.get(DAY_OF_MONTH), cal.get(Calendar.DAY_OF_MONTH), "Day mismatch in " + isoDate + "; cal: " + cal); - assertEquals(isoDate.get(MONTH_OF_YEAR), cal.get(Calendar.MONTH) + 1, "Month mismatch in " + isoDate); - assertEquals(isoDate.get(YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + isoDate); + assertEquals(cal.get(Calendar.DAY_OF_MONTH), isoDate.get(DAY_OF_MONTH), "Day mismatch in " + isoDate + "; cal: " + cal); + assertEquals(cal.get(Calendar.MONTH) + 1, isoDate.get(MONTH_OF_YEAR), "Month mismatch in " + isoDate); + assertEquals(cal.get(Calendar.YEAR), isoDate.get(YEAR_OF_ERA), "Year mismatch in " + isoDate); isoDate = isoDate.plus(1, ChronoUnit.DAYS); cal.add(Calendar.DAY_OF_MONTH, 1); @@ -113,10 +115,11 @@ public class TestIsoChronoImpl { // Verify ISO Calendar matches java.util.Calendar // DayOfWeek, WeekOfMonth, WeekOfYear for range //----------------------------------------------------------------------- - @Test(dataProvider = "RangeVersusCalendar") + @ParameterizedTest + @MethodSource("provider_rangeVersusCalendar") public void test_DayOfWeek_IsoChronology_vsCalendar(LocalDate isoStartDate, LocalDate isoEndDate) { GregorianCalendar cal = new GregorianCalendar(); - assertEquals(cal.getCalendarType(), "gregory", "Unexpected calendar type"); + assertEquals("gregory", cal.getCalendarType(), "Unexpected calendar type"); LocalDate isoDate = IsoChronology.INSTANCE.date(isoStartDate); for (DayOfWeek firstDayOfWeek : DayOfWeek.values()) { @@ -132,29 +135,29 @@ public class TestIsoChronoImpl { // For every date in the range while (isoDate.isBefore(isoEndDate)) { - assertEquals(isoDate.get(DAY_OF_MONTH), cal.get(Calendar.DAY_OF_MONTH), "Day mismatch in " + isoDate + "; cal: " + cal); - assertEquals(isoDate.get(MONTH_OF_YEAR), cal.get(Calendar.MONTH) + 1, "Month mismatch in " + isoDate); - assertEquals(isoDate.get(YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + isoDate); + assertEquals(cal.get(Calendar.DAY_OF_MONTH), isoDate.get(DAY_OF_MONTH), "Day mismatch in " + isoDate + "; cal: " + cal); + assertEquals(cal.get(Calendar.MONTH) + 1, isoDate.get(MONTH_OF_YEAR), "Month mismatch in " + isoDate); + assertEquals(cal.get(Calendar.YEAR), isoDate.get(YEAR_OF_ERA), "Year mismatch in " + isoDate); int jdow = Math.floorMod(cal.get(Calendar.DAY_OF_WEEK) - 2, 7) + 1; int dow = isoDate.get(weekDef.dayOfWeek()); - assertEquals(jdow, dow, "Calendar DayOfWeek does not match ISO DayOfWeek"); + assertEquals(dow, jdow, "Calendar DayOfWeek does not match ISO DayOfWeek"); int jweekOfMonth = cal.get(Calendar.WEEK_OF_MONTH); int isoWeekOfMonth = isoDate.get(weekDef.weekOfMonth()); - assertEquals(jweekOfMonth, isoWeekOfMonth, "Calendar WeekOfMonth does not match ISO WeekOfMonth"); + assertEquals(isoWeekOfMonth, jweekOfMonth, "Calendar WeekOfMonth does not match ISO WeekOfMonth"); int jweekOfYear = cal.get(Calendar.WEEK_OF_YEAR); int weekOfYear = isoDate.get(weekDef.weekOfWeekBasedYear()); - assertEquals(jweekOfYear, weekOfYear, "GregorianCalendar WeekOfYear does not match WeekOfWeekBasedYear"); + assertEquals(weekOfYear, jweekOfYear, "GregorianCalendar WeekOfYear does not match WeekOfWeekBasedYear"); int jWeekYear = cal.getWeekYear(); int weekBasedYear = isoDate.get(weekDef.weekBasedYear()); - assertEquals(jWeekYear, weekBasedYear, "GregorianCalendar getWeekYear does not match YearOfWeekBasedYear"); + assertEquals(weekBasedYear, jWeekYear, "GregorianCalendar getWeekYear does not match YearOfWeekBasedYear"); int jweeksInWeekyear = cal.getWeeksInWeekYear(); int weeksInWeekBasedYear = (int)isoDate.range(weekDef.weekOfWeekBasedYear()).getMaximum(); - assertEquals(jweeksInWeekyear, weeksInWeekBasedYear, "length of weekBasedYear"); + assertEquals(weeksInWeekBasedYear, jweeksInWeekyear, "length of weekBasedYear"); isoDate = isoDate.plus(1, ChronoUnit.DAYS); cal.add(Calendar.DAY_OF_MONTH, 1); diff --git a/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronoImpl.java b/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronoImpl.java index fc2fa9798af..6ed24d579dd 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronoImpl.java +++ b/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -54,7 +54,7 @@ */ package test.java.time.chrono; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.LocalDate; import java.time.LocalTime; @@ -71,19 +71,20 @@ import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestJapaneseChronoImpl { /** * Range of years to check consistency with java.util.Calendar */ - @DataProvider(name="RangeVersusCalendar") Object[][] provider_rangeVersusCalendar() { return new Object[][] { {LocalDate.of(1873, 1, 1), LocalDate.of(2100, 1, 1)}, @@ -93,13 +94,14 @@ public class TestJapaneseChronoImpl { //----------------------------------------------------------------------- // Verify Japanese Calendar matches java.util.Calendar for range //----------------------------------------------------------------------- - @Test(dataProvider="RangeVersusCalendar") + @ParameterizedTest + @MethodSource("provider_rangeVersusCalendar") public void test_JapaneseChrono_vsCalendar(LocalDate isoStartDate, LocalDate isoEndDate) { Locale locale = Locale.forLanguageTag("ja-JP-u-ca-japanese"); - assertEquals(locale.toString(), "ja_JP_#u-ca-japanese", "Unexpected locale"); + assertEquals("ja_JP_#u-ca-japanese", locale.toString(), "Unexpected locale"); Calendar cal = java.util.Calendar.getInstance(locale); - assertEquals(cal.getCalendarType(), "japanese", "Unexpected calendar type"); + assertEquals("japanese", cal.getCalendarType(), "Unexpected calendar type"); JapaneseDate jDate = JapaneseChronology.INSTANCE.date(isoStartDate); @@ -110,9 +112,9 @@ public class TestJapaneseChronoImpl { cal.setTimeInMillis(millis); while (jDate.isBefore(isoEndDate)) { - assertEquals(jDate.get(ChronoField.DAY_OF_MONTH), cal.get(Calendar.DAY_OF_MONTH), "Day mismatch in " + jDate + "; cal: " + cal); - assertEquals(jDate.get(ChronoField.MONTH_OF_YEAR), cal.get(Calendar.MONTH) + 1, "Month mismatch in " + jDate); - assertEquals(jDate.get(ChronoField.YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + jDate); + assertEquals(cal.get(Calendar.DAY_OF_MONTH), jDate.get(ChronoField.DAY_OF_MONTH), "Day mismatch in " + jDate + "; cal: " + cal); + assertEquals(cal.get(Calendar.MONTH) + 1, jDate.get(ChronoField.MONTH_OF_YEAR), "Month mismatch in " + jDate); + assertEquals(cal.get(Calendar.YEAR), jDate.get(ChronoField.YEAR_OF_ERA), "Year mismatch in " + jDate); jDate = jDate.plus(1, ChronoUnit.DAYS); cal.add(Calendar.DAY_OF_MONTH, 1); @@ -136,11 +138,11 @@ public class TestJapaneseChronoImpl { cal.setTimeZone(TimeZone.getTimeZone("GMT+00")); cal.setTimeInMillis(millis); - assertEquals(jd.get(ChronoField.DAY_OF_YEAR), cal.get(Calendar.DAY_OF_YEAR), + assertEquals(cal.get(Calendar.DAY_OF_YEAR), jd.get(ChronoField.DAY_OF_YEAR), "different DAY_OF_YEAR values in " + era + ", year: " + year); - assertEquals(jd.range(ChronoField.DAY_OF_YEAR).getMaximum(), cal.getActualMaximum(Calendar.DAY_OF_YEAR), + assertEquals(cal.getActualMaximum(Calendar.DAY_OF_YEAR), jd.range(ChronoField.DAY_OF_YEAR).getMaximum(), "different maximum for DAY_OF_YEAR in " + era + ", year: " + year); - assertEquals(jd.range(ChronoField.DAY_OF_YEAR).getMinimum(), cal.getActualMinimum(Calendar.DAY_OF_YEAR), + assertEquals(cal.getActualMinimum(Calendar.DAY_OF_YEAR), jd.range(ChronoField.DAY_OF_YEAR).getMinimum(), "different minimum for DAY_OF_YEAR in " + era + ", year: " + year); } } diff --git a/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronology.java b/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronology.java index 6e7df8638f9..85c33a964a3 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronology.java +++ b/test/jdk/java/time/test/java/time/chrono/TestJapaneseChronology.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, 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 @@ -29,20 +29,22 @@ import java.time.temporal.*; import java.util.List; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; +import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Tests for the Japanese chronology */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestJapaneseChronology { private static final JapaneseChronology JAPANESE = JapaneseChronology.INSTANCE; private static final Locale jaJPJP = Locale.forLanguageTag("ja-JP-u-ca-japanese"); - @DataProvider(name="transitions") Object[][] transitionData() { return new Object[][] { // Japanese era, yearOfEra, month, dayOfMonth, gregorianYear @@ -62,7 +64,6 @@ public class TestJapaneseChronology { }; } - @DataProvider(name="day_year_data") Object[][] dayYearData() { return new Object[][] { // Japanese era, yearOfEra, dayOfYear, month, dayOfMonth @@ -80,7 +81,6 @@ public class TestJapaneseChronology { }; } - @DataProvider(name="range_data") Object[][] rangeData() { return new Object[][] { // field, minSmallest, minLargest, maxSmallest, maxLargest @@ -91,7 +91,6 @@ public class TestJapaneseChronology { }; } - @DataProvider(name="invalid_dates") Object[][] invalidDatesData() { return new Object[][] { // Japanese era, yearOfEra, month, dayOfMonth @@ -114,7 +113,6 @@ public class TestJapaneseChronology { }; } - @DataProvider(name="invalid_eraYear") Object[][] invalidEraYearData() { return new Object[][] { // Japanese era, yearOfEra @@ -136,7 +134,6 @@ public class TestJapaneseChronology { }; } - @DataProvider(name="invalid_day_year_data") Object[][] invalidDayYearData() { return new Object[][] { // Japanese era, yearOfEra, dayOfYear @@ -155,7 +152,6 @@ public class TestJapaneseChronology { }; } - @DataProvider Object[][] eraNameData() { return new Object[][] { // Japanese era, name, exception @@ -171,56 +167,69 @@ public class TestJapaneseChronology { @Test public void test_ofLocale() { // must be a singleton - assertEquals(Chronology.ofLocale(jaJPJP) == JAPANESE, true); + assertEquals(true, Chronology.ofLocale(jaJPJP) == JAPANESE); } - @Test(dataProvider="transitions") + @ParameterizedTest + @MethodSource("transitionData") public void test_transitions(JapaneseEra era, int yearOfEra, int month, int dayOfMonth, int gregorianYear) { - assertEquals(JAPANESE.prolepticYear(era, yearOfEra), gregorianYear); + assertEquals(gregorianYear, JAPANESE.prolepticYear(era, yearOfEra)); JapaneseDate jdate1 = JapaneseDate.of(era, yearOfEra, month, dayOfMonth); JapaneseDate jdate2 = JapaneseDate.of(gregorianYear, month, dayOfMonth); - assertEquals(jdate1, jdate2); + assertEquals(jdate2, jdate1); } - @Test(dataProvider="range_data") + @ParameterizedTest + @MethodSource("rangeData") public void test_range(ChronoField field, int minSmallest, int minLargest, int maxSmallest, int maxLargest) { ValueRange range = JAPANESE.range(field); - assertEquals(range.getMinimum(), minSmallest); - assertEquals(range.getLargestMinimum(), minLargest); - assertEquals(range.getSmallestMaximum(), maxSmallest); - assertEquals(range.getMaximum(), maxLargest); + assertEquals(minSmallest, range.getMinimum()); + assertEquals(minLargest, range.getLargestMinimum()); + assertEquals(maxSmallest, range.getSmallestMaximum()); + assertEquals(maxLargest, range.getMaximum()); } - @Test(dataProvider="day_year_data") + @ParameterizedTest + @MethodSource("dayYearData") public void test_firstDayOfEra(JapaneseEra era, int yearOfEra, int dayOfYear, int month, int dayOfMonth) { JapaneseDate date1 = JAPANESE.dateYearDay(era, yearOfEra, dayOfYear); JapaneseDate date2 = JAPANESE.date(era, yearOfEra, month, dayOfMonth); - assertEquals(date1, date2); + assertEquals(date2, date1); } - @Test(dataProvider="invalid_dates", expectedExceptions=DateTimeException.class) + @ParameterizedTest + @MethodSource("invalidDatesData") public void test_invalidDate(JapaneseEra era, int yearOfEra, int month, int dayOfMonth) { - JapaneseDate jdate = JapaneseDate.of(era, yearOfEra, month, dayOfMonth); - System.out.printf("No DateTimeException with %s %d.%02d.%02d%n", era, yearOfEra, month, dayOfMonth); + Assertions.assertThrows(DateTimeException.class, () -> { + JapaneseDate jdate = JapaneseDate.of(era, yearOfEra, month, dayOfMonth); + System.out.printf("No DateTimeException with %s %d.%02d.%02d%n", era, yearOfEra, month, dayOfMonth); + }); } - @Test(dataProvider="invalid_eraYear", expectedExceptions=DateTimeException.class) + @ParameterizedTest + @MethodSource("invalidEraYearData") public void test_invalidEraYear(JapaneseEra era, int yearOfEra) { - int year = JAPANESE.prolepticYear(era, yearOfEra); - System.out.printf("No DateTimeException with era=%s, year=%d%n", era, yearOfEra); + Assertions.assertThrows(DateTimeException.class, () -> { + int year = JAPANESE.prolepticYear(era, yearOfEra); + System.out.printf("No DateTimeException with era=%s, year=%d%n", era, yearOfEra); + }); } - @Test(dataProvider="invalid_day_year_data", expectedExceptions=DateTimeException.class) + @ParameterizedTest + @MethodSource("invalidDayYearData") public void test_invalidDayYear(JapaneseEra era, int yearOfEra, int dayOfYear) { - JapaneseDate date = JAPANESE.dateYearDay(era, yearOfEra, dayOfYear); - System.out.printf("No DateTimeException with era=%s, year=%d, dayOfYear=%d%n", era, yearOfEra, dayOfYear); + Assertions.assertThrows(DateTimeException.class, () -> { + JapaneseDate date = JAPANESE.dateYearDay(era, yearOfEra, dayOfYear); + System.out.printf("No DateTimeException with era=%s, year=%d, dayOfYear=%d%n", era, yearOfEra, dayOfYear); + }); } - @Test(dataProvider="eraNameData") + @ParameterizedTest + @MethodSource("eraNameData") public void test_eraName(String eraName, JapaneseEra era, Class expectedEx) { try { - assertEquals(JapaneseEra.valueOf(eraName), era); + assertEquals(era, JapaneseEra.valueOf(eraName)); } catch (Exception ex) { assertTrue(expectedEx.isInstance(ex)); } diff --git a/test/jdk/java/time/test/java/time/chrono/TestServiceLoader.java b/test/jdk/java/time/test/java/time/chrono/TestServiceLoader.java index 3eaa4253681..93e00b48b7a 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestServiceLoader.java +++ b/test/jdk/java/time/test/java/time/chrono/TestServiceLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,21 +59,20 @@ */ package test.java.time.chrono; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.time.chrono.Chronology; import java.util.HashMap; import java.util.Map; import java.util.ServiceLoader; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Tests that a custom Chronology is available via the ServiceLoader. * The CopticChronology is configured via META-INF/services/java.time.chrono.Chronology. */ -@Test public class TestServiceLoader { @Test @@ -85,7 +84,7 @@ public class TestServiceLoader { } var coptic = chronos.get("Coptic"); assertNotNull(coptic, "CopticChronology not found"); - assertEquals(coptic.isIsoBased(), false); + assertEquals(false, coptic.isIsoBased()); } } diff --git a/test/jdk/java/time/test/java/time/chrono/TestThaiBuddhistChronoImpl.java b/test/jdk/java/time/test/java/time/chrono/TestThaiBuddhistChronoImpl.java index e878ac0dcb3..bb32a9e7d65 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestThaiBuddhistChronoImpl.java +++ b/test/jdk/java/time/test/java/time/chrono/TestThaiBuddhistChronoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -54,7 +54,7 @@ */ package test.java.time.chrono; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.LocalDate; import java.time.chrono.ThaiBuddhistChronology; @@ -65,19 +65,19 @@ import java.util.Calendar; import java.util.Locale; import java.util.TimeZone; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestThaiBuddhistChronoImpl { /** * Range of years to check consistency with java.util.Calendar */ - @DataProvider(name="RangeVersusCalendar") Object[][] provider_rangeVersusCalendar() { return new Object[][] { {LocalDate.of(1583, 1, 1), LocalDate.of(2100, 1, 1)}, @@ -87,12 +87,13 @@ public class TestThaiBuddhistChronoImpl { //----------------------------------------------------------------------- // Verify ThaiBuddhist Calendar matches java.util.Calendar for range //----------------------------------------------------------------------- - @Test(dataProvider="RangeVersusCalendar") + @ParameterizedTest + @MethodSource("provider_rangeVersusCalendar") public void test_ThaiBuddhistChrono_vsCalendar(LocalDate isoStartDate, LocalDate isoEndDate) { Locale locale = Locale.forLanguageTag("th-TH--u-ca-buddhist"); - assertEquals(locale.toString(), "th_TH", "Unexpected locale"); + assertEquals("th_TH", locale.toString(), "Unexpected locale"); Calendar cal = java.util.Calendar.getInstance(locale); - assertEquals(cal.getCalendarType(), "buddhist", "Unexpected calendar type"); + assertEquals("buddhist", cal.getCalendarType(), "Unexpected calendar type"); ThaiBuddhistDate thaiDate = ThaiBuddhistChronology.INSTANCE.date(isoStartDate); @@ -102,9 +103,9 @@ public class TestThaiBuddhistChronoImpl { cal.set(Calendar.DAY_OF_MONTH, thaiDate.get(ChronoField.DAY_OF_MONTH)); while (thaiDate.isBefore(isoEndDate)) { - assertEquals(thaiDate.get(ChronoField.DAY_OF_MONTH), cal.get(Calendar.DAY_OF_MONTH), "Day mismatch in " + thaiDate + "; cal: " + cal); - assertEquals(thaiDate.get(ChronoField.MONTH_OF_YEAR), cal.get(Calendar.MONTH) + 1, "Month mismatch in " + thaiDate); - assertEquals(thaiDate.get(ChronoField.YEAR_OF_ERA), cal.get(Calendar.YEAR), "Year mismatch in " + thaiDate); + assertEquals(cal.get(Calendar.DAY_OF_MONTH), thaiDate.get(ChronoField.DAY_OF_MONTH), "Day mismatch in " + thaiDate + "; cal: " + cal); + assertEquals(cal.get(Calendar.MONTH) + 1, thaiDate.get(ChronoField.MONTH_OF_YEAR), "Month mismatch in " + thaiDate); + assertEquals(cal.get(Calendar.YEAR), thaiDate.get(ChronoField.YEAR_OF_ERA), "Year mismatch in " + thaiDate); thaiDate = thaiDate.plus(1, ChronoUnit.DAYS); cal.add(Calendar.DAY_OF_MONTH, 1); diff --git a/test/jdk/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java b/test/jdk/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java index 8d68abfd227..2dfd112596b 100644 --- a/test/jdk/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java +++ b/test/jdk/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, 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 @@ -27,10 +27,11 @@ import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static java.time.temporal.ChronoField.DAY_OF_YEAR; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.ChronoField.YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.time.DateTimeException; import java.time.DayOfWeek; @@ -64,15 +65,18 @@ import java.time.temporal.ValueRange; import java.time.temporal.WeekFields; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Tests for the Umm alQura chronology and data. * Note: The dates used for testing are just a sample of calendar data. * @bug 8067800 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestUmmAlQuraChronology { private static final ZoneOffset OFFSET_PTWO = ZoneOffset.ofHours(2); @@ -82,21 +86,22 @@ public class TestUmmAlQuraChronology { @Test public void test_aliases() { HijrahChronology hc = (HijrahChronology) Chronology.of("Hijrah"); - assertEquals(hc, HijrahChronology.INSTANCE, "Alias for Hijrah-umalqura"); + assertEquals(HijrahChronology.INSTANCE, hc, "Alias for Hijrah-umalqura"); hc = (HijrahChronology) Chronology.of("islamic"); - assertEquals(hc, HijrahChronology.INSTANCE, "Alias for Hijrah-umalqura"); + assertEquals(HijrahChronology.INSTANCE, hc, "Alias for Hijrah-umalqura"); } // Test to check if the exception is thrown for an incorrect chronology id - @Test(expectedExceptions=DateTimeException.class) + @Test public void test_badChronology() { - Chronology test = Chronology.of("Hijrah-ummalqura"); + Assertions.assertThrows(DateTimeException.class, () -> { + Chronology test = Chronology.of("Hijrah-ummalqura"); + }); } //-------------------------------------------------------------------------- // regular data factory for Umm alQura dates and the corresponding ISO dates //-------------------------------------------------------------------------- - @DataProvider(name = "UmmAlQuraVsISODates") Object[][] data_UmmAlQuraVsISODates() { return new Object[][] { {HijrahDate.of(1318, 1, 1), LocalDate.of(1900, 04, 30)}, @@ -110,9 +115,10 @@ public class TestUmmAlQuraChronology { } // Test to verify the epoch days for given Hijrah & ISO date instances - @Test(dataProvider="UmmAlQuraVsISODates") + @ParameterizedTest + @MethodSource("data_UmmAlQuraVsISODates") public void Test_UmmAlQuraVsISODates(HijrahDate hd, LocalDate ld) { - assertEquals(hd.toEpochDay(), ld.toEpochDay(), "Umm alQura date and ISO date should have same epochDay"); + assertEquals(ld.toEpochDay(), hd.toEpochDay(), "Umm alQura date and ISO date should have same epochDay"); } // UmmAlQura chronology ranges for year, month and days for the HijrahChronology @@ -120,28 +126,27 @@ public class TestUmmAlQuraChronology { public void Test_UmmAlQuraChronoRange() { HijrahChronology chrono = HijrahChronology.INSTANCE; ValueRange year = chrono.range(YEAR); - assertEquals(year.getMinimum(), 1300, "Minimum year"); - assertEquals(year.getLargestMinimum(), 1300, "Largest minimum year"); - assertEquals(year.getMaximum(), 1600, "Largest year"); - assertEquals(year.getSmallestMaximum(), 1600, "Smallest Maximum year"); + assertEquals(1300, year.getMinimum(), "Minimum year"); + assertEquals(1300, year.getLargestMinimum(), "Largest minimum year"); + assertEquals(1600, year.getMaximum(), "Largest year"); + assertEquals(1600, year.getSmallestMaximum(), "Smallest Maximum year"); ValueRange month = chrono.range(MONTH_OF_YEAR); - assertEquals(month.getMinimum(), 1, "Minimum month"); - assertEquals(month.getLargestMinimum(), 1, "Largest minimum month"); - assertEquals(month.getMaximum(), 12, "Largest month"); - assertEquals(month.getSmallestMaximum(), 12, "Smallest Maximum month"); + assertEquals(1, month.getMinimum(), "Minimum month"); + assertEquals(1, month.getLargestMinimum(), "Largest minimum month"); + assertEquals(12, month.getMaximum(), "Largest month"); + assertEquals(12, month.getSmallestMaximum(), "Smallest Maximum month"); ValueRange day = chrono.range(DAY_OF_MONTH); - assertEquals(day.getMinimum(), 1, "Minimum day"); - assertEquals(day.getLargestMinimum(), 1, "Largest minimum day"); - assertEquals(day.getMaximum(), 30, "Largest day"); - assertEquals(day.getSmallestMaximum(), 29, "Smallest Maximum day"); + assertEquals(1, day.getMinimum(), "Minimum day"); + assertEquals(1, day.getLargestMinimum(), "Largest minimum day"); + assertEquals(30, day.getMaximum(), "Largest day"); + assertEquals(29, day.getSmallestMaximum(), "Smallest Maximum day"); } //----------------------------------------------------------------------- // regular data factory for dates and the corresponding range values //----------------------------------------------------------------------- - @DataProvider(name = "dates") Object[][] data_dates() { return new Object[][]{ {HijrahDate.of(1300, 5, 1), 1300, 1600, 1, 12, 1, 30, 30}, @@ -153,7 +158,8 @@ public class TestUmmAlQuraChronology { } // Test to verify the min/max field ranges for given dates - @Test(dataProvider="dates") + @ParameterizedTest + @MethodSource("data_dates") public void Test_UmmAlQuraRanges(HijrahDate date, int minYear, int maxYear, int minMonth, int maxMonth, @@ -161,33 +167,33 @@ public class TestUmmAlQuraChronology { // Check the chronology ranges HijrahChronology chrono = date.getChronology(); ValueRange yearRange = chrono.range(YEAR); - assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah chronology"); - assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah chronology"); - assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah chronology"); - assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest Maximum year for Hijrah chronology"); + assertEquals(minYear, yearRange.getMinimum(), "Minimum year for Hijrah chronology"); + assertEquals(minYear, yearRange.getLargestMinimum(), "Largest minimum year for Hijrah chronology"); + assertEquals(maxYear, yearRange.getMaximum(), "Maximum year for Hijrah chronology"); + assertEquals(maxYear, yearRange.getSmallestMaximum(), "Smallest Maximum year for Hijrah chronology"); ValueRange monthRange = chrono.range(MONTH_OF_YEAR); - assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for Hijrah chronology"); - assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for Hijrah chronology"); + assertEquals(minMonth, monthRange.getMinimum(), "Minimum month for Hijrah chronology"); + assertEquals(maxMonth, monthRange.getMaximum(), "Maximum month for Hijrah chronology"); ValueRange daysRange = chrono.range(DAY_OF_MONTH); - assertEquals(daysRange.getMinimum(), minDay, "Minimum day for chronology"); - assertEquals(daysRange.getMaximum(), maxChronoDay, "Maximum day for Hijrah chronology"); + assertEquals(minDay, daysRange.getMinimum(), "Minimum day for chronology"); + assertEquals(maxChronoDay, daysRange.getMaximum(), "Maximum day for Hijrah chronology"); // Check the date ranges yearRange = date.range(YEAR); - assertEquals(yearRange.getMinimum(), minYear, "Minimum year for Hijrah date"); - assertEquals(yearRange.getLargestMinimum(), minYear, "Largest minimum year for Hijrah date"); - assertEquals(yearRange.getMaximum(), maxYear, "Maximum year for Hijrah date"); - assertEquals(yearRange.getSmallestMaximum(), maxYear, "Smallest maximum year for Hijrah date"); + assertEquals(minYear, yearRange.getMinimum(), "Minimum year for Hijrah date"); + assertEquals(minYear, yearRange.getLargestMinimum(), "Largest minimum year for Hijrah date"); + assertEquals(maxYear, yearRange.getMaximum(), "Maximum year for Hijrah date"); + assertEquals(maxYear, yearRange.getSmallestMaximum(), "Smallest maximum year for Hijrah date"); monthRange = date.range(MONTH_OF_YEAR); - assertEquals(monthRange.getMinimum(), minMonth, "Minimum month for HijrahDate"); - assertEquals(monthRange.getMaximum(), maxMonth, "Maximum month for HijrahDate"); + assertEquals(minMonth, monthRange.getMinimum(), "Minimum month for HijrahDate"); + assertEquals(maxMonth, monthRange.getMaximum(), "Maximum month for HijrahDate"); daysRange = date.range(DAY_OF_MONTH); - assertEquals(daysRange.getMinimum(), minDay, "Minimum day for HijrahDate"); - assertEquals(daysRange.getMaximum(), maxDay, "Maximum day for HijrahDate"); + assertEquals(minDay, daysRange.getMinimum(), "Minimum day for HijrahDate"); + assertEquals(maxDay, daysRange.getMaximum(), "Maximum day for HijrahDate"); } @@ -223,7 +229,6 @@ public class TestUmmAlQuraChronology { } // Data provider to verify the dateYearDay() method - @DataProvider(name="dateYearDay") Object[][] data_dateYearDay() { return new Object[][] { {HijrahChronology.INSTANCE.dateYearDay(1434, 42), HijrahChronology.INSTANCE.date(1434, 02, 13)}, @@ -236,9 +241,10 @@ public class TestUmmAlQuraChronology { } // Test to verify the dateYearDay() method - @Test(dataProvider="dateYearDay") + @ParameterizedTest + @MethodSource("data_dateYearDay") public void test_DateYearDay(ChronoLocalDate date1, ChronoLocalDate date2) { - assertEquals(date1, date2); + assertEquals(date2, date1); } //----------------------------------------------------------------------- @@ -250,7 +256,7 @@ public class TestUmmAlQuraChronology { for (int i = 1; i <= hd1.lengthOfYear(); i++) { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1434, i); int doy = hd.get(DAY_OF_YEAR); - assertEquals(doy, i, "get(DAY_OF_YEAR) incorrect for " + i); + assertEquals(i, doy, "get(DAY_OF_YEAR) incorrect for " + i); } } @@ -260,54 +266,57 @@ public class TestUmmAlQuraChronology { for (int i = 1; i <= hd.lengthOfYear(); i++) { HijrahDate hd2 = hd.with(DAY_OF_YEAR, i); int doy = hd2.get(DAY_OF_YEAR); - assertEquals(doy, i, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2); + assertEquals(i, doy, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2); } } - @Test(expectedExceptions=java.time.DateTimeException.class) + @Test public void test_withDayOfYearTooSmall() { - HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); - HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); + Assertions.assertThrows(DateTimeException.class, () -> { + HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); + HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); + }); } - @Test(expectedExceptions=java.time.DateTimeException.class) + @Test public void test_withDayOfYearTooLarge() { - HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); - HijrahDate hd2 = hd.with(DAY_OF_YEAR, hd.lengthOfYear() + 1); + Assertions.assertThrows(DateTimeException.class, () -> { + HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); + HijrahDate hd2 = hd.with(DAY_OF_YEAR, hd.lengthOfYear() + 1); + }); } // Test to verify the with() method with ChronoField is set to DAY_OF_WEEK @Test public void test_adjustWithDayOfWeek() { - assertEquals(HijrahChronology.INSTANCE.date(1320, 1, 15).with(ChronoField.DAY_OF_WEEK, 4), HijrahDate.of(1320, 1, 15)); - assertEquals(HijrahChronology.INSTANCE.date(1421, 11, 15).with(ChronoField.DAY_OF_WEEK, 1), HijrahDate.of(1421, 11, 11)); - assertEquals(HijrahChronology.INSTANCE.date(1529, 7, 18).with(ChronoField.DAY_OF_WEEK, 6), HijrahDate.of(1529, 7, 20)); - assertEquals(HijrahChronology.INSTANCE.date(1534, 2, 10).with(ChronoField.DAY_OF_WEEK, 5), HijrahDate.of(1534, 2, 12)); - assertEquals(HijrahChronology.INSTANCE.date(1552, 4, 1).with(ChronoField.DAY_OF_WEEK, 2), HijrahDate.of(1552, 3, 26)); + assertEquals(HijrahDate.of(1320, 1, 15), HijrahChronology.INSTANCE.date(1320, 1, 15).with(ChronoField.DAY_OF_WEEK, 4)); + assertEquals(HijrahDate.of(1421, 11, 11), HijrahChronology.INSTANCE.date(1421, 11, 15).with(ChronoField.DAY_OF_WEEK, 1)); + assertEquals(HijrahDate.of(1529, 7, 20), HijrahChronology.INSTANCE.date(1529, 7, 18).with(ChronoField.DAY_OF_WEEK, 6)); + assertEquals(HijrahDate.of(1534, 2, 12), HijrahChronology.INSTANCE.date(1534, 2, 10).with(ChronoField.DAY_OF_WEEK, 5)); + assertEquals(HijrahDate.of(1552, 3, 26), HijrahChronology.INSTANCE.date(1552, 4, 1).with(ChronoField.DAY_OF_WEEK, 2)); } // Test to verify the with() method with ChronoField is set to DAY_OF_MONTH @Test public void test_adjustWithDayOfMonth() { - assertEquals(HijrahChronology.INSTANCE.date(1320, 1, 15).with(ChronoField.DAY_OF_MONTH, 2), HijrahDate.of(1320, 1, 2)); - assertEquals(HijrahChronology.INSTANCE.date(1421, 11, 15).with(ChronoField.DAY_OF_MONTH, 9), HijrahDate.of(1421, 11, 9)); - assertEquals(HijrahChronology.INSTANCE.date(1529, 7, 18).with(ChronoField.DAY_OF_MONTH, 13), HijrahDate.of(1529, 7, 13)); - assertEquals(HijrahChronology.INSTANCE.date(1534, 12, 10).with(ChronoField.DAY_OF_MONTH, 29), HijrahDate.of(1534, 12, 29)); - assertEquals(HijrahChronology.INSTANCE.date(1552, 4, 1).with(ChronoField.DAY_OF_MONTH, 6), HijrahDate.of(1552, 4, 6)); + assertEquals(HijrahDate.of(1320, 1, 2), HijrahChronology.INSTANCE.date(1320, 1, 15).with(ChronoField.DAY_OF_MONTH, 2)); + assertEquals(HijrahDate.of(1421, 11, 9), HijrahChronology.INSTANCE.date(1421, 11, 15).with(ChronoField.DAY_OF_MONTH, 9)); + assertEquals(HijrahDate.of(1529, 7, 13), HijrahChronology.INSTANCE.date(1529, 7, 18).with(ChronoField.DAY_OF_MONTH, 13)); + assertEquals(HijrahDate.of(1534, 12, 29), HijrahChronology.INSTANCE.date(1534, 12, 10).with(ChronoField.DAY_OF_MONTH, 29)); + assertEquals(HijrahDate.of(1552, 4, 6), HijrahChronology.INSTANCE.date(1552, 4, 1).with(ChronoField.DAY_OF_MONTH, 6)); } // Test to verify the with() method with ChronoField is set to DAY_OF_YEAR @Test public void test_adjustWithDayOfYear() { - assertEquals(HijrahChronology.INSTANCE.date(1320, 1, 15).with(ChronoField.DAY_OF_YEAR, 24), HijrahDate.of(1320, 1, 24)); - assertEquals(HijrahChronology.INSTANCE.date(1421, 11, 15).with(ChronoField.DAY_OF_YEAR, 135), HijrahDate.of(1421, 5, 18)); - assertEquals(HijrahChronology.INSTANCE.date(1529, 7, 18).with(ChronoField.DAY_OF_YEAR, 64), HijrahDate.of(1529, 3, 5)); - assertEquals(HijrahChronology.INSTANCE.date(1534, 2, 10).with(ChronoField.DAY_OF_YEAR, 354), HijrahDate.of(1534, 12, 29)); - assertEquals(HijrahChronology.INSTANCE.date(1552, 4, 1).with(ChronoField.DAY_OF_YEAR, 291), HijrahDate.of(1552, 10, 26)); + assertEquals(HijrahDate.of(1320, 1, 24), HijrahChronology.INSTANCE.date(1320, 1, 15).with(ChronoField.DAY_OF_YEAR, 24)); + assertEquals(HijrahDate.of(1421, 5, 18), HijrahChronology.INSTANCE.date(1421, 11, 15).with(ChronoField.DAY_OF_YEAR, 135)); + assertEquals(HijrahDate.of(1529, 3, 5), HijrahChronology.INSTANCE.date(1529, 7, 18).with(ChronoField.DAY_OF_YEAR, 64)); + assertEquals(HijrahDate.of(1534, 12, 29), HijrahChronology.INSTANCE.date(1534, 2, 10).with(ChronoField.DAY_OF_YEAR, 354)); + assertEquals(HijrahDate.of(1552, 10, 26), HijrahChronology.INSTANCE.date(1552, 4, 1).with(ChronoField.DAY_OF_YEAR, 291)); } // Data provider to get the difference between two dates in terms of days, months and years - @DataProvider(name="datesForDiff") Object[][] data_datesForDiffs() { return new Object[][] { {HijrahDate.of(1350, 5, 15), HijrahDate.of(1351, 12, 29), 574, 19, 1}, @@ -319,15 +328,15 @@ public class TestUmmAlQuraChronology { } // Test to verify the difference between two given dates in terms of days, months and years - @Test(dataProvider="datesForDiff") + @ParameterizedTest + @MethodSource("data_datesForDiffs") public void test_diffBetweenDates(ChronoLocalDate from, ChronoLocalDate to, long days, long months, long years) { - assertEquals(from.until(to, ChronoUnit.DAYS), days); - assertEquals(from.until(to, ChronoUnit.MONTHS), months); - assertEquals(from.until(to, ChronoUnit.YEARS), years); + assertEquals(days, from.until(to, ChronoUnit.DAYS)); + assertEquals(months, from.until(to, ChronoUnit.MONTHS)); + assertEquals(years, from.until(to, ChronoUnit.YEARS)); } // Data provider to get the difference between two dates as a period - @DataProvider(name="datesForPeriod") Object[][] data_Period() { return new Object[][] { {HijrahDate.of(1350, 5, 15), HijrahDate.of(1434, 7, 20), HijrahChronology.INSTANCE.period(84, 2, 5)}, @@ -339,34 +348,35 @@ public class TestUmmAlQuraChronology { } // Test to get the Period between two given dates - @Test(dataProvider="datesForPeriod") + @ParameterizedTest + @MethodSource("data_Period") public void test_until(HijrahDate h1, HijrahDate h2, ChronoPeriod p) { ChronoPeriod period = h1.until(h2); - assertEquals(period, p); + assertEquals(p, period); } // Test to get the Period between dates in different chronologies - @Test(dataProvider="datesForPeriod") + @ParameterizedTest + @MethodSource("data_Period") public void test_periodUntilDiffChrono(HijrahDate h1, HijrahDate h2, ChronoPeriod p) { MinguoDate m = MinguoChronology.INSTANCE.date(h2); ChronoPeriod period = h1.until(m); - assertEquals(period, p); + assertEquals(p, period); } // Test to get the adjusted date from a given date using TemporalAdjuster methods @Test public void test_temporalDayAdjustments() { HijrahDate date = HijrahDate.of(1554, 7, 21); - assertEquals(date.with(TemporalAdjusters.firstDayOfMonth()), HijrahDate.of(1554, 7, 1)); - assertEquals(date.with(TemporalAdjusters.lastDayOfMonth()), HijrahDate.of(1554, 7, 29)); - assertEquals(date.with(TemporalAdjusters.firstDayOfNextMonth()), HijrahDate.of(1554, 8, 1)); - assertEquals(date.with(TemporalAdjusters.firstDayOfNextYear()), HijrahDate.of(1555, 1, 1)); - assertEquals(date.with(TemporalAdjusters.firstDayOfYear()), HijrahDate.of(1554, 1, 1)); - assertEquals(date.with(TemporalAdjusters.lastDayOfYear()), HijrahDate.of(1554, 12, 30)); + assertEquals(HijrahDate.of(1554, 7, 1), date.with(TemporalAdjusters.firstDayOfMonth())); + assertEquals(HijrahDate.of(1554, 7, 29), date.with(TemporalAdjusters.lastDayOfMonth())); + assertEquals(HijrahDate.of(1554, 8, 1), date.with(TemporalAdjusters.firstDayOfNextMonth())); + assertEquals(HijrahDate.of(1555, 1, 1), date.with(TemporalAdjusters.firstDayOfNextYear())); + assertEquals(HijrahDate.of(1554, 1, 1), date.with(TemporalAdjusters.firstDayOfYear())); + assertEquals(HijrahDate.of(1554, 12, 30), date.with(TemporalAdjusters.lastDayOfYear())); } // Data provider for string representation of the date instances - @DataProvider(name="toString") Object[][] data_toString() { return new Object[][] { {HijrahChronology.INSTANCE.date(1320, 1, 1), "Hijrah-umalqura AH 1320-01-01"}, @@ -378,13 +388,13 @@ public class TestUmmAlQuraChronology { } // Test to verify the returned string value of a given date instance - @Test(dataProvider="toString") + @ParameterizedTest + @MethodSource("data_toString") public void test_toString(ChronoLocalDate hijrahDate, String expected) { - assertEquals(hijrahDate.toString(), expected); + assertEquals(expected, hijrahDate.toString()); } // Data provider for maximum number of days - @DataProvider(name="monthDays") Object[][] data_monthDays() { return new Object[][] { {1432, 1, 29}, @@ -397,27 +407,28 @@ public class TestUmmAlQuraChronology { } // Test to verify the maximum number of days by adding one month to a given date - @Test (dataProvider="monthDays") + @ParameterizedTest + @MethodSource("data_monthDays") public void test_valueRange_monthDays(int year, int month, int maxlength) { ChronoLocalDate date = HijrahChronology.INSTANCE.date(year, month, 1); ValueRange range = null; for (int i=1; i<=12; i++) { range = date.range(ChronoField.DAY_OF_MONTH); date = date.plus(1, ChronoUnit.MONTHS); - assertEquals(range.getMaximum(), month, maxlength); + assertEquals(month, range.getMaximum(), maxlength); } } // Test to get the last day of the month by adjusting the date with lastDayOfMonth() method - @Test(dataProvider="monthDays") + @ParameterizedTest + @MethodSource("data_monthDays") public void test_lastDayOfMonth(int year, int month, int numDays) { HijrahDate hDate = HijrahChronology.INSTANCE.date(year, month, 1); hDate = hDate.with(TemporalAdjusters.lastDayOfMonth()); - assertEquals(hDate.get(ChronoField.DAY_OF_MONTH), numDays); + assertEquals(numDays, hDate.get(ChronoField.DAY_OF_MONTH)); } // Data provider for the 12 islamic month names in a formatted date - @DataProvider(name="patternMonthNames") Object[][] data_patternMonthNames() { return new Object[][] { {1434, 1, 1, "01 AH Thu Muharram 1434"}, @@ -436,15 +447,15 @@ public class TestUmmAlQuraChronology { } // Test to verify the formatted dates - @Test(dataProvider="patternMonthNames") + @ParameterizedTest + @MethodSource("data_patternMonthNames") public void test_ofPattern(int year, int month, int day, String expected) { DateTimeFormatter test = DateTimeFormatter.ofPattern("dd G E MMMM yyyy", Locale.US); - assertEquals(test.format(HijrahDate.of(year, month, day)), expected); + assertEquals(expected, test.format(HijrahDate.of(year, month, day))); } // Data provider for localized dates - @DataProvider(name="chronoDateTimes") - Object[][] data_chronodatetimes() { + Object[][] data_chronodatetimes() { return new Object[][] { {1432, 12, 29, "Safar 1, 1434 AH"}, {1433, 1, 30, "Safar 30, 1434 AH"}, @@ -453,7 +464,8 @@ public class TestUmmAlQuraChronology { } // Test to verify the localized dates using ofLocalizedDate() method - @Test(dataProvider="chronoDateTimes") + @ParameterizedTest + @MethodSource("data_chronodatetimes") public void test_formatterOfLocalizedDate(int year, int month, int day, String expected) { HijrahDate hd = HijrahChronology.INSTANCE.date(year, month, day); ChronoLocalDateTime hdt = hd.atTime(LocalTime.NOON); @@ -464,12 +476,11 @@ public class TestUmmAlQuraChronology { hdt = hdt.plus(1, ChronoUnit.MINUTES); hdt = hdt.plus(1, ChronoUnit.SECONDS); DateTimeFormatter df = DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG).withChronology(Chronology.of("Hijrah-umalqura")).withLocale(Locale.US); - assertEquals(df.format(hdt), expected); + assertEquals(expected, df.format(hdt)); } // Data provider to get the day of the week in a given date // The day of the week varies if the week starts with a saturday or sunday - @DataProvider(name="dayOfWeek") Object[][] data_dayOfweek() { return new Object[][] { {HijrahDate.of(1434, 6, 24), 1, 7}, @@ -481,14 +492,14 @@ public class TestUmmAlQuraChronology { } // Test to get the day of the week based on a Saturday/Sunday as the first day of the week - @Test(dataProvider="dayOfWeek") + @ParameterizedTest + @MethodSource("data_dayOfweek") public void test_dayOfWeek(HijrahDate date, int satStart, int sunStart) { - assertEquals(date.get(WeekFields.of(DayOfWeek.SATURDAY, 7).dayOfWeek()), satStart); - assertEquals(date.get(WeekFields.of(DayOfWeek.SUNDAY, 7).dayOfWeek()), sunStart); + assertEquals(satStart, date.get(WeekFields.of(DayOfWeek.SATURDAY, 7).dayOfWeek())); + assertEquals(sunStart, date.get(WeekFields.of(DayOfWeek.SUNDAY, 7).dayOfWeek())); } // Data sample to get the epoch days of a date instance - @DataProvider(name="epochDays") Object[][] data_epochdays() { return new Object[][] { {1332, -20486}, @@ -502,14 +513,14 @@ public class TestUmmAlQuraChronology { } // Test to verify the number of epoch days of a date instance - @Test(dataProvider="epochDays") + @ParameterizedTest + @MethodSource("data_epochdays") public void test_epochDays(int y, long epoch) { HijrahDate date = HijrahDate.of(y, 1, 1); - assertEquals(date.toEpochDay(), epoch); + assertEquals(epoch, date.toEpochDay()); } // Data provider to verify whether a given hijrah year is a leap year or not - @DataProvider(name="leapYears") Object[][] data_leapyears() { return new Object[][] { {1302, true}, @@ -524,15 +535,15 @@ public class TestUmmAlQuraChronology { } // Test to verify whether a given hijrah year is a leap year or not - @Test(dataProvider="leapYears") + @ParameterizedTest + @MethodSource("data_leapyears") public void test_leapYears(int y, boolean leapyear) { HijrahDate date = HijrahDate.of(y, 1, 1); - assertEquals(date.isLeapYear(), leapyear); + assertEquals(leapyear, date.isLeapYear()); } // Data provider to verify that a given hijrah year is outside the range of supported years // The values are dependent on the currently configured UmmAlQura calendar data - @DataProvider(name="OutOfRangeLeapYears") Object[][] data_invalid_leapyears() { return new Object[][] { {1299}, @@ -542,14 +553,14 @@ public class TestUmmAlQuraChronology { }; } - @Test(dataProvider="OutOfRangeLeapYears") + @ParameterizedTest + @MethodSource("data_invalid_leapyears") public void test_notLeapYears(int y) { assertFalse(HijrahChronology.INSTANCE.isLeapYear(y), "Out of range leap year"); } // Date samples to convert HijrahDate to LocalDate and vice versa - @DataProvider(name="samples") Object[][] data_samples() { return new Object[][] { {HijrahChronology.INSTANCE.date(1319, 12, 30), LocalDate.of(1902, 4, 9)}, @@ -562,45 +573,50 @@ public class TestUmmAlQuraChronology { } // Test to get LocalDate instance from a given HijrahDate - @Test(dataProvider="samples") + @ParameterizedTest + @MethodSource("data_samples") public void test_toLocalDate(ChronoLocalDate hijrahDate, LocalDate iso) { - assertEquals(LocalDate.from(hijrahDate), iso); + assertEquals(iso, LocalDate.from(hijrahDate)); } // Test to adjust HijrahDate with a given LocalDate - @Test(dataProvider="samples") + @ParameterizedTest + @MethodSource("data_samples") public void test_adjust_toLocalDate(ChronoLocalDate hijrahDate, LocalDate iso) { - assertEquals(hijrahDate.with(iso), hijrahDate); + assertEquals(hijrahDate, hijrahDate.with(iso)); } // Test to get a HijrahDate from a calendrical - @Test(dataProvider="samples") + @ParameterizedTest + @MethodSource("data_samples") public void test_fromCalendrical(ChronoLocalDate hijrahDate, LocalDate iso) { - assertEquals(HijrahChronology.INSTANCE.date(iso), hijrahDate); + assertEquals(hijrahDate, HijrahChronology.INSTANCE.date(iso)); } // Test to verify the day of week of a given HijrahDate and LocalDate - @Test(dataProvider="samples") + @ParameterizedTest + @MethodSource("data_samples") public void test_dayOfWeekEqualIsoDayOfWeek(ChronoLocalDate hijrahDate, LocalDate iso) { - assertEquals(hijrahDate.get(ChronoField.DAY_OF_WEEK), iso.get(ChronoField.DAY_OF_WEEK), "Hijrah day of week should be same as ISO day of week"); + assertEquals(iso.get(ChronoField.DAY_OF_WEEK), hijrahDate.get(ChronoField.DAY_OF_WEEK), "Hijrah day of week should be same as ISO day of week"); } // Test to get the local date by applying the MIN adjustment with hijrah date - @Test(dataProvider="samples") + @ParameterizedTest + @MethodSource("data_samples") public void test_LocalDate_adjustToHijrahDate(ChronoLocalDate hijrahDate, LocalDate localDate) { LocalDate test = LocalDate.MIN.with(hijrahDate); - assertEquals(test, localDate); + assertEquals(localDate, test); } // Test to get the local date time by applying the MIN adjustment with hijrah date - @Test(dataProvider="samples") + @ParameterizedTest + @MethodSource("data_samples") public void test_LocalDateTime_adjustToHijrahDate(ChronoLocalDate hijrahDate, LocalDate localDate) { LocalDateTime test = LocalDateTime.MIN.with(hijrahDate); - assertEquals(test, LocalDateTime.of(localDate, LocalTime.MIDNIGHT)); + assertEquals(LocalDateTime.of(localDate, LocalTime.MIDNIGHT), test); } // Sample dates for comparison - @DataProvider(name="datesForComparison") Object[][] data_datesForComparison() { return new Object[][] { {HijrahChronology.INSTANCE.date(1434, 6, 26), LocalDate.of(2013, 5, 5), -1, 1}, @@ -612,42 +628,42 @@ public class TestUmmAlQuraChronology { } // Test to compare dates in both forward and reverse order - @Test(dataProvider="datesForComparison") + @ParameterizedTest + @MethodSource("data_datesForComparison") public void test_compareDates(HijrahDate hdate, LocalDate ldate, int result1, int result2) { - assertEquals(ldate.compareTo(hdate), result1); - assertEquals(hdate.compareTo(ldate), result2); + assertEquals(result1, ldate.compareTo(hdate)); + assertEquals(result2, hdate.compareTo(ldate)); } // Test to verify the values of various chrono fields for a given hijrah date instance @Test public void test_chronoFields() { ChronoLocalDate hdate = HijrahChronology.INSTANCE.date(1434, 6, 28); - assertEquals(hdate.get(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH), 7); - assertEquals(hdate.get(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR), 7); - assertEquals(hdate.get(ChronoField.ALIGNED_WEEK_OF_MONTH), 4); - assertEquals(hdate.get(ChronoField.ALIGNED_WEEK_OF_YEAR), 25); - assertEquals(hdate.get(ChronoField.ERA), 1); - assertEquals(hdate.get(ChronoField.YEAR_OF_ERA), 1434); - assertEquals(hdate.get(ChronoField.MONTH_OF_YEAR), 6); - assertEquals(hdate.get(ChronoField.DAY_OF_MONTH), 28); - assertEquals(hdate.get(ChronoField.DAY_OF_WEEK), 3); - assertEquals(hdate.get(ChronoField.DAY_OF_YEAR), 175); + assertEquals(7, hdate.get(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH)); + assertEquals(7, hdate.get(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR)); + assertEquals(4, hdate.get(ChronoField.ALIGNED_WEEK_OF_MONTH)); + assertEquals(25, hdate.get(ChronoField.ALIGNED_WEEK_OF_YEAR)); + assertEquals(1, hdate.get(ChronoField.ERA)); + assertEquals(1434, hdate.get(ChronoField.YEAR_OF_ERA)); + assertEquals(6, hdate.get(ChronoField.MONTH_OF_YEAR)); + assertEquals(28, hdate.get(ChronoField.DAY_OF_MONTH)); + assertEquals(3, hdate.get(ChronoField.DAY_OF_WEEK)); + assertEquals(175, hdate.get(ChronoField.DAY_OF_YEAR)); } // Test to verify the returned hijrah date after adjusting the day of week as Saturday @Test public void test_adjustInto() { - assertEquals(DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1434, 6, 28)), HijrahDate.of(1434, 7, 1)); - assertEquals(DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1432, 4, 13)), HijrahDate.of(1432, 4, 14)); - assertEquals(DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1433, 11, 29)), HijrahDate.of(1433, 12, 4)); - assertEquals(DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1434, 5, 10)), HijrahDate.of(1434, 5, 11)); - assertEquals(DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1434, 9, 11)), HijrahDate.of(1434, 9, 12)); + assertEquals(HijrahDate.of(1434, 7, 1), DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1434, 6, 28))); + assertEquals(HijrahDate.of(1432, 4, 14), DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1432, 4, 13))); + assertEquals(HijrahDate.of(1433, 12, 4), DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1433, 11, 29))); + assertEquals(HijrahDate.of(1434, 5, 11), DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1434, 5, 10))); + assertEquals(HijrahDate.of(1434, 9, 12), DayOfWeek.SATURDAY.adjustInto(HijrahDate.of(1434, 9, 11))); } //----------------------------------------------------------------------- // zonedDateTime(TemporalAccessor) //----------------------------------------------------------------------- - @DataProvider(name="zonedDateTime") Object[][] data_zonedDateTime() { return new Object[][] { {ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_RIYADH), HijrahChronology.INSTANCE.date(1433, 4, 7), LocalTime.of(2, 7, 1, 1), null}, @@ -661,13 +677,14 @@ public class TestUmmAlQuraChronology { } // Test to check the zoned date times - @Test(dataProvider="zonedDateTime") + @ParameterizedTest + @MethodSource("data_zonedDateTime") public void test_zonedDateTime(TemporalAccessor accessor, HijrahDate expectedDate, LocalTime expectedTime, Class expectedEx) { if (expectedEx == null) { ChronoZonedDateTime result = HijrahChronology.INSTANCE.zonedDateTime(accessor); - assertEquals(result.toLocalDate(), expectedDate); - assertEquals(HijrahDate.from(accessor), expectedDate); - assertEquals(result.toLocalTime(), expectedTime); + assertEquals(expectedDate, result.toLocalDate()); + assertEquals(expectedDate, HijrahDate.from(accessor)); + assertEquals(expectedTime, result.toLocalTime()); } else { try { @@ -688,18 +705,17 @@ public class TestUmmAlQuraChronology { ZonedDateTime zonedDateTime = ZonedDateTime.of(2012, 2, 29, 2, 7, 1, 1, ZONE_RIYADH); ChronoZonedDateTime result = HijrahChronology.INSTANCE.zonedDateTime(offsetDateTime.toInstant(), offsetDateTime.getOffset()); - assertEquals(result.toLocalDate(), HijrahChronology.INSTANCE.date(1433, 4, 7)); - assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1)); + assertEquals(HijrahChronology.INSTANCE.date(1433, 4, 7), result.toLocalDate()); + assertEquals(LocalTime.of(2, 7, 1, 1), result.toLocalTime()); result = HijrahChronology.INSTANCE.zonedDateTime(zonedDateTime.toInstant(), zonedDateTime.getOffset()); - assertEquals(result.toLocalDate(), HijrahChronology.INSTANCE.date(1433, 4, 7)); - assertEquals(result.toLocalTime(), LocalTime.of(2, 7, 1, 1)); + assertEquals(HijrahChronology.INSTANCE.date(1433, 4, 7), result.toLocalDate()); + assertEquals(LocalTime.of(2, 7, 1, 1), result.toLocalTime()); } //----------------------------------------------------------------------- // localDateTime() //----------------------------------------------------------------------- - @DataProvider(name="localDateTime") Object[][] data_localDateTime() { return new Object[][] { {LocalDateTime.of(2012, 2, 29, 2, 7), HijrahChronology.INSTANCE.date(1433, 4, 7), LocalTime.of(2, 7), null}, @@ -713,13 +729,14 @@ public class TestUmmAlQuraChronology { } // Test to verify local date time values from various date instances defined in the localDateTime data provider - @Test(dataProvider="localDateTime") + @ParameterizedTest + @MethodSource("data_localDateTime") public void test_localDateTime(TemporalAccessor accessor, HijrahDate expectedDate, LocalTime expectedTime, Class expectedEx) { if (expectedEx == null) { ChronoLocalDateTime result = HijrahChronology.INSTANCE.localDateTime(accessor); - assertEquals(result.toLocalDate(), expectedDate); - assertEquals(HijrahDate.from(accessor), expectedDate); - assertEquals(result.toLocalTime(), expectedTime); + assertEquals(expectedDate, result.toLocalDate()); + assertEquals(expectedDate, HijrahDate.from(accessor)); + assertEquals(expectedTime, result.toLocalTime()); } else { try { ChronoLocalDateTime result = HijrahChronology.INSTANCE.localDateTime(accessor); @@ -731,7 +748,6 @@ public class TestUmmAlQuraChronology { } // Sample Hijrah & Minguo Dates - @DataProvider(name="hijrahToMinguo") Object[][] data_hijrahToMinguo() { return new Object[][] { {HijrahDate.of(1350,5,15), MinguoDate.of(20,9,28)}, @@ -743,13 +759,13 @@ public class TestUmmAlQuraChronology { } // Test to verify the date conversion from Hijrah to Minguo chronology - @Test(dataProvider="hijrahToMinguo") + @ParameterizedTest + @MethodSource("data_hijrahToMinguo") public void test_hijrahToMinguo(HijrahDate hijrah, MinguoDate minguo) { - assertEquals(MinguoChronology.INSTANCE.date(hijrah), minguo); + assertEquals(minguo, MinguoChronology.INSTANCE.date(hijrah)); } // Sample Hijrah & Thai Dates - @DataProvider(name="hijrahToThai") Object[][] data_hijrahToThai() { return new Object[][] { {HijrahDate.of(1350,5,15), ThaiBuddhistDate.of(2474,9,28)}, @@ -761,13 +777,13 @@ public class TestUmmAlQuraChronology { } // Test to verify the date conversion from Hijrah to Thai chronology - @Test(dataProvider="hijrahToThai") + @ParameterizedTest + @MethodSource("data_hijrahToThai") public void test_hijrahToThai(HijrahDate hijrah, ThaiBuddhistDate thai) { - assertEquals(ThaiBuddhistChronology.INSTANCE.date(hijrah), thai); + assertEquals(thai, ThaiBuddhistChronology.INSTANCE.date(hijrah)); } // Sample Hijrah & Japanese Dates - @DataProvider(name="hijrahToJapanese") Object[][] data_hijrahToJapanese() { return new Object[][] { {HijrahDate.of(1350,5,15), "Japanese Showa 6-09-28"}, @@ -781,12 +797,12 @@ public class TestUmmAlQuraChronology { } // Test to verify the date conversion from Hijrah to Japanese chronology - @Test(dataProvider="hijrahToJapanese") + @ParameterizedTest + @MethodSource("data_hijrahToJapanese") public void test_hijrahToJapanese(HijrahDate hijrah, String japanese) { - assertEquals(JapaneseChronology.INSTANCE.date(hijrah).toString(), japanese); + assertEquals(japanese, JapaneseChronology.INSTANCE.date(hijrah).toString()); } - @DataProvider(name="alignedDayOfWeekInMonthTestDates") Object[][] data_alignedDayOfWeekInMonth() { return new Object[][] { {1437, 9, 1, 1, 1}, @@ -799,18 +815,20 @@ public class TestUmmAlQuraChronology { //----------------------------------------------------------------------- // Test for aligned-week-of-month calculation based on the day-of-month //----------------------------------------------------------------------- - @Test(dataProvider="alignedDayOfWeekInMonthTestDates") + @ParameterizedTest + @MethodSource("data_alignedDayOfWeekInMonth") public void test_alignedWeekOfMonth(int year, int month, int dom, int wom, int dowm) { HijrahDate date = HijrahChronology.INSTANCE.date(year, month, dom); - assertEquals(date.getLong(ChronoField.ALIGNED_WEEK_OF_MONTH), wom); + assertEquals(wom, date.getLong(ChronoField.ALIGNED_WEEK_OF_MONTH)); } //----------------------------------------------------------------------- // Test for aligned-day-of-week calculation based on the day-of-month //----------------------------------------------------------------------- - @Test(dataProvider="alignedDayOfWeekInMonthTestDates") + @ParameterizedTest + @MethodSource("data_alignedDayOfWeekInMonth") public void test_alignedDayOfWeekInMonth(int year, int month, int dom, int wom, int dowm) { HijrahDate date = HijrahChronology.INSTANCE.date(year, month, dom); - assertEquals(date.getLong(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH), dowm); + assertEquals(dowm, date.getLong(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH)); } } diff --git a/test/jdk/java/time/test/java/time/format/AbstractTestPrinterParser.java b/test/jdk/java/time/test/java/time/format/AbstractTestPrinterParser.java index 023f5c190ad..b4e9590c23d 100644 --- a/test/jdk/java/time/test/java/time/format/AbstractTestPrinterParser.java +++ b/test/jdk/java/time/test/java/time/format/AbstractTestPrinterParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -72,13 +72,11 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; import java.util.Locale; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; +import org.junit.jupiter.api.BeforeEach; /** * Abstract PrinterParser test. */ -@Test public class AbstractTestPrinterParser { protected StringBuilder buf; @@ -88,7 +86,7 @@ public class AbstractTestPrinterParser { protected DecimalStyle decimalStyle; - @BeforeMethod + @BeforeEach public void setUp() { buf = new StringBuilder(); builder = new DateTimeFormatterBuilder(); diff --git a/test/jdk/java/time/test/java/time/format/TestCharLiteralParser.java b/test/jdk/java/time/test/java/time/format/TestCharLiteralParser.java index 696aab0f539..d1896c865e1 100644 --- a/test/jdk/java/time/test/java/time/format/TestCharLiteralParser.java +++ b/test/jdk/java/time/test/java/time/format/TestCharLiteralParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -60,24 +60,25 @@ package test.java.time.format; import static java.time.temporal.ChronoField.YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.text.ParsePosition; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test CharLiteralPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestCharLiteralParser extends AbstractTestPrinterParser { - @DataProvider(name="success") Object[][] data_success() { return new Object[][] { // match @@ -100,24 +101,24 @@ public class TestCharLiteralParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="success") + @ParameterizedTest + @MethodSource("data_success") public void test_parse_success(char c, boolean caseSensitive, String text, int pos, int expectedPos) { setCaseSensitive(caseSensitive); ParsePosition ppos = new ParsePosition(pos); TemporalAccessor parsed = getFormatter(c).parseUnresolved(text, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getIndex(), expectedPos); + assertEquals(expectedPos, ppos.getIndex()); } else { - assertEquals(ppos.getIndex(), expectedPos); - assertEquals(parsed.isSupported(YEAR), false); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(expectedPos, ppos.getIndex()); + assertEquals(false, parsed.isSupported(YEAR)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } //----------------------------------------------------------------------- - @DataProvider(name="error") Object[][] data_error() { return new Object[][] { {'a', "a", -1, IndexOutOfBoundsException.class}, @@ -125,7 +126,8 @@ public class TestCharLiteralParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="error") + @ParameterizedTest + @MethodSource("data_error") public void test_parse_error(char c, String text, int pos, Class expected) { try { ParsePosition ppos = new ParsePosition(pos); diff --git a/test/jdk/java/time/test/java/time/format/TestCharLiteralPrinter.java b/test/jdk/java/time/test/java/time/format/TestCharLiteralPrinter.java index 6aaf6a5b97d..71b7c7bed53 100644 --- a/test/jdk/java/time/test/java/time/format/TestCharLiteralPrinter.java +++ b/test/jdk/java/time/test/java/time/format/TestCharLiteralPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,42 +59,45 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; - -import org.testng.annotations.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; /** * Test CharLiteralPrinterParser. */ -@Test public class TestCharLiteralPrinter extends AbstractTestPrinterParser { //----------------------------------------------------------------------- + @Test public void test_print_emptyCalendrical() throws Exception { buf.append("EXISTING"); getFormatter('a').formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "EXISTINGa"); + assertEquals("EXISTINGa", buf.toString()); } + @Test public void test_print_dateTime() throws Exception { buf.append("EXISTING"); getFormatter('a').formatTo(dta, buf); - assertEquals(buf.toString(), "EXISTINGa"); + assertEquals("EXISTINGa", buf.toString()); } + @Test public void test_print_emptyAppendable() throws Exception { getFormatter('a').formatTo(dta, buf); - assertEquals(buf.toString(), "a"); + assertEquals("a", buf.toString()); } //----------------------------------------------------------------------- + @Test public void test_toString() throws Exception { - assertEquals(getFormatter('a').toString(), "'a'"); + assertEquals("'a'", getFormatter('a').toString()); } //----------------------------------------------------------------------- + @Test public void test_toString_apos() throws Exception { - assertEquals(getFormatter('\'').toString(), "''"); + assertEquals("''", getFormatter('\'').toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestDateTimeFormatter.java b/test/jdk/java/time/test/java/time/format/TestDateTimeFormatter.java index f6c1b253573..2ccc0da8f58 100644 --- a/test/jdk/java/time/test/java/time/format/TestDateTimeFormatter.java +++ b/test/jdk/java/time/test/java/time/format/TestDateTimeFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -60,11 +60,12 @@ package test.java.time.format; import static java.time.temporal.ChronoField.DAY_OF_MONTH; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertThrows; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.time.DateTimeException; import java.time.DayOfWeek; @@ -93,14 +94,16 @@ import java.time.temporal.TemporalAccessor; import java.util.Locale; import java.util.function.Function; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test DateTimeFormatter. * @bug 8085887 8293146 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeFormatter { @Test @@ -203,7 +206,6 @@ public class TestDateTimeFormatter { assertTrue(msg.contains("11:30:56"), msg); } - @DataProvider(name="nozone_exception_cases") Object[][] exceptionCases() { return new Object[][] { {LocalDateTime.of(2000, 1, 1, 1, 1), "z", "ZoneId"}, @@ -213,7 +215,8 @@ public class TestDateTimeFormatter { // Test cases that should throw an exception with a cogent message // containing the Type being queried and the Temporal being queried. - @Test(dataProvider="nozone_exception_cases") + @ParameterizedTest + @MethodSource("exceptionCases") public void test_throws_message(Temporal temporal, String pattern, String queryName) { DateTimeFormatter fmt = DateTimeFormatter.ofPattern(pattern); try { @@ -277,7 +280,6 @@ public class TestDateTimeFormatter { private static final DateTimeFormatter STRICT_WEEK = DateTimeFormatter.ofPattern("YYYY-'W'ww-e") .withResolverStyle(ResolverStyle.STRICT); private static final Locale EGYPT = Locale.forLanguageTag("en-EG"); - @DataProvider(name = "week53Dates") Object[][] data_week53Dates() { return new Object[][] { // WeekFields[SUNDAY,1] @@ -321,15 +323,14 @@ public class TestDateTimeFormatter { }; } - @Test (dataProvider = "week53Dates") + @ParameterizedTest + @MethodSource("data_week53Dates") public void test_week_53(String weekDate, Locale locale, LocalDate expected) { var f = STRICT_WEEK.withLocale(locale); if (expected != null) { - assertEquals(LocalDate.parse(weekDate, f), expected); + assertEquals(expected, LocalDate.parse(weekDate, f)); } else { - assertThrows(DateTimeException.class, () -> { - LocalDate.parse(weekDate, f); - }); + assertThrows(DateTimeException.class, () -> LocalDate.parse(weekDate, f)); } } } diff --git a/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java b/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java index 6d62dfe1265..294d204a216 100644 --- a/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java +++ b/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java @@ -66,9 +66,10 @@ import static java.time.temporal.ChronoField.HOUR_OF_DAY; import static java.time.temporal.ChronoField.MINUTE_OF_HOUR; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.ChronoField.YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; import java.text.ParsePosition; import java.time.LocalDate; @@ -95,19 +96,22 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test DateTimeFormatterBuilder. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeFormatterBuilder { private DateTimeFormatterBuilder builder; - @BeforeMethod + @BeforeEach public void setUp() { builder = new DateTimeFormatterBuilder(); } @@ -116,7 +120,7 @@ public class TestDateTimeFormatterBuilder { @Test public void test_toFormatter_empty() throws Exception { DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), ""); + assertEquals("", f.toString()); } //----------------------------------------------------------------------- @@ -124,14 +128,14 @@ public class TestDateTimeFormatterBuilder { public void test_parseCaseSensitive() throws Exception { builder.parseCaseSensitive(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "ParseCaseSensitive(true)"); + assertEquals("ParseCaseSensitive(true)", f.toString()); } @Test public void test_parseCaseInsensitive() throws Exception { builder.parseCaseInsensitive(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "ParseCaseSensitive(false)"); + assertEquals("ParseCaseSensitive(false)", f.toString()); } //----------------------------------------------------------------------- @@ -139,14 +143,14 @@ public class TestDateTimeFormatterBuilder { public void test_parseStrict() throws Exception { builder.parseStrict(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "ParseStrict(true)"); + assertEquals("ParseStrict(true)", f.toString()); } @Test public void test_parseLenient() throws Exception { builder.parseLenient(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "ParseStrict(false)"); + assertEquals("ParseStrict(false)", f.toString()); } //----------------------------------------------------------------------- @@ -154,12 +158,12 @@ public class TestDateTimeFormatterBuilder { public void test_appendValue_1arg() throws Exception { builder.appendValue(DAY_OF_MONTH); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(DayOfMonth)"); + assertEquals("Value(DayOfMonth)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendValue_1arg_null() throws Exception { - builder.appendValue(null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendValue(null)); } //----------------------------------------------------------------------- @@ -167,22 +171,22 @@ public class TestDateTimeFormatterBuilder { public void test_appendValue_2arg() throws Exception { builder.appendValue(DAY_OF_MONTH, 3); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(DayOfMonth,3)"); + assertEquals("Value(DayOfMonth,3)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendValue_2arg_null() throws Exception { - builder.appendValue(null, 3); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendValue(null, 3)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendValue_2arg_widthTooSmall() throws Exception { - builder.appendValue(DAY_OF_MONTH, 0); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendValue(DAY_OF_MONTH, 0)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendValue_2arg_widthTooBig() throws Exception { - builder.appendValue(DAY_OF_MONTH, 20); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendValue(DAY_OF_MONTH, 20)); } //----------------------------------------------------------------------- @@ -190,42 +194,42 @@ public class TestDateTimeFormatterBuilder { public void test_appendValue_3arg() throws Exception { builder.appendValue(DAY_OF_MONTH, 2, 3, SignStyle.NORMAL); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(DayOfMonth,2,3,NORMAL)"); + assertEquals("Value(DayOfMonth,2,3,NORMAL)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendValue_3arg_nullField() throws Exception { - builder.appendValue(null, 2, 3, SignStyle.NORMAL); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendValue(null, 2, 3, SignStyle.NORMAL)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendValue_3arg_minWidthTooSmall() throws Exception { - builder.appendValue(DAY_OF_MONTH, 0, 2, SignStyle.NORMAL); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendValue(DAY_OF_MONTH, 0, 2, SignStyle.NORMAL)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendValue_3arg_minWidthTooBig() throws Exception { - builder.appendValue(DAY_OF_MONTH, 20, 2, SignStyle.NORMAL); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendValue(DAY_OF_MONTH, 20, 2, SignStyle.NORMAL)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendValue_3arg_maxWidthTooSmall() throws Exception { - builder.appendValue(DAY_OF_MONTH, 2, 0, SignStyle.NORMAL); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendValue(DAY_OF_MONTH, 2, 0, SignStyle.NORMAL)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendValue_3arg_maxWidthTooBig() throws Exception { - builder.appendValue(DAY_OF_MONTH, 2, 20, SignStyle.NORMAL); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendValue(DAY_OF_MONTH, 2, 20, SignStyle.NORMAL)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendValue_3arg_maxWidthMinWidth() throws Exception { - builder.appendValue(DAY_OF_MONTH, 4, 2, SignStyle.NORMAL); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendValue(DAY_OF_MONTH, 4, 2, SignStyle.NORMAL)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendValue_3arg_nullSignStyle() throws Exception { - builder.appendValue(DAY_OF_MONTH, 2, 3, null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendValue(DAY_OF_MONTH, 2, 3, null)); } //----------------------------------------------------------------------- @@ -233,30 +237,30 @@ public class TestDateTimeFormatterBuilder { public void test_appendValue_subsequent2_parse3() throws Exception { builder.appendValue(MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL).appendValue(DAY_OF_MONTH, 2); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear,1,2,NORMAL)Value(DayOfMonth,2)"); + assertEquals("Value(MonthOfYear,1,2,NORMAL)Value(DayOfMonth,2)", f.toString()); TemporalAccessor parsed = f.parseUnresolved("123", new ParsePosition(0)); - assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); - assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); + assertEquals(1L, parsed.getLong(MONTH_OF_YEAR)); + assertEquals(23L, parsed.getLong(DAY_OF_MONTH)); } @Test public void test_appendValue_subsequent2_parse4() throws Exception { builder.appendValue(MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL).appendValue(DAY_OF_MONTH, 2); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear,1,2,NORMAL)Value(DayOfMonth,2)"); + assertEquals("Value(MonthOfYear,1,2,NORMAL)Value(DayOfMonth,2)", f.toString()); TemporalAccessor parsed = f.parseUnresolved("0123", new ParsePosition(0)); - assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); - assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); + assertEquals(1L, parsed.getLong(MONTH_OF_YEAR)); + assertEquals(23L, parsed.getLong(DAY_OF_MONTH)); } @Test public void test_appendValue_subsequent2_parse5() throws Exception { builder.appendValue(MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL).appendValue(DAY_OF_MONTH, 2).appendLiteral('4'); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear,1,2,NORMAL)Value(DayOfMonth,2)'4'"); + assertEquals("Value(MonthOfYear,1,2,NORMAL)Value(DayOfMonth,2)'4'", f.toString()); TemporalAccessor parsed = f.parseUnresolved("01234", new ParsePosition(0)); - assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); - assertEquals(parsed.getLong(DAY_OF_MONTH), 23L); + assertEquals(1L, parsed.getLong(MONTH_OF_YEAR)); + assertEquals(23L, parsed.getLong(DAY_OF_MONTH)); } @Test @@ -266,38 +270,38 @@ public class TestDateTimeFormatterBuilder { .appendValue(MONTH_OF_YEAR, 2) .appendValue(DAY_OF_MONTH, 2); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(Year,4,10,EXCEEDS_PAD)Value(MonthOfYear,2)Value(DayOfMonth,2)"); + assertEquals("Value(Year,4,10,EXCEEDS_PAD)Value(MonthOfYear,2)Value(DayOfMonth,2)", f.toString()); TemporalAccessor parsed = f.parseUnresolved("20090630", new ParsePosition(0)); - assertEquals(parsed.getLong(YEAR), 2009L); - assertEquals(parsed.getLong(MONTH_OF_YEAR), 6L); - assertEquals(parsed.getLong(DAY_OF_MONTH), 30L); + assertEquals(2009L, parsed.getLong(YEAR)); + assertEquals(6L, parsed.getLong(MONTH_OF_YEAR)); + assertEquals(30L, parsed.getLong(DAY_OF_MONTH)); } //----------------------------------------------------------------------- - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendValueReduced_null() throws Exception { - builder.appendValueReduced(null, 2, 2, 2000); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendValueReduced(null, 2, 2, 2000)); } @Test public void test_appendValueReduced() throws Exception { builder.appendValueReduced(YEAR, 2, 2, 2000); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "ReducedValue(Year,2,2,2000)"); + assertEquals("ReducedValue(Year,2,2,2000)", f.toString()); TemporalAccessor parsed = f.parseUnresolved("12", new ParsePosition(0)); - assertEquals(parsed.getLong(YEAR), 2012L); + assertEquals(2012L, parsed.getLong(YEAR)); } @Test public void test_appendValueReduced_subsequent_parse() throws Exception { builder.appendValue(MONTH_OF_YEAR, 1, 2, SignStyle.NORMAL).appendValueReduced(YEAR, 2, 2, 2000); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear,1,2,NORMAL)ReducedValue(Year,2,2,2000)"); + assertEquals("Value(MonthOfYear,1,2,NORMAL)ReducedValue(Year,2,2,2000)", f.toString()); ParsePosition ppos = new ParsePosition(0); TemporalAccessor parsed = f.parseUnresolved("123", ppos); assertNotNull(parsed, "Parse failed: " + ppos.toString()); - assertEquals(parsed.getLong(MONTH_OF_YEAR), 1L); - assertEquals(parsed.getLong(YEAR), 2023L); + assertEquals(1L, parsed.getLong(MONTH_OF_YEAR)); + assertEquals(2023L, parsed.getLong(YEAR)); } //----------------------------------------------------------------------- @@ -307,42 +311,42 @@ public class TestDateTimeFormatterBuilder { public void test_appendFraction_4arg() throws Exception { builder.appendFraction(MINUTE_OF_HOUR, 1, 9, false); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Fraction(MinuteOfHour,1,9)"); + assertEquals("Fraction(MinuteOfHour,1,9)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendFraction_4arg_nullRule() throws Exception { - builder.appendFraction(null, 1, 9, false); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendFraction(null, 1, 9, false)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendFraction_4arg_invalidRuleNotFixedSet() throws Exception { - builder.appendFraction(DAY_OF_MONTH, 1, 9, false); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendFraction(DAY_OF_MONTH, 1, 9, false)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendFraction_4arg_minTooSmall() throws Exception { - builder.appendFraction(MINUTE_OF_HOUR, -1, 9, false); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendFraction(MINUTE_OF_HOUR, -1, 9, false)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendFraction_4arg_minTooBig() throws Exception { - builder.appendFraction(MINUTE_OF_HOUR, 10, 9, false); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendFraction(MINUTE_OF_HOUR, 10, 9, false)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendFraction_4arg_maxTooSmall() throws Exception { - builder.appendFraction(MINUTE_OF_HOUR, 0, -1, false); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendFraction(MINUTE_OF_HOUR, 0, -1, false)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendFraction_4arg_maxTooBig() throws Exception { - builder.appendFraction(MINUTE_OF_HOUR, 1, 10, false); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendFraction(MINUTE_OF_HOUR, 1, 10, false)); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_appendFraction_4arg_maxWidthMinWidth() throws Exception { - builder.appendFraction(MINUTE_OF_HOUR, 9, 3, false); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendFraction(MINUTE_OF_HOUR, 9, 3, false)); } //----------------------------------------------------------------------- @@ -352,12 +356,12 @@ public class TestDateTimeFormatterBuilder { public void test_appendText_1arg() throws Exception { builder.appendText(MONTH_OF_YEAR); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Text(MonthOfYear)"); + assertEquals("Text(MonthOfYear)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendText_1arg_null() throws Exception { - builder.appendText(null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendText(null)); } //----------------------------------------------------------------------- @@ -365,17 +369,17 @@ public class TestDateTimeFormatterBuilder { public void test_appendText_2arg() throws Exception { builder.appendText(MONTH_OF_YEAR, TextStyle.SHORT); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Text(MonthOfYear,SHORT)"); + assertEquals("Text(MonthOfYear,SHORT)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendText_2arg_nullRule() throws Exception { - builder.appendText(null, TextStyle.SHORT); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendText(null, TextStyle.SHORT)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendText_2arg_nullStyle() throws Exception { - builder.appendText(MONTH_OF_YEAR, (TextStyle) null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendText(MONTH_OF_YEAR, (TextStyle) null)); } //----------------------------------------------------------------------- @@ -396,17 +400,17 @@ public class TestDateTimeFormatterBuilder { map.put(12L, "DBR"); builder.appendText(MONTH_OF_YEAR, map); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Text(MonthOfYear)"); // TODO: toString should be different? + assertEquals("Text(MonthOfYear)", f.toString()); // TODO: toString should be different? } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendTextMap_nullRule() throws Exception { - builder.appendText(null, new HashMap()); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendText(null, new HashMap())); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendTextMap_nullStyle() throws Exception { - builder.appendText(MONTH_OF_YEAR, (Map) null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendText(MONTH_OF_YEAR, (Map) null)); } //----------------------------------------------------------------------- @@ -416,10 +420,9 @@ public class TestDateTimeFormatterBuilder { public void test_appendOffsetId() throws Exception { builder.appendOffsetId(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Offset(+HH:MM:ss,'Z')"); + assertEquals("Offset(+HH:MM:ss,'Z')", f.toString()); } - @DataProvider(name="offsetPatterns") Object[][] data_offsetPatterns() { return new Object[][] { {"+HH", 2, 0, 0, "+02"}, @@ -466,24 +469,25 @@ public class TestDateTimeFormatterBuilder { }; } - @Test(dataProvider="offsetPatterns") + @ParameterizedTest + @MethodSource("data_offsetPatterns") public void test_appendOffset_format(String pattern, int h, int m, int s, String expected) throws Exception { builder.appendOffset(pattern, "Z"); DateTimeFormatter f = builder.toFormatter(); ZoneOffset offset = ZoneOffset.ofHoursMinutesSeconds(h, m, s); - assertEquals(f.format(offset), expected); + assertEquals(expected, f.format(offset)); } - @Test(dataProvider="offsetPatterns") + @ParameterizedTest + @MethodSource("data_offsetPatterns") public void test_appendOffset_parse(String pattern, int h, int m, int s, String expected) throws Exception { builder.appendOffset(pattern, "Z"); DateTimeFormatter f = builder.toFormatter(); ZoneOffset offset = ZoneOffset.ofHoursMinutesSeconds(h, m, s); ZoneOffset parsed = f.parse(expected, ZoneOffset::from); - assertEquals(f.format(parsed), expected); + assertEquals(expected, f.format(parsed)); } - @DataProvider(name="badOffsetPatterns") Object[][] data_badOffsetPatterns() { return new Object[][] { {"HH"}, @@ -498,19 +502,20 @@ public class TestDateTimeFormatterBuilder { }; } - @Test(dataProvider="badOffsetPatterns", expectedExceptions=IllegalArgumentException.class) + @ParameterizedTest + @MethodSource("data_badOffsetPatterns") public void test_appendOffset_badPattern(String pattern) throws Exception { - builder.appendOffset(pattern, "Z"); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.appendOffset(pattern, "Z")); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendOffset_3arg_nullText() throws Exception { - builder.appendOffset("+HH:MM", null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendOffset("+HH:MM", null)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendOffset_3arg_nullPattern() throws Exception { - builder.appendOffset(null, "Z"); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendOffset(null, "Z")); } //----------------------------------------------------------------------- @@ -520,19 +525,19 @@ public class TestDateTimeFormatterBuilder { public void test_appendZoneId() throws Exception { builder.appendZoneId(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "ZoneId()"); + assertEquals("ZoneId()", f.toString()); } @Test public void test_appendZoneText_1arg() throws Exception { builder.appendZoneText(TextStyle.FULL); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "ZoneText(FULL)"); + assertEquals("ZoneText(FULL)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendZoneText_1arg_nullText() throws Exception { - builder.appendZoneText(null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendZoneText(null)); } //----------------------------------------------------------------------- @@ -542,15 +547,14 @@ public class TestDateTimeFormatterBuilder { public void test_appendDayPeriodText_1arg() throws Exception { builder.appendDayPeriodText(TextStyle.FULL); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "DayPeriod(FULL)"); + assertEquals("DayPeriod(FULL)", f.toString()); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_appendDayPeriodText_1arg_nullText() throws Exception { - builder.appendDayPeriodText(null); + Assertions.assertThrows(NullPointerException.class, () -> builder.appendDayPeriodText(null)); } - @DataProvider(name="dayPeriodFormat") Object[][] data_dayPeriodFormat() { return new Object[][] { {0, 0, TextStyle.FULL, Locale.US, "midnight"}, @@ -588,15 +592,15 @@ public class TestDateTimeFormatterBuilder { {23, 0, TextStyle.NARROW, Locale.JAPAN, "\u591c\u4e2d"}, }; } - @Test (dataProvider="dayPeriodFormat") + @ParameterizedTest + @MethodSource("data_dayPeriodFormat") public void test_dayPeriodFormat(int hod, int moh, TextStyle ts, Locale l, String expected) throws Exception { builder.appendDayPeriodText(ts); LocalTime t = LocalTime.of(hod, moh); DateTimeFormatter f = builder.toFormatter().withLocale(l); - assertEquals(f.format(t), expected); + assertEquals(expected, f.format(t)); } - @DataProvider(name="dayPeriodParse") Object[][] data_dayPeriodParse() { return new Object[][] { {TextStyle.FULL, Locale.US, 0, 0, "midnight"}, @@ -638,16 +642,16 @@ public class TestDateTimeFormatterBuilder { {TextStyle.NARROW, Locale.JAPAN, 21, 0, "\u591c"}, }; } - @Test (dataProvider="dayPeriodParse") + @ParameterizedTest + @MethodSource("data_dayPeriodParse") public void test_dayPeriodParse(TextStyle ts, Locale l, long hod, long moh, String dayPeriod) throws Exception { builder.appendDayPeriodText(ts); DateTimeFormatter f = builder.toFormatter().withLocale(l); var p = f.parse(dayPeriod); - assertEquals(p.getLong(HOUR_OF_DAY), hod); - assertEquals(p.getLong(MINUTE_OF_HOUR), moh); + assertEquals(hod, p.getLong(HOUR_OF_DAY)); + assertEquals(moh, p.getLong(MINUTE_OF_HOUR)); } - @DataProvider(name="dayPeriodParsePattern") Object[][] data_dayPeriodParsePattern() { return new Object[][] { {"H B", "23 at night", 23}, @@ -663,15 +667,15 @@ public class TestDateTimeFormatterBuilder { }; } - @Test (dataProvider="dayPeriodParsePattern") + @ParameterizedTest + @MethodSource("data_dayPeriodParsePattern") public void test_dayPeriodParsePattern(String pattern, String hourDayPeriod, long expected) throws Exception { builder.appendPattern(pattern); DateTimeFormatter f = builder.toFormatter().withLocale(Locale.US); var p = f.parse(hourDayPeriod); - assertEquals(p.getLong(HOUR_OF_DAY), expected); + assertEquals(expected, p.getLong(HOUR_OF_DAY)); } - @DataProvider(name="dayPeriodParseMidnight") Object[][] data_dayPeriodParseMidnight() { return new Object[][] { {"u-M-d H:m B", "2020-11-07 00:00 midnight", 7, 0}, @@ -679,16 +683,16 @@ public class TestDateTimeFormatterBuilder { }; } - @Test (dataProvider="dayPeriodParseMidnight") + @ParameterizedTest + @MethodSource("data_dayPeriodParseMidnight") public void test_dayPeriodParseMidnight(String pattern, String dateTime, long expectedDOM, long expectedHOD) throws Exception { builder.appendPattern(pattern); DateTimeFormatter f = builder.toFormatter().withLocale(Locale.US); var p = f.parse(dateTime); - assertEquals(p.getLong(DAY_OF_MONTH), expectedDOM); - assertEquals(p.getLong(HOUR_OF_DAY), expectedHOD); + assertEquals(expectedDOM, p.getLong(DAY_OF_MONTH)); + assertEquals(expectedHOD, p.getLong(HOUR_OF_DAY)); } - @DataProvider(name="dayPeriodParseInvalid") Object[][] data_dayPeriodParseInvalid() { return new Object[][] { {TextStyle.FULL, ResolverStyle.SMART, Locale.US, "00:01 midnight", "00:00"}, @@ -748,7 +752,8 @@ public class TestDateTimeFormatterBuilder { {TextStyle.NARROW, ResolverStyle.LENIENT, Locale.JAPAN, "23:00 \u591c", "19:00-23:00"}, }; } - @Test (dataProvider="dayPeriodParseInvalid") + @ParameterizedTest + @MethodSource("data_dayPeriodParseInvalid") public void test_dayPeriodParseInvalid(TextStyle ts, ResolverStyle rs, Locale l, String dayPeriod, String periodRange) throws Exception { try { builder.append(ISO_LOCAL_TIME).appendLiteral(' ').appendDayPeriodText(ts) @@ -759,13 +764,11 @@ public class TestDateTimeFormatterBuilder { throw new RuntimeException("DateTimeParseException should be thrown"); } } catch (DateTimeParseException e) { - assertEquals(e.getCause().getMessage(), - "Conflict found: Resolved time " + dayPeriod.substring(0, 5) + " conflicts with " + - "DayPeriod(" + periodRange + ")"); + assertEquals("Conflict found: Resolved time " + dayPeriod.substring(0, 5) + " conflicts with " + + "DayPeriod(" + periodRange + ")", e.getCause().getMessage()); } } - @DataProvider(name="dayPeriodParsePatternInvalid") Object[][] data_dayPeriodParsePatternInvalid() { return new Object[][] { {"H B", ResolverStyle.SMART, "47 at night", 23, null}, @@ -794,7 +797,8 @@ public class TestDateTimeFormatterBuilder { }; } - @Test (dataProvider="dayPeriodParsePatternInvalid") + @ParameterizedTest + @MethodSource("data_dayPeriodParsePatternInvalid") public void test_dayPeriodParsePatternInvalid(String pattern, ResolverStyle rs, String hourDayPeriod, long expected, Period expectedExcessDays) throws Exception { try { builder.appendPattern(pattern); @@ -803,18 +807,20 @@ public class TestDateTimeFormatterBuilder { if (rs != ResolverStyle.LENIENT) { throw new RuntimeException("DateTimeParseException should be thrown"); } - assertEquals(p.getLong(HOUR_OF_DAY), expected); - assertEquals(p.query(DateTimeFormatter.parsedExcessDays()), expectedExcessDays); + assertEquals(expected, p.getLong(HOUR_OF_DAY)); + assertEquals(expectedExcessDays, p.query(DateTimeFormatter.parsedExcessDays())); } catch (DateTimeParseException e) { // exception successfully thrown } } - @Test (expectedExceptions = DateTimeParseException.class) + @Test public void test_dayPeriodParseStrictNoTime() { - builder.appendPattern("B"); - DateTimeFormatter f = builder.toFormatter().withLocale(Locale.US).withResolverStyle(ResolverStyle.STRICT); - LocalTime.parse("at night", f); + Assertions.assertThrows(DateTimeParseException.class, () -> { + builder.appendPattern("B"); + DateTimeFormatter f = builder.toFormatter().withLocale(Locale.US).withResolverStyle(ResolverStyle.STRICT); + LocalTime.parse("at night", f); + }); } @Test @@ -880,7 +886,7 @@ public class TestDateTimeFormatterBuilder { .appendPattern(" B") .toFormatter() .withLocale(Locale.US); - assertEquals((long)dtf.parse("0 in the morning").getLong(ChronoField.HOUR_OF_DAY), 6L); + assertEquals(6L, (long)dtf.parse("0 in the morning").getLong(ChronoField.HOUR_OF_DAY)); try { dtf.parse("0 at night"); fail("DateTimeParseException should be thrown"); @@ -895,24 +901,24 @@ public class TestDateTimeFormatterBuilder { @Test public void test_padNext_1arg() { builder.appendValue(MONTH_OF_YEAR).appendLiteral(':').padNext(2).appendValue(DAY_OF_MONTH); - assertEquals(builder.toFormatter().format(LocalDate.of(2013, 2, 1)), "2: 1"); + assertEquals("2: 1", builder.toFormatter().format(LocalDate.of(2013, 2, 1))); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_padNext_1arg_invalidWidth() throws Exception { - builder.padNext(0); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.padNext(0)); } //----------------------------------------------------------------------- @Test public void test_padNext_2arg_dash() throws Exception { builder.appendValue(MONTH_OF_YEAR).appendLiteral(':').padNext(2, '-').appendValue(DAY_OF_MONTH); - assertEquals(builder.toFormatter().format(LocalDate.of(2013, 2, 1)), "2:-1"); + assertEquals("2:-1", builder.toFormatter().format(LocalDate.of(2013, 2, 1))); } - @Test(expectedExceptions=IllegalArgumentException.class) + @Test public void test_padNext_2arg_invalidWidth() throws Exception { - builder.padNext(0, '-'); + Assertions.assertThrows(IllegalArgumentException.class, () -> builder.padNext(0, '-')); } //----------------------------------------------------------------------- @@ -921,8 +927,8 @@ public class TestDateTimeFormatterBuilder { builder.appendValue(MONTH_OF_YEAR).appendLiteral(':') .padNext(5).optionalStart().appendValue(DAY_OF_MONTH).optionalEnd() .appendLiteral(':').appendValue(YEAR); - assertEquals(builder.toFormatter().format(LocalDate.of(2013, 2, 1)), "2: 1:2013"); - assertEquals(builder.toFormatter().format(YearMonth.of(2013, 2)), "2: :2013"); + assertEquals("2: 1:2013", builder.toFormatter().format(LocalDate.of(2013, 2, 1))); + assertEquals("2: :2013", builder.toFormatter().format(YearMonth.of(2013, 2))); } //----------------------------------------------------------------------- @@ -932,21 +938,21 @@ public class TestDateTimeFormatterBuilder { public void test_optionalStart_noEnd() throws Exception { builder.appendValue(MONTH_OF_YEAR).optionalStart().appendValue(DAY_OF_MONTH).appendValue(DAY_OF_WEEK); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)[Value(DayOfMonth)Value(DayOfWeek)]"); + assertEquals("Value(MonthOfYear)[Value(DayOfMonth)Value(DayOfWeek)]", f.toString()); } @Test public void test_optionalStart2_noEnd() throws Exception { builder.appendValue(MONTH_OF_YEAR).optionalStart().appendValue(DAY_OF_MONTH).optionalStart().appendValue(DAY_OF_WEEK); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)[Value(DayOfMonth)[Value(DayOfWeek)]]"); + assertEquals("Value(MonthOfYear)[Value(DayOfMonth)[Value(DayOfWeek)]]", f.toString()); } @Test public void test_optionalStart_doubleStart() throws Exception { builder.appendValue(MONTH_OF_YEAR).optionalStart().optionalStart().appendValue(DAY_OF_MONTH); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)[[Value(DayOfMonth)]]"); + assertEquals("Value(MonthOfYear)[[Value(DayOfMonth)]]", f.toString()); } //----------------------------------------------------------------------- @@ -954,7 +960,7 @@ public class TestDateTimeFormatterBuilder { public void test_optionalEnd() throws Exception { builder.appendValue(MONTH_OF_YEAR).optionalStart().appendValue(DAY_OF_MONTH).optionalEnd().appendValue(DAY_OF_WEEK); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)[Value(DayOfMonth)]Value(DayOfWeek)"); + assertEquals("Value(MonthOfYear)[Value(DayOfMonth)]Value(DayOfWeek)", f.toString()); } @Test @@ -962,39 +968,38 @@ public class TestDateTimeFormatterBuilder { builder.appendValue(MONTH_OF_YEAR).optionalStart().appendValue(DAY_OF_MONTH) .optionalStart().appendValue(DAY_OF_WEEK).optionalEnd().appendValue(DAY_OF_MONTH).optionalEnd(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)[Value(DayOfMonth)[Value(DayOfWeek)]Value(DayOfMonth)]"); + assertEquals("Value(MonthOfYear)[Value(DayOfMonth)[Value(DayOfWeek)]Value(DayOfMonth)]", f.toString()); } @Test public void test_optionalEnd_doubleStartSingleEnd() throws Exception { builder.appendValue(MONTH_OF_YEAR).optionalStart().optionalStart().appendValue(DAY_OF_MONTH).optionalEnd(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)[[Value(DayOfMonth)]]"); + assertEquals("Value(MonthOfYear)[[Value(DayOfMonth)]]", f.toString()); } @Test public void test_optionalEnd_doubleStartDoubleEnd() throws Exception { builder.appendValue(MONTH_OF_YEAR).optionalStart().optionalStart().appendValue(DAY_OF_MONTH).optionalEnd().optionalEnd(); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)[[Value(DayOfMonth)]]"); + assertEquals("Value(MonthOfYear)[[Value(DayOfMonth)]]", f.toString()); } @Test public void test_optionalStartEnd_immediateStartEnd() throws Exception { builder.appendValue(MONTH_OF_YEAR).optionalStart().optionalEnd().appendValue(DAY_OF_MONTH); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), "Value(MonthOfYear)Value(DayOfMonth)"); + assertEquals("Value(MonthOfYear)Value(DayOfMonth)", f.toString()); } - @Test(expectedExceptions=IllegalStateException.class) + @Test public void test_optionalEnd_noStart() throws Exception { - builder.optionalEnd(); + Assertions.assertThrows(IllegalStateException.class, () -> builder.optionalEnd()); } //----------------------------------------------------------------------- //----------------------------------------------------------------------- //----------------------------------------------------------------------- - @DataProvider(name="validPatterns") Object[][] dataValid() { return new Object[][] { {"'a'", "'a'"}, @@ -1162,15 +1167,15 @@ public class TestDateTimeFormatterBuilder { }; } - @Test(dataProvider="validPatterns") + @ParameterizedTest + @MethodSource("dataValid") public void test_appendPattern_valid(String input, String expected) throws Exception { builder.appendPattern(input); DateTimeFormatter f = builder.toFormatter(); - assertEquals(f.toString(), expected); + assertEquals(expected, f.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="invalidPatterns") Object[][] dataInvalid() { return new Object[][] { {"'"}, @@ -1241,17 +1246,19 @@ public class TestDateTimeFormatterBuilder { }; } - @Test(dataProvider="invalidPatterns", expectedExceptions=IllegalArgumentException.class) + @ParameterizedTest + @MethodSource("dataInvalid") public void test_appendPattern_invalid(String input) throws Exception { - try { - builder.appendPattern(input); - } catch (IllegalArgumentException ex) { - throw ex; - } + Assertions.assertThrows(IllegalArgumentException.class, () -> { + try { + builder.appendPattern(input); + } catch (IllegalArgumentException ex) { + throw ex; + } + }); } //----------------------------------------------------------------------- - @DataProvider(name="localePatterns") Object[][] localizedDateTimePatterns() { return new Object[][] { {FormatStyle.FULL, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.US, "EEEE, MMMM d, y, h:mm:ss\u202fa zzzz"}, @@ -1269,26 +1276,27 @@ public class TestDateTimeFormatterBuilder { }; } - @Test(dataProvider="localePatterns") + @ParameterizedTest + @MethodSource("localizedDateTimePatterns") public void test_getLocalizedDateTimePattern(FormatStyle dateStyle, FormatStyle timeStyle, Chronology chrono, Locale locale, String expected) { String actual = DateTimeFormatterBuilder.getLocalizedDateTimePattern(dateStyle, timeStyle, chrono, locale); - assertEquals(actual, expected, "Pattern " + convertNonAscii(actual)); + assertEquals(expected, actual, "Pattern " + convertNonAscii(actual)); } - @Test(expectedExceptions=java.lang.IllegalArgumentException.class) + @Test public void test_getLocalizedDateTimePatternIAE() { - DateTimeFormatterBuilder.getLocalizedDateTimePattern(null, null, IsoChronology.INSTANCE, Locale.US); + Assertions.assertThrows(IllegalArgumentException.class, () -> DateTimeFormatterBuilder.getLocalizedDateTimePattern(null, null, IsoChronology.INSTANCE, Locale.US)); } - @Test(expectedExceptions=java.lang.NullPointerException.class) + @Test public void test_getLocalizedChronoNPE() { - DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.SHORT, FormatStyle.SHORT, null, Locale.US); + Assertions.assertThrows(NullPointerException.class, () -> DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.SHORT, FormatStyle.SHORT, null, Locale.US)); } - @Test(expectedExceptions=java.lang.NullPointerException.class) + @Test public void test_getLocalizedLocaleNPE() { - DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.SHORT, FormatStyle.SHORT, IsoChronology.INSTANCE, null); + Assertions.assertThrows(NullPointerException.class, () -> DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.SHORT, FormatStyle.SHORT, IsoChronology.INSTANCE, null)); } /** diff --git a/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilderWithLocale.java b/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilderWithLocale.java index a0981f0c4d8..ff44426dbe9 100644 --- a/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilderWithLocale.java +++ b/test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilderWithLocale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -84,27 +84,26 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; -import static org.testng.Assert.assertEquals; - -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test DateTimeFormatterBuilder. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeFormatterBuilderWithLocale { private DateTimeFormatterBuilder builder; - @BeforeMethod + @BeforeEach public void setUp() { builder = new DateTimeFormatterBuilder(); } //----------------------------------------------------------------------- - @DataProvider(name="patternPrint") Object[][] data_patternPrint() { return new Object[][] { {"Q", date(2012, 2, 10), "1"}, @@ -115,15 +114,15 @@ public class TestDateTimeFormatterBuilderWithLocale { }; } - @Test(dataProvider="patternPrint") + @ParameterizedTest + @MethodSource("data_patternPrint") public void test_appendPattern_patternPrint(String input, Temporal temporal, String expected) throws Exception { DateTimeFormatter f = builder.appendPattern(input).toFormatter(Locale.UK); String test = f.format(temporal); - assertEquals(test, expected); + assertEquals(expected, test); } //----------------------------------------------------------------------- - @DataProvider(name="mapTextLookup") Object[][] data_mapTextLookup() { return new Object[][] { {IsoChronology.INSTANCE.date(1, 1, 1), Locale.ENGLISH}, @@ -133,7 +132,8 @@ public class TestDateTimeFormatterBuilderWithLocale { }; } - @Test(dataProvider="mapTextLookup") + @ParameterizedTest + @MethodSource("data_mapTextLookup") public void test_appendText_mapTextLookup(ChronoLocalDate date, Locale locale) { final String firstYear = "firstYear"; final String firstMonth = "firstMonth"; @@ -146,16 +146,15 @@ public class TestDateTimeFormatterBuilderWithLocale { .toFormatter(locale) .withResolverStyle(ResolverStyle.STRICT); - assertEquals(date.format(formatter), firstYearMonth); + assertEquals(firstYearMonth, date.format(formatter)); TemporalAccessor ta = formatter.parse(firstYearMonth); - assertEquals(ta.getLong(ChronoField.YEAR_OF_ERA), first); - assertEquals(ta.getLong(ChronoField.MONTH_OF_YEAR), first); + assertEquals(first, ta.getLong(ChronoField.YEAR_OF_ERA)); + assertEquals(first, ta.getLong(ChronoField.MONTH_OF_YEAR)); } //----------------------------------------------------------------------- - @DataProvider(name="localePatterns") Object[][] localizedDateTimePatterns() { return new Object[][] { // French Locale and ISO Chronology @@ -202,11 +201,12 @@ public class TestDateTimeFormatterBuilderWithLocale { }; } - @Test(dataProvider="localePatterns") + @ParameterizedTest + @MethodSource("localizedDateTimePatterns") public void test_getLocalizedDateTimePattern(FormatStyle dateStyle, FormatStyle timeStyle, Chronology chrono, Locale locale, String expected) { String actual = DateTimeFormatterBuilder.getLocalizedDateTimePattern(dateStyle, timeStyle, chrono, locale); - assertEquals(actual, expected, "Pattern " + convertNonAscii(actual)); + assertEquals(expected, actual, "Pattern " + convertNonAscii(actual)); } /** diff --git a/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java b/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java index 67c91e6ad7e..f50a99f8a0e 100644 --- a/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java +++ b/test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -71,8 +71,9 @@ import static java.time.temporal.ChronoField.NANO_OF_SECOND; import static java.time.temporal.ChronoField.OFFSET_SECONDS; import static java.time.temporal.ChronoField.SECOND_OF_DAY; import static java.util.Locale.US; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import java.text.ParsePosition; import java.time.DateTimeException; @@ -88,14 +89,18 @@ import java.time.format.SignStyle; import java.time.temporal.TemporalAccessor; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * @test * @summary Test parsing of edge cases. * @bug 8223773 8272473 8319640 */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeParsing { private static final ZoneId PARIS = ZoneId.of("Europe/Paris"); @@ -132,7 +137,6 @@ public class TestDateTimeParsing { private static final String DTPE_MESSAGE = "Invalid value for HourOfAmPm (valid values 0 - 11): 12"; - @DataProvider(name = "instantZones") Object[][] data_instantZones() { return new Object[][] { {LOCALFIELDS_ZONEID, "2014-06-30 01:02:03 Europe/Paris", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, PARIS)}, @@ -154,37 +158,40 @@ public class TestDateTimeParsing { }; } - @Test(dataProvider = "instantZones") + @ParameterizedTest + @MethodSource("data_instantZones") public void test_parse_instantZones_ZDT(DateTimeFormatter formatter, String text, ZonedDateTime expected) { TemporalAccessor actual = formatter.parse(text); - assertEquals(ZonedDateTime.from(actual), expected); + assertEquals(expected, ZonedDateTime.from(actual)); } - @Test(dataProvider = "instantZones") + @ParameterizedTest + @MethodSource("data_instantZones") public void test_parse_instantZones_LDT(DateTimeFormatter formatter, String text, ZonedDateTime expected) { TemporalAccessor actual = formatter.parse(text); - assertEquals(LocalDateTime.from(actual), expected.toLocalDateTime()); + assertEquals(expected.toLocalDateTime(), LocalDateTime.from(actual)); } - @Test(dataProvider = "instantZones") + @ParameterizedTest + @MethodSource("data_instantZones") public void test_parse_instantZones_Instant(DateTimeFormatter formatter, String text, ZonedDateTime expected) { TemporalAccessor actual = formatter.parse(text); - assertEquals(Instant.from(actual), expected.toInstant()); + assertEquals(expected.toInstant(), Instant.from(actual)); } - @Test(dataProvider = "instantZones") + @ParameterizedTest + @MethodSource("data_instantZones") public void test_parse_instantZones_supported(DateTimeFormatter formatter, String text, ZonedDateTime expected) { TemporalAccessor actual = formatter.parse(text); - assertEquals(actual.isSupported(INSTANT_SECONDS), true); - assertEquals(actual.isSupported(EPOCH_DAY), true); - assertEquals(actual.isSupported(SECOND_OF_DAY), true); - assertEquals(actual.isSupported(NANO_OF_SECOND), true); - assertEquals(actual.isSupported(MICRO_OF_SECOND), true); - assertEquals(actual.isSupported(MILLI_OF_SECOND), true); + assertEquals(true, actual.isSupported(INSTANT_SECONDS)); + assertEquals(true, actual.isSupported(EPOCH_DAY)); + assertEquals(true, actual.isSupported(SECOND_OF_DAY)); + assertEquals(true, actual.isSupported(NANO_OF_SECOND)); + assertEquals(true, actual.isSupported(MICRO_OF_SECOND)); + assertEquals(true, actual.isSupported(MILLI_OF_SECOND)); } //----------------------------------------------------------------------- - @DataProvider(name = "instantNoZone") Object[][] data_instantNoZone() { return new Object[][] { {INSTANT, "2014-06-30T01:02:03Z", ZonedDateTime.of(2014, 6, 30, 1, 2, 3, 0, ZoneOffset.UTC).toInstant()}, @@ -193,55 +200,65 @@ public class TestDateTimeParsing { }; } - @Test(dataProvider = "instantNoZone", expectedExceptions = DateTimeException.class) + @ParameterizedTest + @MethodSource("data_instantNoZone") public void test_parse_instantNoZone_ZDT(DateTimeFormatter formatter, String text, Instant expected) { - TemporalAccessor actual = formatter.parse(text); - ZonedDateTime.from(actual); + Assertions.assertThrows(DateTimeException.class, () -> { + TemporalAccessor actual = formatter.parse(text); + ZonedDateTime.from(actual); + }); } - @Test(dataProvider = "instantNoZone", expectedExceptions = DateTimeException.class) + @ParameterizedTest + @MethodSource("data_instantNoZone") public void test_parse_instantNoZone_LDT(DateTimeFormatter formatter, String text, Instant expected) { - TemporalAccessor actual = formatter.parse(text); - LocalDateTime.from(actual); + Assertions.assertThrows(DateTimeException.class, () -> { + TemporalAccessor actual = formatter.parse(text); + LocalDateTime.from(actual); + }); } - @Test(dataProvider = "instantNoZone") + @ParameterizedTest + @MethodSource("data_instantNoZone") public void test_parse_instantNoZone_Instant(DateTimeFormatter formatter, String text, Instant expected) { TemporalAccessor actual = formatter.parse(text); - assertEquals(Instant.from(actual), expected); + assertEquals(expected, Instant.from(actual)); } - @Test(dataProvider = "instantNoZone") + @ParameterizedTest + @MethodSource("data_instantNoZone") public void test_parse_instantNoZone_supported(DateTimeFormatter formatter, String text, Instant expected) { TemporalAccessor actual = formatter.parse(text); - assertEquals(actual.isSupported(INSTANT_SECONDS), true); - assertEquals(actual.isSupported(EPOCH_DAY), false); - assertEquals(actual.isSupported(SECOND_OF_DAY), false); - assertEquals(actual.isSupported(NANO_OF_SECOND), true); - assertEquals(actual.isSupported(MICRO_OF_SECOND), true); - assertEquals(actual.isSupported(MILLI_OF_SECOND), true); + assertEquals(true, actual.isSupported(INSTANT_SECONDS)); + assertEquals(false, actual.isSupported(EPOCH_DAY)); + assertEquals(false, actual.isSupported(SECOND_OF_DAY)); + assertEquals(true, actual.isSupported(NANO_OF_SECOND)); + assertEquals(true, actual.isSupported(MICRO_OF_SECOND)); + assertEquals(true, actual.isSupported(MILLI_OF_SECOND)); } // Bug 8223773: validation check for the range of HourOfAmPm in SMART mode. // Should throw a DateTimeParseException, as 12 is out of range for HourOfAmPm. - @Test(expectedExceptions = DateTimeParseException.class) + @Test public void test_validateHourOfAmPm() { - try { - new DateTimeFormatterBuilder() - .appendValue(HOUR_OF_AMPM,2) - .appendText(AMPM_OF_DAY) - .toFormatter(US) - .parse("12PM"); - } catch (DateTimeParseException e) { - Throwable cause = e.getCause(); - if (cause == null || - !DTPE_MESSAGE.equals(cause.getMessage())) { - throw new RuntimeException( - "DateTimeParseException was thrown with different reason: " + e); - } else { - throw e; + Assertions.assertThrows(DateTimeParseException.class, () -> { + try { + new DateTimeFormatterBuilder() + .appendValue(HOUR_OF_AMPM,2) + .appendText(AMPM_OF_DAY) + .toFormatter(US) + .parse("12PM"); + } catch (DateTimeParseException e) { + Throwable cause = e.getCause(); + if (cause == null || + !DTPE_MESSAGE.equals(cause.getMessage())) { + throw new RuntimeException( + "DateTimeParseException was thrown with different reason: " + e); + } else { + throw e; + } } - } + }); } // Checks ::toFormat().parseObject(text, pos) do not throw DateTimeException diff --git a/test/jdk/java/time/test/java/time/format/TestDateTimeTextProvider.java b/test/jdk/java/time/test/java/time/format/TestDateTimeTextProvider.java index f2a14374c49..80336b7b761 100644 --- a/test/jdk/java/time/test/java/time/format/TestDateTimeTextProvider.java +++ b/test/jdk/java/time/test/java/time/format/TestDateTimeTextProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -62,7 +62,8 @@ package test.java.time.format; import static java.time.temporal.ChronoField.AMPM_OF_DAY; import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -70,19 +71,19 @@ import java.time.format.TextStyle; import java.time.temporal.TemporalField; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test SimpleDateTimeTextProvider. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeTextProvider extends AbstractTestPrinterParser { Locale enUS = Locale.US; //----------------------------------------------------------------------- - @DataProvider(name = "Text") Object[][] data_text() { return new Object[][] { {DAY_OF_WEEK, 1, TextStyle.SHORT, enUS, "Mon"}, @@ -133,10 +134,11 @@ public class TestDateTimeTextProvider extends AbstractTestPrinterParser { }; } - @Test(dataProvider = "Text") + @ParameterizedTest + @MethodSource("data_text") public void test_getText(TemporalField field, Number value, TextStyle style, Locale locale, String expected) { DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale); - assertEquals(fmt.format(ZonedDateTime.now().with(field, value.longValue())), expected); + assertEquals(expected, fmt.format(ZonedDateTime.now().with(field, value.longValue()))); } } diff --git a/test/jdk/java/time/test/java/time/format/TestDateTimeTextProviderWithLocale.java b/test/jdk/java/time/test/java/time/format/TestDateTimeTextProviderWithLocale.java index 65d65251862..35b793bb769 100644 --- a/test/jdk/java/time/test/java/time/format/TestDateTimeTextProviderWithLocale.java +++ b/test/jdk/java/time/test/java/time/format/TestDateTimeTextProviderWithLocale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -69,7 +69,8 @@ package test.java.time.format; import static java.time.temporal.ChronoField.AMPM_OF_DAY; import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -77,20 +78,20 @@ import java.time.format.TextStyle; import java.time.temporal.TemporalField; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test SimpleDateTimeTextProviderWithLocale. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeTextProviderWithLocale extends AbstractTestPrinterParser { Locale enUS = Locale.US; Locale ptBR = Locale.of("pt", "BR"); //----------------------------------------------------------------------- - @DataProvider(name = "Text") Object[][] data_text() { return new Object[][] { {DAY_OF_WEEK, 1, TextStyle.SHORT, ptBR, "seg."}, @@ -138,10 +139,11 @@ public class TestDateTimeTextProviderWithLocale extends AbstractTestPrinterParse }; } - @Test(dataProvider = "Text") + @ParameterizedTest + @MethodSource("data_text") public void test_getText(TemporalField field, Number value, TextStyle style, Locale locale, String expected) { DateTimeFormatter fmt = getFormatter(field, style).withLocale(locale); - assertEquals(fmt.format(ZonedDateTime.now().with(field, value.longValue())), expected); + assertEquals(expected, fmt.format(ZonedDateTime.now().with(field, value.longValue()))); } } diff --git a/test/jdk/java/time/test/java/time/format/TestDecimalStyle.java b/test/jdk/java/time/test/java/time/format/TestDecimalStyle.java index b506d547ada..48f7da3e80c 100644 --- a/test/jdk/java/time/test/java/time/format/TestDecimalStyle.java +++ b/test/jdk/java/time/test/java/time/format/TestDecimalStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,17 +59,16 @@ */ package test.java.time.format; -import static org.testng.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertSame; import java.time.format.DecimalStyle; import java.util.Locale; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test DecimalStyle. */ -@Test public class TestDecimalStyle { @Test diff --git a/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java b/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java index 4dbca06709d..0c079173d1f 100644 --- a/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java +++ b/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -60,8 +60,9 @@ package test.java.time.format; import static java.time.temporal.ChronoField.*; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.text.ParsePosition; import java.time.DateTimeException; @@ -71,8 +72,12 @@ import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import test.java.time.temporal.MockFieldValue; /** @@ -80,7 +85,7 @@ import test.java.time.temporal.MockFieldValue; * * @bug 8230136 8276220 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestFractionPrinterParser extends AbstractTestPrinterParser { private DateTimeFormatter getFormatter(TemporalField field, int minWidth, int maxWidth, boolean decimalPoint) { @@ -90,12 +95,11 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- // print //----------------------------------------------------------------------- - @Test(expectedExceptions=DateTimeException.class) + @Test public void test_print_emptyCalendrical() throws Exception { - getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(EMPTY_DTA, buf); + Assertions.assertThrows(DateTimeException.class, () -> getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(EMPTY_DTA, buf)); } - @DataProvider(name="OOB_Nanos") Object[][] provider_oob_nanos() { return new Object[][]{ {-1}, @@ -108,12 +112,12 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="OOB_Nanos", expectedExceptions=DateTimeException.class) + @ParameterizedTest + @MethodSource("provider_oob_nanos") public void test_print_oob_nanos(long value) throws Exception { - getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(new MockFieldValue(NANO_OF_SECOND, value), buf); + Assertions.assertThrows(DateTimeException.class, () -> getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(new MockFieldValue(NANO_OF_SECOND, value), buf)); } - @DataProvider(name="OOB_Micros") Object[][] provider_oob_micros() { return new Object[][]{ {-1}, @@ -126,25 +130,27 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="OOB_Micros", expectedExceptions=DateTimeException.class) + @ParameterizedTest + @MethodSource("provider_oob_micros") public void test_print_oob_micros(long value) throws Exception { - getFormatter(MICRO_OF_SECOND, 0, 9, true).formatTo(new MockFieldValue(MICRO_OF_SECOND, value), buf); + Assertions.assertThrows(DateTimeException.class, () -> getFormatter(MICRO_OF_SECOND, 0, 9, true).formatTo(new MockFieldValue(MICRO_OF_SECOND, value), buf)); } + @Test public void test_print_append() throws Exception { buf.append("EXISTING"); getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(LocalTime.of(12, 30, 40, 3), buf); - assertEquals(buf.toString(), "EXISTING.000000003"); + assertEquals("EXISTING.000000003", buf.toString()); } + @Test public void test_print_append_micros() throws Exception { buf.append("EXISTING"); getFormatter(MICRO_OF_SECOND, 0, 6, true).formatTo(LocalTime.of(12, 30, 40, 3000), buf); - assertEquals(buf.toString(), "EXISTING.000003"); + assertEquals("EXISTING.000003", buf.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="Nanos") Object[][] provider_nanos() { return new Object[][] { {0, 9, 0, ""}, @@ -266,26 +272,27 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="Nanos") + @ParameterizedTest + @MethodSource("provider_nanos") public void test_print_nanos(int minWidth, int maxWidth, int value, String result) throws Exception { getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).formatTo(new MockFieldValue(NANO_OF_SECOND, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } - @Test(dataProvider="Nanos") + @ParameterizedTest + @MethodSource("provider_nanos") public void test_print_nanos_noDecimalPoint(int minWidth, int maxWidth, int value, String result) throws Exception { getFormatter(NANO_OF_SECOND, minWidth, maxWidth, false).formatTo(new MockFieldValue(NANO_OF_SECOND, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), (result.startsWith(".") ? result.substring(1) : result)); + assertEquals((result.startsWith(".") ? result.substring(1) : result), buf.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="Micros") Object[][] provider_micros() { return new Object[][] { {0, 6, 0, ""}, @@ -342,26 +349,27 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="Micros") + @ParameterizedTest + @MethodSource("provider_micros") public void test_print_micros(int minWidth, int maxWidth, int value, String result) throws Exception { getFormatter(MICRO_OF_SECOND, minWidth, maxWidth, true).formatTo(new MockFieldValue(MICRO_OF_SECOND, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } - @Test(dataProvider="Micros") + @ParameterizedTest + @MethodSource("provider_micros") public void test_print_micros_noDecimalPoint(int minWidth, int maxWidth, int value, String result) throws Exception { getFormatter(MICRO_OF_SECOND, minWidth, maxWidth, false).formatTo(new MockFieldValue(MICRO_OF_SECOND, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), (result.startsWith(".") ? result.substring(1) : result)); + assertEquals((result.startsWith(".") ? result.substring(1) : result), buf.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="Seconds") Object[][] provider_seconds() { return new Object[][] { {0, 9, 0, ""}, @@ -384,51 +392,56 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="Seconds") + @ParameterizedTest + @MethodSource("provider_seconds") public void test_print_seconds(int minWidth, int maxWidth, int value, String result) throws Exception { getFormatter(SECOND_OF_MINUTE, minWidth, maxWidth, true).formatTo(new MockFieldValue(SECOND_OF_MINUTE, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } - @Test(dataProvider="Seconds") + @ParameterizedTest + @MethodSource("provider_seconds") public void test_print_seconds_noDecimalPoint(int minWidth, int maxWidth, int value, String result) throws Exception { getFormatter(SECOND_OF_MINUTE, minWidth, maxWidth, false).formatTo(new MockFieldValue(SECOND_OF_MINUTE, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), (result.startsWith(".") ? result.substring(1) : result)); + assertEquals((result.startsWith(".") ? result.substring(1) : result), buf.toString()); } //----------------------------------------------------------------------- // parse //----------------------------------------------------------------------- - @Test(dataProvider="Nanos") + @ParameterizedTest + @MethodSource("provider_nanos") public void test_reverseParse(int minWidth, int maxWidth, int value, String result) throws Exception { ParsePosition pos = new ParsePosition(0); int expectedValue = fixParsedValue(maxWidth, value); TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved(result, pos); - assertEquals(pos.getIndex(), result.length()); + assertEquals(result.length(), pos.getIndex()); assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); } - @Test(dataProvider="Nanos") + @ParameterizedTest + @MethodSource("provider_nanos") public void test_reverseParse_noDecimalPoint(int minWidth, int maxWidth, int value, String result) throws Exception { ParsePosition pos = new ParsePosition((result.startsWith(".") ? 1 : 0)); TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, false).parseUnresolved(result, pos); - assertEquals(pos.getIndex(), result.length()); + assertEquals(result.length(), pos.getIndex()); int expectedValue = fixParsedValue(maxWidth, value); assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); } - @Test(dataProvider="Nanos") + @ParameterizedTest + @MethodSource("provider_nanos") public void test_reverseParse_followedByNonDigit(int minWidth, int maxWidth, int value, String result) throws Exception { ParsePosition pos = new ParsePosition(0); int expectedValue = fixParsedValue(maxWidth, value); TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved(result + " ", pos); - assertEquals(pos.getIndex(), result.length()); + assertEquals(result.length(), pos.getIndex()); assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); } @@ -441,12 +454,13 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { // assertParsed(parseContext, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); // } - @Test(dataProvider="Nanos") + @ParameterizedTest + @MethodSource("provider_nanos") public void test_reverseParse_preceededByNonDigit(int minWidth, int maxWidth, int value, String result) throws Exception { ParsePosition pos = new ParsePosition(1); int expectedValue = fixParsedValue(maxWidth, value); TemporalAccessor parsed = getFormatter(NANO_OF_SECOND, minWidth, maxWidth, true).parseUnresolved(" " + result, pos); - assertEquals(pos.getIndex(), result.length() + 1); + assertEquals(result.length() + 1, pos.getIndex()); assertParsed(parsed, NANO_OF_SECOND, value == 0 && minWidth == 0 ? null : (long) expectedValue); } @@ -458,25 +472,25 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { return value; } - @Test(dataProvider="Seconds") + @ParameterizedTest + @MethodSource("provider_seconds") public void test_reverseParse_seconds(int minWidth, int maxWidth, int value, String result) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(SECOND_OF_MINUTE, minWidth, maxWidth, true).parseUnresolved(result, pos); - assertEquals(pos.getIndex(), result.length()); + assertEquals(result.length(), pos.getIndex()); assertParsed(parsed, SECOND_OF_MINUTE, value == 0 && minWidth == 0 ? null : (long) value); } private void assertParsed(TemporalAccessor parsed, TemporalField field, Long value) { if (value == null) { - assertEquals(parsed.isSupported(field), false); + assertEquals(false, parsed.isSupported(field)); } else { - assertEquals(parsed.isSupported(field), true); - assertEquals(parsed.getLong(field), (long) value); + assertEquals(true, parsed.isSupported(field)); + assertEquals((long) value, parsed.getLong(field)); } } //----------------------------------------------------------------------- - @DataProvider(name="ParseNothing") Object[][] provider_parseNothing() { return new Object[][] { {NANO_OF_SECOND, 3, 6, true, "", 0, 0}, @@ -489,15 +503,15 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider = "ParseNothing") + @ParameterizedTest + @MethodSource("provider_parseNothing") public void test_parse_nothing(TemporalField field, int min, int max, boolean decimalPoint, String text, int pos, int expected) { ParsePosition ppos = new ParsePosition(pos); TemporalAccessor parsed = getFormatter(field, min, max, decimalPoint).parseUnresolved(text, ppos); - assertEquals(ppos.getErrorIndex(), expected); - assertEquals(parsed, null); + assertEquals(expected, ppos.getErrorIndex()); + assertEquals(null, parsed); } - @DataProvider(name="ParseMinWidth") Object[][] provider_parseMinWidth() { return new Object[][] { {MILLI_OF_SECOND, 3, 3, true, ".1x"}, @@ -506,22 +520,26 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="ParseMinWidth", expectedExceptions=DateTimeException.class) + @ParameterizedTest + @MethodSource("provider_parseMinWidth") public void test_parse_minWidth(TemporalField field, int min, int max, boolean decimalPoint, String text) throws Exception { - builder - .appendFraction(field, min, max, decimalPoint) - .appendLiteral("x") - .toFormatter(locale) - .parse(text); + Assertions + .assertThrows(DateTimeException.class, () -> builder + .appendFraction(field, min, max, decimalPoint) + .appendLiteral("x") + .toFormatter(locale) + .parse(text)); } //----------------------------------------------------------------------- + @Test public void test_toString() throws Exception { - assertEquals(getFormatter(NANO_OF_SECOND, 3, 6, true).toString(), "Fraction(NanoOfSecond,3,6,DecimalPoint)"); + assertEquals("Fraction(NanoOfSecond,3,6,DecimalPoint)", getFormatter(NANO_OF_SECOND, 3, 6, true).toString()); } + @Test public void test_toString_noDecimalPoint() throws Exception { - assertEquals(getFormatter(NANO_OF_SECOND, 3, 6, false).toString(), "Fraction(NanoOfSecond,3,6)"); + assertEquals("Fraction(NanoOfSecond,3,6)", getFormatter(NANO_OF_SECOND, 3, 6, false).toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestLocalizedOffsetPrinterParser.java b/test/jdk/java/time/test/java/time/format/TestLocalizedOffsetPrinterParser.java index d1b1c25ba98..36b491178a7 100644 --- a/test/jdk/java/time/test/java/time/format/TestLocalizedOffsetPrinterParser.java +++ b/test/jdk/java/time/test/java/time/format/TestLocalizedOffsetPrinterParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -35,7 +35,7 @@ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.LocalDateTime; import java.time.OffsetDateTime; @@ -47,20 +47,20 @@ import java.time.format.TextStyle; import java.util.Locale; import java.util.Objects; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test DateTimeFormatterBuilder.appendOffset(). */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestLocalizedOffsetPrinterParser { private static final LocalDateTime DT_2012_06_30_12_30_40 = LocalDateTime.of(2012, 6, 30, 12, 30, 40); private static final Locale LOCALE_GA = Locale.of("ga"); - @DataProvider(name="print_localized_custom_locale") Object[][] data_print_localized_custom_locale() { return new Object[][] { {TextStyle.FULL, DT_2012_06_30_12_30_40, ZoneOffset.UTC, LOCALE_GA, "MAG"}, @@ -69,7 +69,8 @@ public class TestLocalizedOffsetPrinterParser { }; } - @Test(dataProvider="print_localized_custom_locale") + @ParameterizedTest + @MethodSource("data_print_localized_custom_locale") public void test_print_localized_custom_locale(TextStyle style, LocalDateTime ldt, ZoneOffset offset, Locale locale, String expected) { Objects.requireNonNull(locale, "Locale must not be null"); @@ -78,27 +79,27 @@ public class TestLocalizedOffsetPrinterParser { ZonedDateTime zdt = ldt.atZone(offset); DateTimeFormatter f = new DateTimeFormatterBuilder().appendLocalizedOffset(style).toFormatter(locale); - assertEquals(f.format(odt), expected); - assertEquals(f.format(zdt), expected); - assertEquals(f.parse(expected, ZoneOffset::from), offset); + assertEquals(expected, f.format(odt)); + assertEquals(expected, f.format(zdt)); + assertEquals(offset, f.parse(expected, ZoneOffset::from)); if (style == TextStyle.FULL) { f = new DateTimeFormatterBuilder().appendPattern("ZZZZ").toFormatter(locale); - assertEquals(f.format(odt), expected); - assertEquals(f.format(zdt), expected); - assertEquals(f.parse(expected, ZoneOffset::from), offset); + assertEquals(expected, f.format(odt)); + assertEquals(expected, f.format(zdt)); + assertEquals(offset, f.parse(expected, ZoneOffset::from)); f = new DateTimeFormatterBuilder().appendPattern("OOOO").toFormatter(locale); - assertEquals(f.format(odt), expected); - assertEquals(f.format(zdt), expected); - assertEquals(f.parse(expected, ZoneOffset::from), offset); + assertEquals(expected, f.format(odt)); + assertEquals(expected, f.format(zdt)); + assertEquals(offset, f.parse(expected, ZoneOffset::from)); } if (style == TextStyle.SHORT) { f = new DateTimeFormatterBuilder().appendPattern("O").toFormatter(locale); - assertEquals(f.format(odt), expected); - assertEquals(f.format(zdt), expected); - assertEquals(f.parse(expected, ZoneOffset::from), offset); + assertEquals(expected, f.format(odt)); + assertEquals(expected, f.format(zdt)); + assertEquals(offset, f.parse(expected, ZoneOffset::from)); } } diff --git a/test/jdk/java/time/test/java/time/format/TestLocalizedPattern.java b/test/jdk/java/time/test/java/time/format/TestLocalizedPattern.java index aa8ff763aad..1be115bc0ed 100644 --- a/test/jdk/java/time/test/java/time/format/TestLocalizedPattern.java +++ b/test/jdk/java/time/test/java/time/format/TestLocalizedPattern.java @@ -22,7 +22,7 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DateTimeException; import java.time.ZonedDateTime; @@ -34,14 +34,16 @@ import java.util.List; import java.util.Locale; import java.util.ResourceBundle; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test DateTimeFormatter.ofLocalizedPattern() related methods. * @bug 8176706 8284840 8354548 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestLocalizedPattern { private static final ZonedDateTime ZDT = @@ -52,7 +54,6 @@ public class TestLocalizedPattern { Locale.forLanguageTag("ja-JP-u-ca-japanese") ); - @DataProvider(name = "validSkeletons") Object[][] data_validSkeletons() { return SAMPLE_LOCALES.stream() .flatMap(l -> { @@ -63,43 +64,46 @@ public class TestLocalizedPattern { .toArray(new Object[0][0]); } - @DataProvider(name = "invalidSkeletons") Object[][] data_invalidSkeletons() { return new Object[][] { {"afo"}, {"hB"}, {"uMMM"}, {"MMMMMM"}, {"BhmsyMMM"}, }; } - @DataProvider(name = "unavailableSkeletons") Object[][] data_unavailableSkeletons() { return new Object[][] { {"yyyyyy"}, {"BBh"}, {"yMMMMEdBBh"}, }; } - @Test(dataProvider = "validSkeletons") + @ParameterizedTest + @MethodSource("data_validSkeletons") public void test_ofLocalizedPattern(String skeleton, String expected, Locale l) { var dtf = DateTimeFormatter.ofLocalizedPattern(skeleton).localizedBy(l); - assertEquals(dtf.format(ZDT), expected); + assertEquals(expected, dtf.format(ZDT)); } - @Test(dataProvider = "invalidSkeletons", expectedExceptions = IllegalArgumentException.class) + @ParameterizedTest + @MethodSource("data_invalidSkeletons") public void test_ofLocalizedPattern_invalid(String skeleton) { - DateTimeFormatter.ofLocalizedPattern(skeleton); + Assertions.assertThrows(IllegalArgumentException.class, () -> DateTimeFormatter.ofLocalizedPattern(skeleton)); } - @Test(dataProvider = "invalidSkeletons", expectedExceptions = IllegalArgumentException.class) + @ParameterizedTest + @MethodSource("data_invalidSkeletons") public void test_appendLocalized_invalid(String skeleton) { - new DateTimeFormatterBuilder().appendLocalized(skeleton); + Assertions.assertThrows(IllegalArgumentException.class, () -> new DateTimeFormatterBuilder().appendLocalized(skeleton)); } - @Test(dataProvider = "unavailableSkeletons", expectedExceptions = DateTimeException.class) + @ParameterizedTest + @MethodSource("data_unavailableSkeletons") public void test_ofLocalizedPattern_unavailable(String skeleton) { - DateTimeFormatter.ofLocalizedPattern(skeleton).format(ZDT); + Assertions.assertThrows(DateTimeException.class, () -> DateTimeFormatter.ofLocalizedPattern(skeleton).format(ZDT)); } - @Test(dataProvider = "unavailableSkeletons", expectedExceptions = DateTimeException.class) + @ParameterizedTest + @MethodSource("data_unavailableSkeletons") public void test_getLocalizedDateTimePattern_unavailable(String skeleton) { - DateTimeFormatterBuilder.getLocalizedDateTimePattern(skeleton, IsoChronology.INSTANCE, Locale.US); + Assertions.assertThrows(DateTimeException.class, () -> DateTimeFormatterBuilder.getLocalizedDateTimePattern(skeleton, IsoChronology.INSTANCE, Locale.US)); } } diff --git a/test/jdk/java/time/test/java/time/format/TestNarrowMonthNamesAndDayNames.java b/test/jdk/java/time/test/java/time/format/TestNarrowMonthNamesAndDayNames.java index 3e105665d14..92b7d1366b6 100644 --- a/test/jdk/java/time/test/java/time/format/TestNarrowMonthNamesAndDayNames.java +++ b/test/jdk/java/time/test/java/time/format/TestNarrowMonthNamesAndDayNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -28,7 +28,7 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DayOfWeek; import java.time.Month; @@ -37,9 +37,11 @@ import java.util.Arrays; import java.util.List; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestNarrowMonthNamesAndDayNames { static { @@ -59,7 +61,6 @@ public class TestNarrowMonthNamesAndDayNames { * Locale en_US, de_DE, fr_FR, no_NO will have same Narrow and * Narrow_Standalone month Names for COMPAT Provider. */ - @DataProvider(name = "MonthNarrows") public Object[][] monthNameData() { return new Object[][]{{new String[]{ "J", @@ -80,27 +81,23 @@ public class TestNarrowMonthNamesAndDayNames { //----------------------------------------------------------------------- // Check Narrow and Narrow_standalone month name values //----------------------------------------------------------------------- - @Test(dataProvider = "MonthNarrows") + @ParameterizedTest + @MethodSource("monthNameData") public void compareMonthNarrowValues(String[] monthNarrowExpected) { - LOCARR.forEach((loc) -> { - TEXTSTYLELIST.forEach((style) -> { - MONTHVALUES.forEach((value) -> { - String result = value.getDisplayName(style, loc); - int index = value.ordinal(); - assertEquals(result, monthNarrowExpected[index], "Test failed" - + " for COMPAT Provider for locale " - + loc + " for style " + style.name() - + " with Month value " + value.name()); - }); - }); - }); + LOCARR.forEach((loc) -> TEXTSTYLELIST.forEach((style) -> MONTHVALUES.forEach((value) -> { + String result = value.getDisplayName(style, loc); + int index = value.ordinal(); + assertEquals(monthNarrowExpected[index], result, "Test failed" + + " for COMPAT Provider for locale " + + loc + " for style " + style.name() + + " with Month value " + value.name()); + }))); } /** * Locale en_US, de_DE, fr_FR, no_NO will have different Narrow and * Narrow_Standalone Day Names for COMPAT Provider. */ - @DataProvider(name = "DayNarrows") public Object[][] dayNameData() { return new Object[][]{ {Locale.US, new String[]{"M", "T", "W", "T", "F", "S", "S"}}, @@ -112,17 +109,16 @@ public class TestNarrowMonthNamesAndDayNames { //----------------------------------------------------------------------- // Check Narrow and Narrow_standalone Day name values //----------------------------------------------------------------------- - @Test(dataProvider = "DayNarrows") + @ParameterizedTest + @MethodSource("dayNameData") public void compareDayNarrowValues(Locale locale, String[] dayNarrowExpected) { - TEXTSTYLELIST.forEach((style) -> { - DAYVALUES.forEach((value) -> { - String result = value.getDisplayName(style, locale); - int index = value.ordinal(); - assertEquals(result, dayNarrowExpected[index], "Test failed" - + " for COMPAT Provider for locale " - + locale + " for style " + style.name() - + " with Day value " + value.name()); - }); - }); + TEXTSTYLELIST.forEach((style) -> DAYVALUES.forEach((value) -> { + String result = value.getDisplayName(style, locale); + int index = value.ordinal(); + assertEquals(dayNarrowExpected[index], result, "Test failed" + + " for COMPAT Provider for locale " + + locale + " for style " + style.name() + + " with Day value " + value.name()); + })); } } diff --git a/test/jdk/java/time/test/java/time/format/TestNonIsoFormatter.java b/test/jdk/java/time/test/java/time/format/TestNonIsoFormatter.java index edca2ae8ceb..cb824e1ea7f 100644 --- a/test/jdk/java/time/test/java/time/format/TestNonIsoFormatter.java +++ b/test/jdk/java/time/test/java/time/format/TestNonIsoFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2024, 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 @@ -30,7 +30,7 @@ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.LocalDate; import java.time.chrono.ChronoLocalDate; @@ -51,9 +51,11 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; import java.util.Locale; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test DateTimeFormatter with non-ISO chronology. @@ -61,7 +63,7 @@ import org.testng.annotations.Test; * Strings in test data are all dependent on CLDR data which may change * in future CLDR releases. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestNonIsoFormatter { private static final Chronology ISO8601 = IsoChronology.INSTANCE; private static final Chronology JAPANESE = JapaneseChronology.INSTANCE; @@ -76,11 +78,10 @@ public class TestNonIsoFormatter { private static final Locale thTHTH = Locale.forLanguageTag("th-TH-u-nu-thai"); private static final Locale jaJPJP = Locale.forLanguageTag("ja-JP-u-ca-japanese"); - @BeforeMethod + @BeforeEach public void setUp() { } - @DataProvider(name="format_data") Object[][] formatData() { return new Object[][] { // Chronology, Format Locale, Numbering Locale, ChronoLocalDate, expected string @@ -102,7 +103,6 @@ public class TestNonIsoFormatter { }; } - @DataProvider(name="invalid_text") Object[][] invalidText() { return new Object[][] { // TODO: currently fixed Chronology and Locale. @@ -113,7 +113,6 @@ public class TestNonIsoFormatter { }; } - @DataProvider(name="chrono_names") Object[][] chronoNamesData() { return new Object[][] { // Chronology, Locale, Chronology Name @@ -137,7 +136,6 @@ public class TestNonIsoFormatter { }; } - @DataProvider(name="lenient_eraYear") Object[][] lenientEraYear() { return new Object[][] { // Chronology, lenient era/year, strict era/year @@ -147,17 +145,19 @@ public class TestNonIsoFormatter { }; } - @Test(dataProvider="format_data") + @ParameterizedTest + @MethodSource("formatData") public void test_formatLocalizedDate(Chronology chrono, Locale formatLocale, Locale numberingLocale, ChronoLocalDate date, String expected) { DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) .withChronology(chrono).withLocale(formatLocale) .withDecimalStyle(DecimalStyle.of(numberingLocale)); String text = dtf.format(date); - assertEquals(text, expected); + assertEquals(expected, text); } - @Test(dataProvider="format_data") + @ParameterizedTest + @MethodSource("formatData") public void test_parseLocalizedText(Chronology chrono, Locale formatLocale, Locale numberingLocale, ChronoLocalDate expected, String text) { DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) @@ -165,28 +165,33 @@ public class TestNonIsoFormatter { .withDecimalStyle(DecimalStyle.of(numberingLocale)); TemporalAccessor temporal = dtf.parse(text); ChronoLocalDate date = chrono.date(temporal); - assertEquals(date, expected); + assertEquals(expected, date); } - @Test(dataProvider="invalid_text", expectedExceptions=DateTimeParseException.class) + @ParameterizedTest + @MethodSource("invalidText") public void test_parseInvalidText(String text) { - DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) - .withChronology(JAPANESE).withLocale(Locale.JAPANESE); - dtf.parse(text); + Assertions.assertThrows(DateTimeParseException.class, () -> { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) + .withChronology(JAPANESE).withLocale(Locale.JAPANESE); + dtf.parse(text); + }); } - @Test(dataProvider="chrono_names") + @ParameterizedTest + @MethodSource("chronoNamesData") public void test_chronoNames(Chronology chrono, Locale locale, String expected) { DateTimeFormatter dtf = new DateTimeFormatterBuilder().appendChronologyText(TextStyle.SHORT) .toFormatter(locale); String text = dtf.format(chrono.dateNow()); - assertEquals(text, expected); + assertEquals(expected, text); TemporalAccessor ta = dtf.parse(text); Chronology cal = ta.query(TemporalQueries.chronology()); - assertEquals(cal, chrono); + assertEquals(chrono, cal); } - @Test(dataProvider="lenient_eraYear") + @ParameterizedTest + @MethodSource("lenientEraYear") public void test_lenientEraYear(Chronology chrono, String lenient, String strict) { String mdStr = "-01-01"; DateTimeFormatter dtf = new DateTimeFormatterBuilder() @@ -194,6 +199,6 @@ public class TestNonIsoFormatter { .toFormatter(Locale.ROOT) .withChronology(chrono); DateTimeFormatter dtfLenient = dtf.withResolverStyle(ResolverStyle.LENIENT); - assertEquals(LocalDate.parse(lenient+mdStr, dtfLenient), LocalDate.parse(strict+mdStr, dtf)); + assertEquals(LocalDate.parse(strict+mdStr, dtf), LocalDate.parse(lenient+mdStr, dtfLenient)); } } diff --git a/test/jdk/java/time/test/java/time/format/TestNumberParser.java b/test/jdk/java/time/test/java/time/format/TestNumberParser.java index f3ac13b791d..ea92dfcaea5 100644 --- a/test/jdk/java/time/test/java/time/format/TestNumberParser.java +++ b/test/jdk/java/time/test/java/time/format/TestNumberParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -63,9 +63,10 @@ import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static java.time.temporal.ChronoField.DAY_OF_YEAR; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.text.ParsePosition; import java.time.format.DateTimeFormatter; @@ -74,17 +75,17 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; import java.time.temporal.TemporalQueries; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test NumberPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestNumberParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- - @DataProvider(name="error") Object[][] data_error() { return new Object[][] { {DAY_OF_MONTH, 1, 2, SignStyle.NEVER, "12", -1, IndexOutOfBoundsException.class}, @@ -92,7 +93,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="error") + @ParameterizedTest + @MethodSource("data_error") public void test_parse_error(TemporalField field, int min, int max, SignStyle style, String text, int pos, Class expected) { try { getFormatter(field, min, max, style).parseUnresolved(text, new ParsePosition(pos)); @@ -103,7 +105,6 @@ public class TestNumberParser extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- - @DataProvider(name="parseData") Object[][] provider_parseData() { return new Object[][] { // normal @@ -163,7 +164,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- - @Test(dataProvider="parseData") + @ParameterizedTest + @MethodSource("provider_parseData") public void test_parse_fresh(int minWidth, int maxWidth, SignStyle signStyle, int subsequentWidth, String text, int pos, int expectedPos, long expectedValue) { ParsePosition ppos = new ParsePosition(pos); DateTimeFormatter dtf = getFormatter(DAY_OF_MONTH, minWidth, maxWidth, signStyle); @@ -173,17 +175,18 @@ public class TestNumberParser extends AbstractTestPrinterParser { } TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), expectedPos); + assertEquals(expectedPos, ppos.getErrorIndex()); } else { assertTrue(subsequentWidth >= 0); - assertEquals(ppos.getIndex(), expectedPos + subsequentWidth); - assertEquals(parsed.getLong(DAY_OF_MONTH), expectedValue); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(expectedPos + subsequentWidth, ppos.getIndex()); + assertEquals(expectedValue, parsed.getLong(DAY_OF_MONTH)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } - @Test(dataProvider="parseData") + @ParameterizedTest + @MethodSource("provider_parseData") public void test_parse_textField(int minWidth, int maxWidth, SignStyle signStyle, int subsequentWidth, String text, int pos, int expectedPos, long expectedValue) { ParsePosition ppos = new ParsePosition(pos); DateTimeFormatter dtf = getFormatter(DAY_OF_WEEK, minWidth, maxWidth, signStyle); @@ -193,18 +196,17 @@ public class TestNumberParser extends AbstractTestPrinterParser { } TemporalAccessor parsed = dtf.parseUnresolved(text, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), expectedPos); + assertEquals(expectedPos, ppos.getErrorIndex()); } else { assertTrue(subsequentWidth >= 0); - assertEquals(ppos.getIndex(), expectedPos + subsequentWidth); - assertEquals(parsed.getLong(DAY_OF_WEEK), expectedValue); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(expectedPos + subsequentWidth, ppos.getIndex()); + assertEquals(expectedValue, parsed.getLong(DAY_OF_WEEK)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } //----------------------------------------------------------------------- - @DataProvider(name="parseSignsStrict") Object[][] provider_parseSignsStrict() { return new Object[][] { // basics @@ -304,22 +306,22 @@ public class TestNumberParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="parseSignsStrict") + @ParameterizedTest + @MethodSource("provider_parseSignsStrict") public void test_parseSignsStrict(String input, int min, int max, SignStyle style, int parseLen, Integer parseVal) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(DAY_OF_MONTH, min, max, style).parseUnresolved(input, pos); if (pos.getErrorIndex() != -1) { - assertEquals(pos.getErrorIndex(), parseLen); + assertEquals(parseLen, pos.getErrorIndex()); } else { - assertEquals(pos.getIndex(), parseLen); - assertEquals(parsed.getLong(DAY_OF_MONTH), (long)parseVal); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(parseLen, pos.getIndex()); + assertEquals((long)parseVal, parsed.getLong(DAY_OF_MONTH)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } //----------------------------------------------------------------------- - @DataProvider(name="parseSignsLenient") Object[][] provider_parseSignsLenient() { return new Object[][] { // never @@ -413,23 +415,23 @@ public class TestNumberParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="parseSignsLenient") + @ParameterizedTest + @MethodSource("provider_parseSignsLenient") public void test_parseSignsLenient(String input, int min, int max, SignStyle style, int parseLen, Integer parseVal) throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(DAY_OF_MONTH, min, max, style).parseUnresolved(input, pos); if (pos.getErrorIndex() != -1) { - assertEquals(pos.getErrorIndex(), parseLen); + assertEquals(parseLen, pos.getErrorIndex()); } else { - assertEquals(pos.getIndex(), parseLen); - assertEquals(parsed.getLong(DAY_OF_MONTH), (long)parseVal); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(parseLen, pos.getIndex()); + assertEquals((long)parseVal, parsed.getLong(DAY_OF_MONTH)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } //----------------------------------------------------------------------- - @DataProvider(name="parseDigitsLenient") Object[][] provider_parseDigitsLenient() { return new Object[][] { // never @@ -504,23 +506,23 @@ public class TestNumberParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="parseDigitsLenient") + @ParameterizedTest + @MethodSource("provider_parseDigitsLenient") public void test_parseDigitsLenient(String input, int min, int max, SignStyle style, int parseLen, Integer parseVal) throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(DAY_OF_MONTH, min, max, style).parseUnresolved(input, pos); if (pos.getErrorIndex() != -1) { - assertEquals(pos.getErrorIndex(), parseLen); + assertEquals(parseLen, pos.getErrorIndex()); } else { - assertEquals(pos.getIndex(), parseLen); - assertEquals(parsed.getLong(DAY_OF_MONTH), (long)parseVal); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(parseLen, pos.getIndex()); + assertEquals((long)parseVal, parsed.getLong(DAY_OF_MONTH)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } //----------------------------------------------------------------------- - @DataProvider(name="parseDigitsAdjacentLenient") Object[][] provider_parseDigitsAdjacentLenient() { return new Object[][] { // never @@ -538,7 +540,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="parseDigitsAdjacentLenient") + @ParameterizedTest + @MethodSource("provider_parseDigitsAdjacentLenient") public void test_parseDigitsAdjacentLenient(String input, int parseLen, Integer parseMonth, Integer parsedDay) throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); @@ -547,13 +550,13 @@ public class TestNumberParser extends AbstractTestPrinterParser { .appendValue(DAY_OF_MONTH, 2).toFormatter(locale).withDecimalStyle(decimalStyle); TemporalAccessor parsed = f.parseUnresolved(input, pos); if (pos.getErrorIndex() != -1) { - assertEquals(pos.getErrorIndex(), parseLen); + assertEquals(parseLen, pos.getErrorIndex()); } else { - assertEquals(pos.getIndex(), parseLen); - assertEquals(parsed.getLong(MONTH_OF_YEAR), (long) parseMonth); - assertEquals(parsed.getLong(DAY_OF_MONTH), (long) parsedDay); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(parseLen, pos.getIndex()); + assertEquals((long) parseMonth, parsed.getLong(MONTH_OF_YEAR)); + assertEquals((long) parsedDay, parsed.getLong(DAY_OF_MONTH)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } diff --git a/test/jdk/java/time/test/java/time/format/TestNumberPrinter.java b/test/jdk/java/time/test/java/time/format/TestNumberPrinter.java index dedcc37e2ce..59038df910f 100644 --- a/test/jdk/java/time/test/java/time/format/TestNumberPrinter.java +++ b/test/jdk/java/time/test/java/time/format/TestNumberPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -61,37 +61,42 @@ package test.java.time.format; import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static java.time.temporal.ChronoField.HOUR_OF_DAY; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.time.DateTimeException; import java.time.LocalDate; import java.time.format.SignStyle; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import test.java.time.temporal.MockFieldValue; /** * Test SimpleNumberPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestNumberPrinter extends AbstractTestPrinterParser { //----------------------------------------------------------------------- - @Test(expectedExceptions=DateTimeException.class) + @Test public void test_print_emptyCalendrical() throws Exception { - getFormatter(DAY_OF_MONTH, 1, 2, SignStyle.NEVER).formatTo(EMPTY_DTA, buf); + Assertions.assertThrows(DateTimeException.class, () -> getFormatter(DAY_OF_MONTH, 1, 2, SignStyle.NEVER).formatTo(EMPTY_DTA, buf)); } + @Test public void test_print_append() throws Exception { buf.append("EXISTING"); getFormatter(DAY_OF_MONTH, 1, 2, SignStyle.NEVER).formatTo(LocalDate.of(2012, 1, 3), buf); - assertEquals(buf.toString(), "EXISTING3"); + assertEquals("EXISTING3", buf.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="Pad") Object[][] provider_pad() { return new Object[][] { {1, 1, -10, null}, @@ -181,72 +186,77 @@ public class TestNumberPrinter extends AbstractTestPrinterParser { }; } - @Test(dataProvider="Pad") + @ParameterizedTest + @MethodSource("provider_pad") public void test_pad_NOT_NEGATIVE(int minPad, int maxPad, long value, String result) throws Exception { try { getFormatter(DAY_OF_MONTH, minPad, maxPad, SignStyle.NOT_NEGATIVE).formatTo(new MockFieldValue(DAY_OF_MONTH, value), buf); if (result == null || value < 0) { fail("Expected exception"); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } catch (DateTimeException ex) { if (result == null || value < 0) { - assertEquals(ex.getMessage().contains(DAY_OF_MONTH.toString()), true); + assertEquals(true, ex.getMessage().contains(DAY_OF_MONTH.toString())); } else { throw ex; } } } - @Test(dataProvider="Pad") + @ParameterizedTest + @MethodSource("provider_pad") public void test_pad_NEVER(int minPad, int maxPad, long value, String result) throws Exception { try { getFormatter(DAY_OF_MONTH, minPad, maxPad, SignStyle.NEVER).formatTo(new MockFieldValue(DAY_OF_MONTH, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } catch (DateTimeException ex) { if (result != null) { throw ex; } - assertEquals(ex.getMessage().contains(DAY_OF_MONTH.toString()), true); + assertEquals(true, ex.getMessage().contains(DAY_OF_MONTH.toString())); } } - @Test(dataProvider="Pad") + @ParameterizedTest + @MethodSource("provider_pad") public void test_pad_NORMAL(int minPad, int maxPad, long value, String result) throws Exception { try { getFormatter(DAY_OF_MONTH, minPad, maxPad, SignStyle.NORMAL).formatTo(new MockFieldValue(DAY_OF_MONTH, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), (value < 0 ? "-" + result : result)); + assertEquals((value < 0 ? "-" + result : result), buf.toString()); } catch (DateTimeException ex) { if (result != null) { throw ex; } - assertEquals(ex.getMessage().contains(DAY_OF_MONTH.toString()), true); + assertEquals(true, ex.getMessage().contains(DAY_OF_MONTH.toString())); } } - @Test(dataProvider="Pad") + @ParameterizedTest + @MethodSource("provider_pad") public void test_pad_ALWAYS(int minPad, int maxPad, long value, String result) throws Exception { try { getFormatter(DAY_OF_MONTH, minPad, maxPad, SignStyle.ALWAYS).formatTo(new MockFieldValue(DAY_OF_MONTH, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), (value < 0 ? "-" + result : "+" + result)); + assertEquals((value < 0 ? "-" + result : "+" + result), buf.toString()); } catch (DateTimeException ex) { if (result != null) { throw ex; } - assertEquals(ex.getMessage().contains(DAY_OF_MONTH.toString()), true); + assertEquals(true, ex.getMessage().contains(DAY_OF_MONTH.toString())); } } - @Test(dataProvider="Pad") + @ParameterizedTest + @MethodSource("provider_pad") public void test_pad_EXCEEDS_PAD(int minPad, int maxPad, long value, String result) throws Exception { try { getFormatter(DAY_OF_MONTH, minPad, maxPad, SignStyle.EXCEEDS_PAD).formatTo(new MockFieldValue(DAY_OF_MONTH, value), buf); @@ -257,26 +267,29 @@ public class TestNumberPrinter extends AbstractTestPrinterParser { if (result.length() > minPad || value < 0) { result = (value < 0 ? "-" + result : "+" + result); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } catch (DateTimeException ex) { if (result != null) { throw ex; } - assertEquals(ex.getMessage().contains(DAY_OF_MONTH.toString()), true); + assertEquals(true, ex.getMessage().contains(DAY_OF_MONTH.toString())); } } //----------------------------------------------------------------------- + @Test public void test_toString1() throws Exception { - assertEquals(getFormatter(HOUR_OF_DAY, 1, 19, SignStyle.NORMAL).toString(), "Value(HourOfDay)"); + assertEquals("Value(HourOfDay)", getFormatter(HOUR_OF_DAY, 1, 19, SignStyle.NORMAL).toString()); } + @Test public void test_toString2() throws Exception { - assertEquals(getFormatter(HOUR_OF_DAY, 2, 2, SignStyle.NOT_NEGATIVE).toString(), "Value(HourOfDay,2)"); + assertEquals("Value(HourOfDay,2)", getFormatter(HOUR_OF_DAY, 2, 2, SignStyle.NOT_NEGATIVE).toString()); } + @Test public void test_toString3() throws Exception { - assertEquals(getFormatter(HOUR_OF_DAY, 1, 2, SignStyle.NOT_NEGATIVE).toString(), "Value(HourOfDay,1,2,NOT_NEGATIVE)"); + assertEquals("Value(HourOfDay,1,2,NOT_NEGATIVE)", getFormatter(HOUR_OF_DAY, 1, 2, SignStyle.NOT_NEGATIVE).toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestPadPrinterDecorator.java b/test/jdk/java/time/test/java/time/format/TestPadPrinterDecorator.java index adb7677556a..48721e470c3 100644 --- a/test/jdk/java/time/test/java/time/format/TestPadPrinterDecorator.java +++ b/test/jdk/java/time/test/java/time/format/TestPadPrinterDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,79 +59,90 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DateTimeException; import java.time.LocalDate; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Test PadPrinterDecorator. */ -@Test public class TestPadPrinterDecorator extends AbstractTestPrinterParser { //----------------------------------------------------------------------- + @Test public void test_print_emptyCalendrical() throws Exception { builder.padNext(3, '-').appendLiteral('Z'); getFormatter().formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "--Z"); + assertEquals("--Z", buf.toString()); } + @Test public void test_print_fullDateTime() throws Exception { builder.padNext(3, '-').appendLiteral('Z'); getFormatter().formatTo(LocalDate.of(2008, 12, 3), buf); - assertEquals(buf.toString(), "--Z"); + assertEquals("--Z", buf.toString()); } + @Test public void test_print_append() throws Exception { buf.append("EXISTING"); builder.padNext(3, '-').appendLiteral('Z'); getFormatter().formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "EXISTING--Z"); + assertEquals("EXISTING--Z", buf.toString()); } //----------------------------------------------------------------------- + @Test public void test_print_noPadRequiredSingle() throws Exception { builder.padNext(1, '-').appendLiteral('Z'); getFormatter().formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "Z"); + assertEquals("Z", buf.toString()); } + @Test public void test_print_padRequiredSingle() throws Exception { builder.padNext(5, '-').appendLiteral('Z'); getFormatter().formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "----Z"); + assertEquals("----Z", buf.toString()); } + @Test public void test_print_noPadRequiredMultiple() throws Exception { builder.padNext(4, '-').appendLiteral("WXYZ"); getFormatter().formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "WXYZ"); + assertEquals("WXYZ", buf.toString()); } + @Test public void test_print_padRequiredMultiple() throws Exception { builder.padNext(5, '-').appendLiteral("WXYZ"); getFormatter().formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "-WXYZ"); + assertEquals("-WXYZ", buf.toString()); } - @Test(expectedExceptions=DateTimeException.class) + @Test public void test_print_overPad() throws Exception { - builder.padNext(3, '-').appendLiteral("WXYZ"); - getFormatter().formatTo(EMPTY_DTA, buf); + Assertions.assertThrows(DateTimeException.class, () -> { + builder.padNext(3, '-').appendLiteral("WXYZ"); + getFormatter().formatTo(EMPTY_DTA, buf); + }); } //----------------------------------------------------------------------- + @Test public void test_toString1() throws Exception { builder.padNext(5, ' ').appendLiteral('Y'); - assertEquals(getFormatter().toString(), "Pad('Y',5)"); + assertEquals("Pad('Y',5)", getFormatter().toString()); } + @Test public void test_toString2() throws Exception { builder.padNext(5, '-').appendLiteral('Y'); - assertEquals(getFormatter().toString(), "Pad('Y',5,'-')"); + assertEquals("Pad('Y',5,'-')", getFormatter().toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestReducedParser.java b/test/jdk/java/time/test/java/time/format/TestReducedParser.java index 3bf806563e8..2d9df7c11da 100644 --- a/test/jdk/java/time/test/java/time/format/TestReducedParser.java +++ b/test/jdk/java/time/test/java/time/format/TestReducedParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -65,9 +65,10 @@ import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.ChronoField.YEAR; import static java.time.temporal.ChronoField.YEAR_OF_ERA; import static java.time.temporal.ChronoUnit.YEARS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.assertNotNull; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.text.ParsePosition; import java.time.LocalDate; @@ -85,13 +86,15 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; import java.time.temporal.TemporalQueries; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test ReducedPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestReducedParser extends AbstractTestPrinterParser { private static final boolean STRICT = true; private static final boolean LENIENT = false; @@ -109,7 +112,6 @@ public class TestReducedParser extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- - @DataProvider(name="error") Object[][] data_error() { return new Object[][] { {YEAR, 2, 2010, "12", -1, IndexOutOfBoundsException.class}, @@ -117,7 +119,8 @@ public class TestReducedParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="error") + @ParameterizedTest + @MethodSource("data_error") public void test_parse_error(TemporalField field, int width, int baseValue, String text, int pos, Class expected) { try { getFormatter0(field, width, baseValue).parseUnresolved(text, new ParsePosition(pos)); @@ -127,10 +130,11 @@ public class TestReducedParser extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- + @Test public void test_parse_fieldRangeIgnored() throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter0(DAY_OF_YEAR, 3, 10).parseUnresolved("456", pos); - assertEquals(pos.getIndex(), 3); + assertEquals(3, pos.getIndex()); assertParsed(parsed, DAY_OF_YEAR, 456L); // parsed dayOfYear=456 } @@ -138,7 +142,6 @@ public class TestReducedParser extends AbstractTestPrinterParser { // Parse data and values that are consistent whether strict or lenient // The data is the ChronoField, width, baseValue, text, startPos, endPos, value //----------------------------------------------------------------------- - @DataProvider(name="ParseAll") Object[][] provider_parseAll() { return new Object[][] { // negative zero @@ -182,30 +185,32 @@ public class TestReducedParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="ParseAll") + @ParameterizedTest + @MethodSource("provider_parseAll") public void test_parseAllStrict(TemporalField field, int width, int baseValue, String input, int pos, int parseLen, Integer parseVal) { ParsePosition ppos = new ParsePosition(pos); setStrict(true); TemporalAccessor parsed = getFormatter0(field, width, baseValue).parseUnresolved(input, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), parseLen, "error case parse position"); - assertEquals(parsed, parseVal, "unexpected parse result"); + assertEquals(parseLen, ppos.getErrorIndex(), "error case parse position"); + assertEquals(parseVal, parsed, "unexpected parse result"); } else { - assertEquals(ppos.getIndex(), parseLen, "parse position"); + assertEquals(parseLen, ppos.getIndex(), "parse position"); assertParsed(parsed, YEAR, parseVal != null ? (long) parseVal : null); } } - @Test(dataProvider="ParseAll") + @ParameterizedTest + @MethodSource("provider_parseAll") public void test_parseAllLenient(TemporalField field, int width, int baseValue, String input, int pos, int parseLen, Integer parseVal) { ParsePosition ppos = new ParsePosition(pos); setStrict(false); TemporalAccessor parsed = getFormatter0(field, width, baseValue).parseUnresolved(input, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), parseLen, "error case parse position"); - assertEquals(parsed, parseVal, "unexpected parse result"); + assertEquals(parseLen, ppos.getErrorIndex(), "error case parse position"); + assertEquals(parseVal, parsed, "unexpected parse result"); } else { - assertEquals(ppos.getIndex(), parseLen, "parse position"); + assertEquals(parseLen, ppos.getIndex(), "parse position"); assertParsed(parsed, YEAR, parseVal != null ? (long) parseVal : null); } } @@ -215,7 +220,6 @@ public class TestReducedParser extends AbstractTestPrinterParser { // The data is the ChronoField, minWidth, maxWidth, baseValue, text, startPos, // Strict Pair(endPos, value), Lenient Pair(endPos, value) //----------------------------------------------------------------------- - @DataProvider(name="ParseLenientSensitive") Object[][] provider_parseLenientSensitive() { return new Object[][] { // few digits supplied @@ -268,32 +272,34 @@ public class TestReducedParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- // Parsing tests for strict mode //----------------------------------------------------------------------- - @Test(dataProvider="ParseLenientSensitive") + @ParameterizedTest + @MethodSource("provider_parseLenientSensitive") public void test_parseStrict(TemporalField field, int minWidth, int maxWidth, int baseValue, String input, int pos, Pair strict, Pair lenient) { ParsePosition ppos = new ParsePosition(pos); setStrict(true); TemporalAccessor parsed = getFormatter0(field, minWidth, maxWidth, baseValue).parseUnresolved(input, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), strict.parseLen, "error case parse position"); - assertEquals(parsed, strict.parseVal, "unexpected parse result"); + assertEquals(strict.parseLen, ppos.getErrorIndex(), "error case parse position"); + assertEquals(strict.parseVal, parsed, "unexpected parse result"); } else { - assertEquals(ppos.getIndex(), strict.parseLen, "parse position"); + assertEquals(strict.parseLen, ppos.getIndex(), "parse position"); assertParsed(parsed, YEAR, strict.parseVal != null ? (long) strict.parseVal : null); } } - @Test(dataProvider="ParseLenientSensitive") + @ParameterizedTest + @MethodSource("provider_parseLenientSensitive") public void test_parseStrict_baseDate(TemporalField field, int minWidth, int maxWidth, int baseValue, String input, int pos, Pair strict, Pair lenient) { ParsePosition ppos = new ParsePosition(pos); setStrict(true); TemporalAccessor parsed = getFormatterBaseDate(field, minWidth, maxWidth, baseValue).parseUnresolved(input, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), strict.parseLen, "error case parse position"); - assertEquals(parsed, strict.parseVal, "unexpected parse result"); + assertEquals(strict.parseLen, ppos.getErrorIndex(), "error case parse position"); + assertEquals(strict.parseVal, parsed, "unexpected parse result"); } else { - assertEquals(ppos.getIndex(), strict.parseLen, "parse position"); + assertEquals(strict.parseLen, ppos.getIndex(), "parse position"); assertParsed(parsed, YEAR, strict.parseVal != null ? (long) strict.parseVal : null); } } @@ -301,42 +307,44 @@ public class TestReducedParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- // Parsing tests for lenient mode //----------------------------------------------------------------------- - @Test(dataProvider="ParseLenientSensitive") + @ParameterizedTest + @MethodSource("provider_parseLenientSensitive") public void test_parseLenient(TemporalField field, int minWidth, int maxWidth, int baseValue, String input, int pos, Pair strict, Pair lenient) { ParsePosition ppos = new ParsePosition(pos); setStrict(false); TemporalAccessor parsed = getFormatter0(field, minWidth, maxWidth, baseValue).parseUnresolved(input, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), lenient.parseLen, "error case parse position"); - assertEquals(parsed, lenient.parseVal, "unexpected parse result"); + assertEquals(lenient.parseLen, ppos.getErrorIndex(), "error case parse position"); + assertEquals(lenient.parseVal, parsed, "unexpected parse result"); } else { - assertEquals(ppos.getIndex(), lenient.parseLen, "parse position"); + assertEquals(lenient.parseLen, ppos.getIndex(), "parse position"); assertParsed(parsed, YEAR, lenient.parseVal != null ? (long) lenient.parseVal : null); } } - @Test(dataProvider="ParseLenientSensitive") + @ParameterizedTest + @MethodSource("provider_parseLenientSensitive") public void test_parseLenient_baseDate(TemporalField field, int minWidth, int maxWidth, int baseValue, String input, int pos, Pair strict, Pair lenient) { ParsePosition ppos = new ParsePosition(pos); setStrict(false); TemporalAccessor parsed = getFormatterBaseDate(field, minWidth, maxWidth, baseValue).parseUnresolved(input, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), lenient.parseLen, "error case parse position"); - assertEquals(parsed, lenient.parseVal, "unexpected parse result"); + assertEquals(lenient.parseLen, ppos.getErrorIndex(), "error case parse position"); + assertEquals(lenient.parseVal, parsed, "unexpected parse result"); } else { - assertEquals(ppos.getIndex(), lenient.parseLen, "parse position"); + assertEquals(lenient.parseLen, ppos.getIndex(), "parse position"); assertParsed(parsed, YEAR, lenient.parseVal != null ? (long) lenient.parseVal : null); } } private void assertParsed(TemporalAccessor parsed, TemporalField field, Long value) { if (value == null) { - assertEquals(parsed, null, "Parsed Value"); + assertEquals(null, parsed, "Parsed Value"); } else { - assertEquals(parsed.isSupported(field), true, "isSupported: " + field); - assertEquals(parsed.getLong(field), (long) value, "Temporal.getLong: " + field); + assertEquals(true, parsed.isSupported(field), "isSupported: " + field); + assertEquals((long) value, parsed.getLong(field), "Temporal.getLong: " + field); } } @@ -344,7 +352,6 @@ public class TestReducedParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- // Cases and values in adjacent parsing mode //----------------------------------------------------------------------- - @DataProvider(name="ParseAdjacent") Object[][] provider_parseAdjacent() { return new Object[][] { // general @@ -363,7 +370,8 @@ public class TestReducedParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="ParseAdjacent") + @ParameterizedTest + @MethodSource("provider_parseAdjacent") public void test_parseAdjacent(String pattern, String input, boolean strict, int pos, int parseLen, int year, int month, int day) { ParsePosition ppos = new ParsePosition(0); builder = new DateTimeFormatterBuilder(); @@ -374,9 +382,9 @@ public class TestReducedParser extends AbstractTestPrinterParser { TemporalAccessor parsed = dtf.parseUnresolved(input, ppos); assertNotNull(parsed, String.format("parse failed: ppos: %s, formatter: %s%n", ppos.toString(), dtf)); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getErrorIndex(), parseLen, "error case parse position"); + assertEquals(parseLen, ppos.getErrorIndex(), "error case parse position"); } else { - assertEquals(ppos.getIndex(), parseLen, "parse position"); + assertEquals(parseLen, ppos.getIndex(), "parse position"); assertParsed(parsed, YEAR_OF_ERA, Long.valueOf(year)); assertParsed(parsed, MONTH_OF_YEAR, Long.valueOf(month)); assertParsed(parsed, DAY_OF_MONTH, Long.valueOf(day)); @@ -386,7 +394,6 @@ public class TestReducedParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- // Cases and values in reduced value parsing mode //----------------------------------------------------------------------- - @DataProvider(name="ReducedWithChrono") Object[][] provider_reducedWithChrono() { LocalDate baseYear = LocalDate.of(2000, 1, 1); return new Object[][] { @@ -408,7 +415,8 @@ public class TestReducedParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="ReducedWithChrono") + @ParameterizedTest + @MethodSource("provider_reducedWithChrono") public void test_reducedWithChronoYear(ChronoLocalDate date) { Chronology chrono = date.getChronology(); DateTimeFormatter df @@ -421,12 +429,13 @@ public class TestReducedParser extends AbstractTestPrinterParser { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = df.parseUnresolved(input, pos); int actual = parsed.get(YEAR); - assertEquals(actual, expected, + assertEquals(expected, actual, String.format("Wrong date parsed, chrono: %s, input: %s", chrono, input)); } - @Test(dataProvider="ReducedWithChrono") + @ParameterizedTest + @MethodSource("provider_reducedWithChrono") public void test_reducedWithChronoYearOfEra(ChronoLocalDate date) { Chronology chrono = date.getChronology(); DateTimeFormatter df @@ -439,7 +448,7 @@ public class TestReducedParser extends AbstractTestPrinterParser { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = df.parseUnresolved(input, pos); int actual = parsed.get(YEAR_OF_ERA); - assertEquals(actual, expected, + assertEquals(expected, actual, String.format("Wrong date parsed, chrono: %s, input: %s", chrono, input)); @@ -459,10 +468,10 @@ public class TestReducedParser extends AbstractTestPrinterParser { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = df.parseUnresolved(input, pos); - assertEquals(pos.getIndex(), input.length(), "Input not parsed completely"); - assertEquals(pos.getErrorIndex(), -1, "Error index should be -1 (no-error)"); + assertEquals(input.length(), pos.getIndex(), "Input not parsed completely"); + assertEquals(-1, pos.getErrorIndex(), "Error index should be -1 (no-error)"); int actual = parsed.get(YEAR); - assertEquals(actual, expected, + assertEquals(expected, actual, String.format("Wrong date parsed, chrono: %s, input: %s", parsed.query(TemporalQueries.chronology()), input)); @@ -482,10 +491,10 @@ public class TestReducedParser extends AbstractTestPrinterParser { String input = "44 ThaiBuddhist ISO"; ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = df.parseUnresolved(input, pos); - assertEquals(pos.getIndex(), input.length(), "Input not parsed completely: " + pos); - assertEquals(pos.getErrorIndex(), -1, "Error index should be -1 (no-error)"); + assertEquals(input.length(), pos.getIndex(), "Input not parsed completely: " + pos); + assertEquals(-1, pos.getErrorIndex(), "Error index should be -1 (no-error)"); int actual = parsed.get(YEAR); - assertEquals(actual, expected, + assertEquals(expected, actual, String.format("Wrong date parsed, chrono: %s, input: %s", parsed.query(TemporalQueries.chronology()), input)); diff --git a/test/jdk/java/time/test/java/time/format/TestReducedPrinter.java b/test/jdk/java/time/test/java/time/format/TestReducedPrinter.java index c4b6cf4dc39..94c45662666 100644 --- a/test/jdk/java/time/test/java/time/format/TestReducedPrinter.java +++ b/test/jdk/java/time/test/java/time/format/TestReducedPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -60,8 +60,9 @@ package test.java.time.format; import static java.time.temporal.ChronoField.YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.time.DateTimeException; import java.time.LocalDate; @@ -70,14 +71,18 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.TemporalField; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import test.java.time.temporal.MockFieldValue; /** * Test ReducedPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestReducedPrinter extends AbstractTestPrinterParser { private DateTimeFormatter getFormatter0(TemporalField field, int width, int baseValue) { @@ -93,20 +98,20 @@ public class TestReducedPrinter extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- - @Test(expectedExceptions=DateTimeException.class) + @Test public void test_print_emptyCalendrical() throws Exception { - getFormatter0(YEAR, 2, 2010).formatTo(EMPTY_DTA, buf); + Assertions.assertThrows(DateTimeException.class, () -> getFormatter0(YEAR, 2, 2010).formatTo(EMPTY_DTA, buf)); } //----------------------------------------------------------------------- + @Test public void test_print_append() throws Exception { buf.append("EXISTING"); getFormatter0(YEAR, 2, 2010).formatTo(LocalDate.of(2012, 1, 1), buf); - assertEquals(buf.toString(), "EXISTING12"); + assertEquals("EXISTING12", buf.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="Pivot") Object[][] provider_pivot() { return new Object[][] { {1, 1, 2010, 2010, "0"}, @@ -175,34 +180,36 @@ public class TestReducedPrinter extends AbstractTestPrinterParser { }; } - @Test(dataProvider="Pivot") + @ParameterizedTest + @MethodSource("provider_pivot") public void test_pivot(int minWidth, int maxWidth, int baseValue, int value, String result) throws Exception { try { getFormatter0(YEAR, minWidth, maxWidth, baseValue).formatTo(new MockFieldValue(YEAR, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } catch (DateTimeException ex) { if (result == null || value < 0) { - assertEquals(ex.getMessage().contains(YEAR.toString()), true); + assertEquals(true, ex.getMessage().contains(YEAR.toString())); } else { throw ex; } } } - @Test(dataProvider="Pivot") + @ParameterizedTest + @MethodSource("provider_pivot") public void test_pivot_baseDate(int minWidth, int maxWidth, int baseValue, int value, String result) throws Exception { try { getFormatterBaseDate(YEAR, minWidth, maxWidth, baseValue).formatTo(new MockFieldValue(YEAR, value), buf); if (result == null) { fail("Expected exception"); } - assertEquals(buf.toString(), result); + assertEquals(result, buf.toString()); } catch (DateTimeException ex) { if (result == null || value < 0) { - assertEquals(ex.getMessage().contains(YEAR.toString()), true); + assertEquals(true, ex.getMessage().contains(YEAR.toString())); } else { throw ex; } @@ -210,49 +217,51 @@ public class TestReducedPrinter extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- + @Test public void test_minguoChrono_fixedWidth() throws Exception { // ISO 2021 is Minguo 110 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 2, 2021); MinguoDate date = MinguoDate.of(109, 6, 30); - assertEquals(f.format(date), "09"); + assertEquals("09", f.format(date)); date = MinguoDate.of(110, 6, 30); - assertEquals(f.format(date), "10"); + assertEquals("10", f.format(date)); date = MinguoDate.of(199, 6, 30); - assertEquals(f.format(date), "99"); + assertEquals("99", f.format(date)); date = MinguoDate.of(200, 6, 30); - assertEquals(f.format(date), "00"); + assertEquals("00", f.format(date)); date = MinguoDate.of(209, 6, 30); - assertEquals(f.format(date), "09"); + assertEquals("09", f.format(date)); date = MinguoDate.of(210, 6, 30); - assertEquals(f.format(date), "10"); + assertEquals("10", f.format(date)); } + @Test public void test_minguoChrono_extendedWidth() throws Exception { // ISO 2021 is Minguo 110 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 4, 2021); MinguoDate date = MinguoDate.of(109, 6, 30); - assertEquals(f.format(date), "109"); + assertEquals("109", f.format(date)); date = MinguoDate.of(110, 6, 30); - assertEquals(f.format(date), "10"); + assertEquals("10", f.format(date)); date = MinguoDate.of(199, 6, 30); - assertEquals(f.format(date), "99"); + assertEquals("99", f.format(date)); date = MinguoDate.of(200, 6, 30); - assertEquals(f.format(date), "00"); + assertEquals("00", f.format(date)); date = MinguoDate.of(209, 6, 30); - assertEquals(f.format(date), "09"); + assertEquals("09", f.format(date)); date = MinguoDate.of(210, 6, 30); - assertEquals(f.format(date), "210"); + assertEquals("210", f.format(date)); } //----------------------------------------------------------------------- + @Test public void test_toString() throws Exception { - assertEquals(getFormatter0(YEAR, 2, 2, 2005).toString(), "ReducedValue(Year,2,2,2005)"); + assertEquals("ReducedValue(Year,2,2,2005)", getFormatter0(YEAR, 2, 2, 2005).toString()); } //----------------------------------------------------------------------- // Cases and values in adjacent parsing mode //----------------------------------------------------------------------- - @DataProvider(name="PrintAdjacent") Object[][] provider_printAdjacent() { return new Object[][] { // general @@ -265,7 +274,8 @@ public class TestReducedPrinter extends AbstractTestPrinterParser { }; } - @Test(dataProvider="PrintAdjacent") + @ParameterizedTest + @MethodSource("provider_printAdjacent") public void test_printAdjacent(String pattern, String text, int year, int month, int day) { builder = new DateTimeFormatterBuilder(); builder.appendPattern(pattern); @@ -273,7 +283,7 @@ public class TestReducedPrinter extends AbstractTestPrinterParser { LocalDate ld = LocalDate.of(year, month, day); String actual = dtf.format(ld); - assertEquals(actual, text, "formatter output: " + dtf); + assertEquals(text, actual, "formatter output: " + dtf); } } diff --git a/test/jdk/java/time/test/java/time/format/TestSettingsParser.java b/test/jdk/java/time/test/java/time/format/TestSettingsParser.java index ce7b2d7f187..1f71a37a007 100644 --- a/test/jdk/java/time/test/java/time/format/TestSettingsParser.java +++ b/test/jdk/java/time/test/java/time/format/TestSettingsParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,29 +59,30 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.text.ParsePosition; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test SettingsParser. */ -@Test public class TestSettingsParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- + @Test public void test_print_sensitive() throws Exception { setCaseSensitive(true); getFormatter().formatTo(dta, buf); - assertEquals(buf.toString(), ""); + assertEquals("", buf.toString()); } + @Test public void test_print_strict() throws Exception { setStrict(true); getFormatter().formatTo(dta, buf); - assertEquals(buf.toString(), ""); + assertEquals("", buf.toString()); } /* @@ -92,53 +93,61 @@ public class TestSettingsParser extends AbstractTestPrinterParser { */ //----------------------------------------------------------------------- + @Test public void test_parse_changeStyle_sensitive() throws Exception { setCaseSensitive(true); ParsePosition pos = new ParsePosition(0); getFormatter().parseUnresolved("a", pos); - assertEquals(pos.getIndex(), 0); + assertEquals(0, pos.getIndex()); } + @Test public void test_parse_changeStyle_insensitive() throws Exception { setCaseSensitive(false); ParsePosition pos = new ParsePosition(0); getFormatter().parseUnresolved("a", pos); - assertEquals(pos.getIndex(), 0); + assertEquals(0, pos.getIndex()); } + @Test public void test_parse_changeStyle_strict() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); getFormatter().parseUnresolved("a", pos); - assertEquals(pos.getIndex(), 0); + assertEquals(0, pos.getIndex()); } + @Test public void test_parse_changeStyle_lenient() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); getFormatter().parseUnresolved("a", pos); - assertEquals(pos.getIndex(), 0); + assertEquals(0, pos.getIndex()); } //----------------------------------------------------------------------- + @Test public void test_toString_sensitive() throws Exception { setCaseSensitive(true); - assertEquals(getFormatter().toString(), "ParseCaseSensitive(true)"); + assertEquals("ParseCaseSensitive(true)", getFormatter().toString()); } + @Test public void test_toString_insensitive() throws Exception { setCaseSensitive(false); - assertEquals(getFormatter().toString(), "ParseCaseSensitive(false)"); + assertEquals("ParseCaseSensitive(false)", getFormatter().toString()); } + @Test public void test_toString_strict() throws Exception { setStrict(true); - assertEquals(getFormatter().toString(), "ParseStrict(true)"); + assertEquals("ParseStrict(true)", getFormatter().toString()); } + @Test public void test_toString_lenient() throws Exception { setStrict(false); - assertEquals(getFormatter().toString(), "ParseStrict(false)"); + assertEquals("ParseStrict(false)", getFormatter().toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestStringLiteralParser.java b/test/jdk/java/time/test/java/time/format/TestStringLiteralParser.java index f8f5147f921..c442621ce34 100644 --- a/test/jdk/java/time/test/java/time/format/TestStringLiteralParser.java +++ b/test/jdk/java/time/test/java/time/format/TestStringLiteralParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -60,24 +60,25 @@ package test.java.time.format; import static java.time.temporal.ChronoField.YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.text.ParsePosition; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test StringLiteralPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestStringLiteralParser extends AbstractTestPrinterParser { - @DataProvider(name="success") Object[][] data_success() { return new Object[][] { // match @@ -104,23 +105,23 @@ public class TestStringLiteralParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="success") + @ParameterizedTest + @MethodSource("data_success") public void test_parse_success(String s, boolean caseSensitive, String text, int pos, int expectedPos) { setCaseSensitive(caseSensitive); ParsePosition ppos = new ParsePosition(pos); TemporalAccessor parsed = getFormatter(s).parseUnresolved(text, ppos); if (ppos.getErrorIndex() != -1) { - assertEquals(ppos.getIndex(), expectedPos); + assertEquals(expectedPos, ppos.getIndex()); } else { - assertEquals(ppos.getIndex(), expectedPos); - assertEquals(parsed.isSupported(YEAR), false); - assertEquals(parsed.query(TemporalQueries.chronology()), null); - assertEquals(parsed.query(TemporalQueries.zoneId()), null); + assertEquals(expectedPos, ppos.getIndex()); + assertEquals(false, parsed.isSupported(YEAR)); + assertEquals(null, parsed.query(TemporalQueries.chronology())); + assertEquals(null, parsed.query(TemporalQueries.zoneId())); } } //----------------------------------------------------------------------- - @DataProvider(name="error") Object[][] data_error() { return new Object[][] { {"hello", "hello", -1, IndexOutOfBoundsException.class}, @@ -128,7 +129,8 @@ public class TestStringLiteralParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="error") + @ParameterizedTest + @MethodSource("data_error") public void test_parse_error(String s, String text, int pos, Class expected) { try { ParsePosition ppos = new ParsePosition(pos); diff --git a/test/jdk/java/time/test/java/time/format/TestStringLiteralPrinter.java b/test/jdk/java/time/test/java/time/format/TestStringLiteralPrinter.java index 6733af164a4..ed8717d8bdb 100644 --- a/test/jdk/java/time/test/java/time/format/TestStringLiteralPrinter.java +++ b/test/jdk/java/time/test/java/time/format/TestStringLiteralPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,44 +59,47 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; - -import org.testng.annotations.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; /** * Test StringLiteralPrinterParser. */ -@Test public class TestStringLiteralPrinter extends AbstractTestPrinterParser { //----------------------------------------------------------------------- + @Test public void test_print_emptyCalendrical() throws Exception { buf.append("EXISTING"); getFormatter("hello").formatTo(EMPTY_DTA, buf); - assertEquals(buf.toString(), "EXISTINGhello"); + assertEquals("EXISTINGhello", buf.toString()); } + @Test public void test_print_dateTime() throws Exception { buf.append("EXISTING"); getFormatter("hello").formatTo(dta, buf); - assertEquals(buf.toString(), "EXISTINGhello"); + assertEquals("EXISTINGhello", buf.toString()); } + @Test public void test_print_emptyAppendable() throws Exception { getFormatter("hello").formatTo(dta, buf); - assertEquals(buf.toString(), "hello"); + assertEquals("hello", buf.toString()); } //----------------------------------------------------------------------- + @Test public void test_toString() throws Exception { - assertEquals(getFormatter("hello").toString(), "'hello'"); + assertEquals("'hello'", getFormatter("hello").toString()); } + @Test public void test_toString_apos() throws Exception { - assertEquals(getFormatter("o'clock").toString(), "'o''clock'"); + assertEquals("'o''clock'", getFormatter("o'clock").toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestTextParser.java b/test/jdk/java/time/test/java/time/format/TestTextParser.java index b6126a6b407..2482cbc5a6e 100644 --- a/test/jdk/java/time/test/java/time/format/TestTextParser.java +++ b/test/jdk/java/time/test/java/time/format/TestTextParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -63,8 +63,9 @@ import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.IsoFields.QUARTER_OF_YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.text.ParsePosition; import java.time.DayOfWeek; @@ -77,17 +78,18 @@ import java.time.temporal.TemporalQueries; import java.time.temporal.ChronoField; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test TextPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestTextParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- - @DataProvider(name="error") Object[][] data_error() { return new Object[][] { {DAY_OF_WEEK, TextStyle.FULL, "Monday", -1, IndexOutOfBoundsException.class}, @@ -95,7 +97,8 @@ public class TestTextParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="error") + @ParameterizedTest + @MethodSource("data_error") public void test_parse_error(TemporalField field, TextStyle style, String text, int pos, Class expected) { try { getFormatter(field, style).parseUnresolved(text, new ParsePosition(pos)); @@ -105,49 +108,53 @@ public class TestTextParser extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- + @Test public void test_parse_midStr() throws Exception { ParsePosition pos = new ParsePosition(3); - assertEquals(getFormatter(DAY_OF_WEEK, TextStyle.FULL) - .parseUnresolved("XxxMondayXxx", pos) - .getLong(DAY_OF_WEEK), 1L); - assertEquals(pos.getIndex(), 9); + assertEquals(1L, getFormatter(DAY_OF_WEEK, TextStyle.FULL) + .parseUnresolved("XxxMondayXxx", pos) + .getLong(DAY_OF_WEEK)); + assertEquals(9, pos.getIndex()); } + @Test public void test_parse_remainderIgnored() throws Exception { ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(DAY_OF_WEEK, TextStyle.SHORT) - .parseUnresolved("Wednesday", pos) - .getLong(DAY_OF_WEEK), 3L); - assertEquals(pos.getIndex(), 3); + assertEquals(3L, getFormatter(DAY_OF_WEEK, TextStyle.SHORT) + .parseUnresolved("Wednesday", pos) + .getLong(DAY_OF_WEEK)); + assertEquals(3, pos.getIndex()); } //----------------------------------------------------------------------- + @Test public void test_parse_noMatch1() throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(DAY_OF_WEEK, TextStyle.FULL).parseUnresolved("Munday", pos); - assertEquals(pos.getErrorIndex(), 0); - assertEquals(parsed, null); + assertEquals(0, pos.getErrorIndex()); + assertEquals(null, parsed); } + @Test public void test_parse_noMatch2() throws Exception { ParsePosition pos = new ParsePosition(3); TemporalAccessor parsed = getFormatter(DAY_OF_WEEK, TextStyle.FULL).parseUnresolved("Monday", pos); - assertEquals(pos.getErrorIndex(), 3); - assertEquals(parsed, null); + assertEquals(3, pos.getErrorIndex()); + assertEquals(null, parsed); } + @Test public void test_parse_noMatch_atEnd() throws Exception { ParsePosition pos = new ParsePosition(6); TemporalAccessor parsed = getFormatter(DAY_OF_WEEK, TextStyle.FULL).parseUnresolved("Monday", pos); - assertEquals(pos.getErrorIndex(), 6); - assertEquals(parsed, null); + assertEquals(6, pos.getErrorIndex()); + assertEquals(null, parsed); } //----------------------------------------------------------------------- - @DataProvider(name="parseText") Object[][] provider_text() { return new Object[][] { {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"}, @@ -189,7 +196,6 @@ public class TestTextParser extends AbstractTestPrinterParser { }; } - @DataProvider(name="parseNumber") Object[][] provider_number() { return new Object[][] { {DAY_OF_MONTH, TextStyle.FULL, 1, "1"}, @@ -204,7 +210,6 @@ public class TestTextParser extends AbstractTestPrinterParser { }; } - @DataProvider(name="parseDayOfWeekText") Object[][] providerDayOfWeekData() { return new Object[][] { // Locale, pattern, input text, expected DayOfWeek @@ -215,30 +220,34 @@ public class TestTextParser extends AbstractTestPrinterParser { } - @Test(dataProvider="parseText") + @ParameterizedTest + @MethodSource("provider_text") public void test_parseText(TemporalField field, TextStyle style, int value, String input) throws Exception { ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(field, style).parseUnresolved(input, pos).getLong(field), (long) value); - assertEquals(pos.getIndex(), input.length()); + assertEquals((long) value, getFormatter(field, style).parseUnresolved(input, pos).getLong(field)); + assertEquals(input.length(), pos.getIndex()); } - @Test(dataProvider="parseNumber") + @ParameterizedTest + @MethodSource("provider_number") public void test_parseNumber(TemporalField field, TextStyle style, int value, String input) throws Exception { ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(field, style).parseUnresolved(input, pos).getLong(field), (long) value); - assertEquals(pos.getIndex(), input.length()); + assertEquals((long) value, getFormatter(field, style).parseUnresolved(input, pos).getLong(field)); + assertEquals(input.length(), pos.getIndex()); } - @Test(dataProvider="parseDayOfWeekText") + @ParameterizedTest + @MethodSource("providerDayOfWeekData") public void test_parseDayOfWeekText(Locale locale, String pattern, String input, DayOfWeek expected) { DateTimeFormatter formatter = getPatternFormatter(pattern).withLocale(locale); ParsePosition pos = new ParsePosition(0); - assertEquals(DayOfWeek.from(formatter.parse(input, pos)), expected); - assertEquals(pos.getIndex(), input.length()); + assertEquals(expected, DayOfWeek.from(formatter.parse(input, pos))); + assertEquals(input.length(), pos.getIndex()); } //----------------------------------------------------------------------- - @Test(dataProvider="parseText") + @ParameterizedTest + @MethodSource("provider_text") public void test_parse_strict_caseSensitive_parseUpper(TemporalField field, TextStyle style, int value, String input) throws Exception { if (input.equals(input.toUpperCase(Locale.ROOT))) { // Skip if the given input is all upper case (e.g., "Q1") @@ -247,19 +256,21 @@ public class TestTextParser extends AbstractTestPrinterParser { setCaseSensitive(true); ParsePosition pos = new ParsePosition(0); getFormatter(field, style).parseUnresolved(input.toUpperCase(Locale.ROOT), pos); - assertEquals(pos.getErrorIndex(), 0); + assertEquals(0, pos.getErrorIndex()); } - @Test(dataProvider="parseText") + @ParameterizedTest + @MethodSource("provider_text") public void test_parse_strict_caseInsensitive_parseUpper(TemporalField field, TextStyle style, int value, String input) throws Exception { setCaseSensitive(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(field, style).parseUnresolved(input.toUpperCase(Locale.ROOT), pos).getLong(field), (long) value); - assertEquals(pos.getIndex(), input.length()); + assertEquals((long) value, getFormatter(field, style).parseUnresolved(input.toUpperCase(Locale.ROOT), pos).getLong(field)); + assertEquals(input.length(), pos.getIndex()); } //----------------------------------------------------------------------- - @Test(dataProvider="parseText") + @ParameterizedTest + @MethodSource("provider_text") public void test_parse_strict_caseSensitive_parseLower(TemporalField field, TextStyle style, int value, String input) throws Exception { if (input.equals(input.toLowerCase(Locale.ROOT))) { // Skip if the given input is all lower case (e.g., "1st quarter") @@ -268,105 +279,118 @@ public class TestTextParser extends AbstractTestPrinterParser { setCaseSensitive(true); ParsePosition pos = new ParsePosition(0); getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos); - assertEquals(pos.getErrorIndex(), 0); + assertEquals(0, pos.getErrorIndex()); } - @Test(dataProvider="parseText") + @ParameterizedTest + @MethodSource("provider_text") public void test_parse_strict_caseInsensitive_parseLower(TemporalField field, TextStyle style, int value, String input) throws Exception { setCaseSensitive(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos).getLong(field), (long) value); - assertEquals(pos.getIndex(), input.length()); + assertEquals((long) value, getFormatter(field, style).parseUnresolved(input.toLowerCase(Locale.ROOT), pos).getLong(field)); + assertEquals(input.length(), pos.getIndex()); } //----------------------------------------------------------------------- //----------------------------------------------------------------------- //----------------------------------------------------------------------- + @Test public void test_parse_full_strict_full_match() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 7); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR)); + assertEquals(7, pos.getIndex()); } + @Test public void test_parse_full_strict_short_noMatch() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("Janua", pos); - assertEquals(pos.getErrorIndex(), 0); + assertEquals(0, pos.getErrorIndex()); } + @Test public void test_parse_full_strict_number_noMatch() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("1", pos); - assertEquals(pos.getErrorIndex(), 0); + assertEquals(0, pos.getErrorIndex()); } //----------------------------------------------------------------------- + @Test public void test_parse_short_strict_full_match() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 3); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR)); + assertEquals(3, pos.getIndex()); } + @Test public void test_parse_short_strict_short_match() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("Janua", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 3); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("Janua", pos).getLong(MONTH_OF_YEAR)); + assertEquals(3, pos.getIndex()); } + @Test public void test_parse_short_strict_number_noMatch() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("1", pos); - assertEquals(pos.getErrorIndex(), 0); + assertEquals(0, pos.getErrorIndex()); } //----------------------------------------------------------------------- + @Test public void test_parse_full_lenient_full_match() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("January.", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 7); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("January.", pos).getLong(MONTH_OF_YEAR)); + assertEquals(7, pos.getIndex()); } + @Test public void test_parse_full_lenient_short_match() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("Janua", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 3); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("Janua", pos).getLong(MONTH_OF_YEAR)); + assertEquals(3, pos.getIndex()); } + @Test public void test_parse_full_lenient_number_match() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("1", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 1); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.FULL).parseUnresolved("1", pos).getLong(MONTH_OF_YEAR)); + assertEquals(1, pos.getIndex()); } //----------------------------------------------------------------------- + @Test public void test_parse_short_lenient_full_match() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 7); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("January", pos).getLong(MONTH_OF_YEAR)); + assertEquals(7, pos.getIndex()); } + @Test public void test_parse_short_lenient_short_match() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("Janua", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 3); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("Janua", pos).getLong(MONTH_OF_YEAR)); + assertEquals(3, pos.getIndex()); } + @Test public void test_parse_short_lenient_number_match() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("1", pos).getLong(MONTH_OF_YEAR), 1L); - assertEquals(pos.getIndex(), 1); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).parseUnresolved("1", pos).getLong(MONTH_OF_YEAR)); + assertEquals(1, pos.getIndex()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestTextParserWithLocale.java b/test/jdk/java/time/test/java/time/format/TestTextParserWithLocale.java index 371c5180832..35d458d6b45 100644 --- a/test/jdk/java/time/test/java/time/format/TestTextParserWithLocale.java +++ b/test/jdk/java/time/test/java/time/format/TestTextParserWithLocale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -81,24 +81,26 @@ import java.time.temporal.ChronoField; import java.time.temporal.TemporalField; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test TextPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestTextParserWithLocale extends AbstractTestPrinterParser { static final Locale RUSSIAN = Locale.of("ru"); static final Locale FINNISH = Locale.of("fi"); - @DataProvider(name="parseDayOfWeekText") Object[][] providerDayOfWeekData() { return new Object[][] { // Locale, pattern, input text, expected DayOfWeek @@ -112,17 +114,17 @@ public class TestTextParserWithLocale extends AbstractTestPrinterParser { }; } - @Test(dataProvider="parseDayOfWeekText") + @ParameterizedTest + @MethodSource("providerDayOfWeekData") public void test_parseDayOfWeekText(Locale locale, String pattern, String input, DayOfWeek expected) { DateTimeFormatter formatter = getPatternFormatter(pattern).withLocale(locale); ParsePosition pos = new ParsePosition(0); - assertEquals(DayOfWeek.from(formatter.parse(input, pos)), expected); - assertEquals(pos.getIndex(), input.length()); + assertEquals(expected, DayOfWeek.from(formatter.parse(input, pos))); + assertEquals(input.length(), pos.getIndex()); } //-------------------------------------------------------------------- // Test data is dependent on localized resources. - @DataProvider(name="parseStandaloneText") Object[][] providerStandaloneText() { // Locale, TemporalField, TextStyle, expected value, input text return new Object[][] { @@ -136,7 +138,6 @@ public class TestTextParserWithLocale extends AbstractTestPrinterParser { } // Test data is dependent on localized resources. - @DataProvider(name="parseLenientText") Object[][] providerLenientText() { // Locale, TemporalField, expected value, input text return new Object[][] { @@ -147,47 +148,49 @@ public class TestTextParserWithLocale extends AbstractTestPrinterParser { }; } - @Test(dataProvider="parseStandaloneText") + @ParameterizedTest + @MethodSource("providerStandaloneText") public void test_parseStandaloneText(Locale locale, TemporalField field, TextStyle style, int expectedValue, String input) { DateTimeFormatter formatter = getFormatter(field, style).withLocale(locale); ParsePosition pos = new ParsePosition(0); - assertEquals(formatter.parseUnresolved(input, pos).getLong(field), (long) expectedValue); - assertEquals(pos.getIndex(), input.length()); + assertEquals((long) expectedValue, formatter.parseUnresolved(input, pos).getLong(field)); + assertEquals(input.length(), pos.getIndex()); } //----------------------------------------------------------------------- + @Test public void test_parse_french_short_strict_full_noMatch() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).withLocale(Locale.FRENCH) .parseUnresolved("janvier", pos); - assertEquals(pos.getErrorIndex(), 0); + assertEquals(0, pos.getErrorIndex()); } + @Test public void test_parse_french_short_strict_short_match() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).withLocale(Locale.FRENCH) - .parseUnresolved("janv.", pos) - .getLong(MONTH_OF_YEAR), - 1L); - assertEquals(pos.getIndex(), 5); + assertEquals(1L, getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).withLocale(Locale.FRENCH) + .parseUnresolved("janv.", pos) + .getLong(MONTH_OF_YEAR)); + assertEquals(5, pos.getIndex()); } //----------------------------------------------------------------------- - @Test(dataProvider="parseLenientText") + @ParameterizedTest + @MethodSource("providerLenientText") public void test_parseLenientText(Locale locale, TemporalField field, int expectedValue, String input) { setStrict(false); ParsePosition pos = new ParsePosition(0); DateTimeFormatter formatter = getFormatter(field).withLocale(locale); - assertEquals(formatter.parseUnresolved(input, pos).getLong(field), (long) expectedValue); - assertEquals(pos.getIndex(), input.length()); + assertEquals((long) expectedValue, formatter.parseUnresolved(input, pos).getLong(field)); + assertEquals(input.length(), pos.getIndex()); } //----------------------------------------------------------------------- - @DataProvider(name="parseChronoLocalDate") Object[][] provider_chronoLocalDate() { return new Object[][] { { HijrahDate.now() }, @@ -213,14 +216,15 @@ public class TestTextParserWithLocale extends AbstractTestPrinterParser { .appendValue(ChronoField.DAY_OF_MONTH, 1, 2, SignStyle.NEVER) .toFormatter(); - @Test(dataProvider="parseChronoLocalDate") + @ParameterizedTest + @MethodSource("provider_chronoLocalDate") public void test_chronoLocalDate(ChronoLocalDate date) throws Exception { System.out.printf(" %s, [fmt=%s]%n", date, fmt_chrono.format(date)); - assertEquals(date, fmt_chrono.parse(fmt_chrono.format(date), ChronoLocalDate::from)); + assertEquals(fmt_chrono.parse(fmt_chrono.format(date), ChronoLocalDate::from), date); DateTimeFormatter fmt = DateTimeFormatter.ofPattern("[GGG ]yyy-MM-dd") .withChronology(date.getChronology()); System.out.printf(" %s, [fmt=%s]%n", date.toString(), fmt.format(date)); - assertEquals(date, fmt.parse(fmt.format(date), ChronoLocalDate::from)); + assertEquals(fmt.parse(fmt.format(date), ChronoLocalDate::from), date); } } diff --git a/test/jdk/java/time/test/java/time/format/TestTextPrinter.java b/test/jdk/java/time/test/java/time/format/TestTextPrinter.java index 379d6a23bb0..f07c935b025 100644 --- a/test/jdk/java/time/test/java/time/format/TestTextPrinter.java +++ b/test/jdk/java/time/test/java/time/format/TestTextPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -64,7 +64,8 @@ import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static java.time.temporal.ChronoField.ERA; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.IsoFields.QUARTER_OF_YEAR; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DateTimeException; import java.time.DayOfWeek; @@ -75,30 +76,34 @@ import java.time.format.TextStyle; import java.time.temporal.TemporalField; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import test.java.time.temporal.MockFieldValue; /** * Test TextPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestTextPrinter extends AbstractTestPrinterParser { //----------------------------------------------------------------------- - @Test(expectedExceptions=DateTimeException.class) + @Test public void test_print_emptyCalendrical() throws Exception { - getFormatter(DAY_OF_WEEK, TextStyle.FULL).formatTo(EMPTY_DTA, buf); + Assertions.assertThrows(DateTimeException.class, () -> getFormatter(DAY_OF_WEEK, TextStyle.FULL).formatTo(EMPTY_DTA, buf)); } + @Test public void test_print_append() throws Exception { buf.append("EXISTING"); getFormatter(DAY_OF_WEEK, TextStyle.FULL).formatTo(LocalDate.of(2012, 4, 18), buf); - assertEquals(buf.toString(), "EXISTINGWednesday"); + assertEquals("EXISTINGWednesday", buf.toString()); } //----------------------------------------------------------------------- - @DataProvider(name="print") Object[][] provider_dow() { return new Object[][] { {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"}, @@ -204,7 +209,6 @@ public class TestTextPrinter extends AbstractTestPrinterParser { }; } - @DataProvider(name="print_DayOfWeekData") Object[][] providerDayOfWeekData() { return new Object[][] { // Locale, pattern, expected text, input DayOfWeek @@ -214,26 +218,30 @@ public class TestTextPrinter extends AbstractTestPrinterParser { }; } - @Test(dataProvider="print") + @ParameterizedTest + @MethodSource("provider_dow") public void test_format(TemporalField field, TextStyle style, int value, String expected) throws Exception { getFormatter(field, style).formatTo(new MockFieldValue(field, value), buf); - assertEquals(buf.toString(), expected); + assertEquals(expected, buf.toString()); } - @Test(dataProvider="print_DayOfWeekData") + @ParameterizedTest + @MethodSource("providerDayOfWeekData") public void test_formatDayOfWeek(Locale locale, String pattern, String expected, DayOfWeek dayOfWeek) { DateTimeFormatter formatter = getPatternFormatter(pattern).withLocale(locale); String text = formatter.format(dayOfWeek); - assertEquals(text, expected); + assertEquals(expected, text); } //----------------------------------------------------------------------- + @Test public void test_toString1() throws Exception { - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.FULL).toString(), "Text(MonthOfYear)"); + assertEquals("Text(MonthOfYear)", getFormatter(MONTH_OF_YEAR, TextStyle.FULL).toString()); } + @Test public void test_toString2() throws Exception { - assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).toString(), "Text(MonthOfYear,SHORT)"); + assertEquals("Text(MonthOfYear,SHORT)", getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestTextPrinterWithLocale.java b/test/jdk/java/time/test/java/time/format/TestTextPrinterWithLocale.java index abbe4302f99..9b85de777b1 100644 --- a/test/jdk/java/time/test/java/time/format/TestTextPrinterWithLocale.java +++ b/test/jdk/java/time/test/java/time/format/TestTextPrinterWithLocale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -70,7 +70,8 @@ import static java.time.temporal.ChronoField.DAY_OF_WEEK; import static java.time.temporal.ChronoField.ERA; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.IsoFields.QUARTER_OF_YEAR; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DateTimeException; import java.time.DayOfWeek; @@ -81,20 +82,22 @@ import java.time.format.TextStyle; import java.time.temporal.TemporalField; import java.util.Locale; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import test.java.time.temporal.MockFieldValue; /** * Test TextPrinterParserWithLocale. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestTextPrinterWithLocale extends AbstractTestPrinterParser { static final Locale RUSSIAN = Locale.of("ru"); static final Locale FINNISH = Locale.of("fi"); //----------------------------------------------------------------------- - @DataProvider(name="print_DayOfWeekData") Object[][] providerDayOfWeekData() { return new Object[][] { // Locale, pattern, expected text, input DayOfWeek @@ -109,7 +112,6 @@ public class TestTextPrinterWithLocale extends AbstractTestPrinterParser { } // Test data is dependent on localized resources. - @DataProvider(name="print_standalone") Object[][] provider_StandaloneNames() { return new Object[][] { // standalone names for 2013-01-01 (Tue) @@ -121,31 +123,34 @@ public class TestTextPrinterWithLocale extends AbstractTestPrinterParser { }; } - @Test(dataProvider="print_DayOfWeekData") + @ParameterizedTest + @MethodSource("providerDayOfWeekData") public void test_formatDayOfWeek(Locale locale, String pattern, String expected, DayOfWeek dayOfWeek) { DateTimeFormatter formatter = getPatternFormatter(pattern).withLocale(locale); String text = formatter.format(dayOfWeek); - assertEquals(text, expected); + assertEquals(expected, text); } - @Test(dataProvider="print_standalone") + @ParameterizedTest + @MethodSource("provider_StandaloneNames") public void test_standaloneNames(Locale locale, TemporalField field, TextStyle style, String expected) { getFormatter(field, style).withLocale(locale).formatTo(LocalDate.of(2013, 1, 1), buf); - assertEquals(buf.toString(), expected); + assertEquals(expected, buf.toString()); } //----------------------------------------------------------------------- + @Test public void test_print_french_long() throws Exception { getFormatter(MONTH_OF_YEAR, TextStyle.FULL).withLocale(Locale.FRENCH).formatTo(LocalDate.of(2012, 1, 1), buf); - assertEquals(buf.toString(), "janvier"); + assertEquals("janvier", buf.toString()); } + @Test public void test_print_french_short() throws Exception { getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).withLocale(Locale.FRENCH).formatTo(LocalDate.of(2012, 1, 1), buf); - assertEquals(buf.toString(), "janv."); + assertEquals("janv.", buf.toString()); } - @DataProvider(name="print_JapaneseChronology") Object[][] provider_japaneseEra() { return new Object[][] { {ERA, TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names. @@ -154,10 +159,11 @@ public class TestTextPrinterWithLocale extends AbstractTestPrinterParser { }; }; - @Test(dataProvider="print_JapaneseChronology") + @ParameterizedTest + @MethodSource("provider_japaneseEra") public void test_formatJapaneseEra(TemporalField field, TextStyle style, int value, String expected) throws Exception { LocalDate ld = LocalDate.of(2013, 1, 31); getFormatter(field, style).withChronology(JapaneseChronology.INSTANCE).formatTo(ld, buf); - assertEquals(buf.toString(), expected); + assertEquals(expected, buf.toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestUTCParse.java b/test/jdk/java/time/test/java/time/format/TestUTCParse.java index 2c41af68281..551f660e368 100644 --- a/test/jdk/java/time/test/java/time/format/TestUTCParse.java +++ b/test/jdk/java/time/test/java/time/format/TestUTCParse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 @@ -33,13 +33,14 @@ import java.time.format.DateTimeFormatterBuilder; import java.time.format.TextStyle; import java.time.temporal.TemporalQueries; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestUTCParse { - @DataProvider public Object[][] utcZoneIdStrings() { return new Object[][] { {"UTC"}, @@ -48,12 +49,13 @@ public class TestUTCParse { }; } - @Test(dataProvider = "utcZoneIdStrings") + @ParameterizedTest + @MethodSource("utcZoneIdStrings") public void testUTCOffsetRoundTrip(String zidString) { var fmt = new DateTimeFormatterBuilder() .appendZoneText(TextStyle.NARROW) .toFormatter(); var zid = ZoneId.of(zidString); - assertEquals(fmt.parse(zidString).query(TemporalQueries.zoneId()), zid); + assertEquals(zid, fmt.parse(zidString).query(TemporalQueries.zoneId())); } } diff --git a/test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java b/test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java index 6b99fea5c7c..80460fad007 100644 --- a/test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java +++ b/test/jdk/java/time/test/java/time/format/TestUnicodeExtension.java @@ -31,7 +31,7 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DayOfWeek; import java.time.ZonedDateTime; @@ -50,15 +50,16 @@ import java.util.Locale; import java.util.TimeZone; import java.util.stream.Stream; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test JavaTime with BCP47 U extensions */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestUnicodeExtension { private static TimeZone defaultTZ; @@ -87,18 +88,17 @@ public class TestUnicodeExtension { private static final String PATTERN = "GGGG MMMM-dd-uu HH:mm:ss zzzz"; - @BeforeTest + @BeforeAll public void beforeTest() { defaultTZ = TimeZone.getDefault(); TimeZone.setDefault(TimeZone.getTimeZone(AMLA)); } - @AfterTest + @AfterAll public void afterTest() { TimeZone.setDefault(defaultTZ); } - @DataProvider(name="localizedBy") Object[][] localizedBy() { return new Object[][] { // Locale, Chrono override, Zone override, Expected Chrono, Expected Zone, @@ -188,7 +188,6 @@ public class TestUnicodeExtension { }; } - @DataProvider(name="withLocale") Object[][] withLocale() { return new Object[][] { // Locale, Chrono override, Zone override, Expected Chrono, Expected Zone, @@ -277,7 +276,6 @@ public class TestUnicodeExtension { }; } - @DataProvider(name="firstDayOfWeek") Object[][] firstDayOfWeek () { return new Object[][] { // Locale, Expected DayOfWeek, @@ -304,7 +302,6 @@ public class TestUnicodeExtension { }; } - @DataProvider(name="minDaysInFirstWeek") Object[][] minDaysInFrstWeek () { return new Object[][] { // Locale, Expected minDay, @@ -316,7 +313,6 @@ public class TestUnicodeExtension { }; } - @DataProvider(name="ofPattern") Object[][] ofPattern() { return new Object[][] { // Locale, Expected Chrono, Expected Zone, @@ -342,7 +338,6 @@ public class TestUnicodeExtension { }; } - @DataProvider(name="shortTZID") Object[][] shortTZID() { return new Object[][] { // LDML's short ID, Expected Zone, @@ -817,7 +812,6 @@ public class TestUnicodeExtension { }; } - @DataProvider(name="getLocalizedDateTimePattern") Object[][] getLocalizedDateTimePattern() { return new Object[][] { // Locale, Expected pattern, @@ -832,7 +826,6 @@ public class TestUnicodeExtension { }; } - @DataProvider(name="getDisplayName") Object[][] getDisplayName() { return new Object[][] { // Locale, field, Expected name, @@ -841,7 +834,8 @@ public class TestUnicodeExtension { }; } - @Test(dataProvider="localizedBy") + @ParameterizedTest + @MethodSource("localizedBy") public void test_localizedBy(Locale locale, Chronology chrono, ZoneId zone, Chronology chronoExpected, ZoneId zoneExpected, String formatExpected) { @@ -855,91 +849,94 @@ public class TestUnicodeExtension { DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.FULL) .withChronology(chrono).withZone(zone).localizedBy(locale); - assertEquals(dtf.getChronology(), chronoExpected); - assertEquals(dtf.getZone(), zoneExpected); + assertEquals(chronoExpected, dtf.getChronology()); + assertEquals(zoneExpected, dtf.getZone()); String formatted = dtf.format(ZDT); - assertEquals(formatted, formatExpected); - assertEquals(dtf.parse(formatted, ZonedDateTime::from), - zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + assertEquals(formatExpected, formatted); + assertEquals(zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT, dtf.parse(formatted, ZonedDateTime::from)); }); } finally { Locale.setDefault(def); } } - @Test(dataProvider="withLocale") + @ParameterizedTest + @MethodSource("withLocale") public void test_withLocale(Locale locale, Chronology chrono, ZoneId zone, Chronology chronoExpected, ZoneId zoneExpected, String formatExpected) { DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.FULL) .withChronology(chrono).withZone(zone).withLocale(locale); - assertEquals(dtf.getChronology(), chronoExpected); - assertEquals(dtf.getZone(), zoneExpected); + assertEquals(chronoExpected, dtf.getChronology()); + assertEquals(zoneExpected, dtf.getZone()); String formatted = dtf.format(ZDT); - assertEquals(formatted, formatExpected); - assertEquals(dtf.parse(formatted, ZonedDateTime::from), - zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + assertEquals(formatExpected, formatted); + assertEquals(zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT, dtf.parse(formatted, ZonedDateTime::from)); } - @Test(dataProvider="firstDayOfWeek") + @ParameterizedTest + @MethodSource("firstDayOfWeek") public void test_firstDayOfWeek(Locale locale, DayOfWeek dowExpected) { DayOfWeek dow = WeekFields.of(locale).getFirstDayOfWeek(); - assertEquals(dow, dowExpected); + assertEquals(dowExpected, dow); } - @Test(dataProvider="minDaysInFirstWeek") + @ParameterizedTest + @MethodSource("minDaysInFrstWeek") public void test_minDaysInFirstWeek(Locale locale, int minDaysExpected) { int minDays = WeekFields.of(locale).getMinimalDaysInFirstWeek(); - assertEquals(minDays, minDaysExpected); + assertEquals(minDaysExpected, minDays); } - @Test(dataProvider="ofPattern") + @ParameterizedTest + @MethodSource("ofPattern") public void test_ofPattern(Locale locale, Chronology chronoExpected, ZoneId zoneExpected, String formatExpected) { DateTimeFormatter dtf = DateTimeFormatter.ofPattern(PATTERN, locale); - assertEquals(dtf.getChronology(), chronoExpected); - assertEquals(dtf.getZone(), zoneExpected); + assertEquals(chronoExpected, dtf.getChronology()); + assertEquals(zoneExpected, dtf.getZone()); String formatted = dtf.format(ZDT); - assertEquals(formatted, formatExpected); - assertEquals(dtf.parse(formatted, ZonedDateTime::from), - zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + assertEquals(formatExpected, formatted); + assertEquals(zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT, dtf.parse(formatted, ZonedDateTime::from)); } - @Test(dataProvider="ofPattern") + @ParameterizedTest + @MethodSource("ofPattern") public void test_toFormatter(Locale locale, Chronology chronoExpected, ZoneId zoneExpected, String formatExpected) { DateTimeFormatter dtf = new DateTimeFormatterBuilder().appendPattern(PATTERN).toFormatter(locale); - assertEquals(dtf.getChronology(), chronoExpected); - assertEquals(dtf.getZone(), zoneExpected); + assertEquals(chronoExpected, dtf.getChronology()); + assertEquals(zoneExpected, dtf.getZone()); String formatted = dtf.format(ZDT); - assertEquals(formatted, formatExpected); - assertEquals(dtf.parse(formatted, ZonedDateTime::from), - zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT); + assertEquals(formatExpected, formatted); + assertEquals(zoneExpected != null ? ZDT.withZoneSameInstant(zoneExpected) : ZDT, dtf.parse(formatted, ZonedDateTime::from)); } - @Test(dataProvider="shortTZID") + @ParameterizedTest + @MethodSource("shortTZID") public void test_shortTZID(String shortID, String expectedZone) { Locale l = Locale.forLanguageTag("en-US-u-tz-" + shortID); DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL, FormatStyle.FULL) .localizedBy(l); - assertEquals(dtf.getZone(), ZoneId.of(expectedZone)); + assertEquals(ZoneId.of(expectedZone), dtf.getZone()); } - @Test(dataProvider="getLocalizedDateTimePattern") + @ParameterizedTest + @MethodSource("getLocalizedDateTimePattern") public void test_getLocalizedDateTimePattern(Locale l, FormatStyle s, String expectedPattern) { DateTimeFormatterBuilder dtfb = new DateTimeFormatterBuilder(); - assertEquals(dtfb.getLocalizedDateTimePattern(s, s, IsoChronology.INSTANCE, l), - expectedPattern); + assertEquals(expectedPattern, dtfb.getLocalizedDateTimePattern(s, s, IsoChronology.INSTANCE, l)); } - @Test(dataProvider="getDisplayName") + @ParameterizedTest + @MethodSource("getDisplayName") public void test_getDisplayName(Locale l, TemporalField f, String expectedName) { - assertEquals(f.getDisplayName(l), expectedName); + assertEquals(expectedName, f.getDisplayName(l)); } } diff --git a/test/jdk/java/time/test/java/time/format/TestZoneOffsetParser.java b/test/jdk/java/time/test/java/time/format/TestZoneOffsetParser.java index 32425549834..b5807e3cb2d 100644 --- a/test/jdk/java/time/test/java/time/format/TestZoneOffsetParser.java +++ b/test/jdk/java/time/test/java/time/format/TestZoneOffsetParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -60,24 +60,26 @@ package test.java.time.format; import static java.time.temporal.ChronoField.OFFSET_SECONDS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.text.ParsePosition; import java.time.ZoneOffset; import java.time.temporal.TemporalAccessor; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test ZoneOffsetPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestZoneOffsetParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- - @DataProvider(name="error") Object[][] data_error() { return new Object[][] { {"+HH:MM:ss", "Z", "hello", -1, IndexOutOfBoundsException.class}, @@ -85,7 +87,8 @@ public class TestZoneOffsetParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="error") + @ParameterizedTest + @MethodSource("data_error") public void test_parse_error(String pattern, String noOffsetText, String text, int pos, Class expected) { try { getFormatter(pattern, noOffsetText).parseUnresolved(text, new ParsePosition(pos)); @@ -95,65 +98,72 @@ public class TestZoneOffsetParser extends AbstractTestPrinterParser { } //----------------------------------------------------------------------- + @Test public void test_parse_exactMatch_UTC() throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("Z", pos); - assertEquals(pos.getIndex(), 1); + assertEquals(1, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_startStringMatch_UTC() throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("ZOTHER", pos); - assertEquals(pos.getIndex(), 1); + assertEquals(1, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_midStringMatch_UTC() throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("OTHERZOTHER", pos); - assertEquals(pos.getIndex(), 6); + assertEquals(6, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_endStringMatch_UTC() throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("OTHERZ", pos); - assertEquals(pos.getIndex(), 6); + assertEquals(6, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } //----------------------------------------------------------------------- + @Test public void test_parse_exactMatch_UTC_EmptyUTC() throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "").parseUnresolved("", pos); - assertEquals(pos.getIndex(), 0); + assertEquals(0, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_startStringMatch_UTC_EmptyUTC() throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "").parseUnresolved("OTHER", pos); - assertEquals(pos.getIndex(), 0); + assertEquals(0, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_midStringMatch_UTC_EmptyUTC() throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "").parseUnresolved("OTHEROTHER", pos); - assertEquals(pos.getIndex(), 5); + assertEquals(5, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_endStringMatch_UTC_EmptyUTC() throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "").parseUnresolved("OTHER", pos); - assertEquals(pos.getIndex(), 5); + assertEquals(5, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } //----------------------------------------------------------------------- - @DataProvider(name="offsets") Object[][] provider_offsets() { return new Object[][] { {"+HH", "+00", ZoneOffset.UTC}, @@ -228,72 +238,79 @@ public class TestZoneOffsetParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_exactMatch(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(pattern, "Z").parseUnresolved(parse, pos); - assertEquals(pos.getIndex(), parse.length()); + assertEquals(parse.length(), pos.getIndex()); assertParsed(parsed, expected); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_startStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(pattern, "Z").parseUnresolved(parse + ":OTHER", pos); - assertEquals(pos.getIndex(), parse.length()); + assertEquals(parse.length(), pos.getIndex()); assertParsed(parsed, expected); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_midStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter(pattern, "Z").parseUnresolved("OTHER" + parse + ":OTHER", pos); - assertEquals(pos.getIndex(), parse.length() + 5); + assertEquals(parse.length() + 5, pos.getIndex()); assertParsed(parsed, expected); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_endStringMatch(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter(pattern, "Z").parseUnresolved("OTHER" + parse, pos); - assertEquals(pos.getIndex(), parse.length() + 5); + assertEquals(parse.length() + 5, pos.getIndex()); assertParsed(parsed, expected); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_exactMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(pattern, "").parseUnresolved(parse, pos); - assertEquals(pos.getIndex(), parse.length()); + assertEquals(parse.length(), pos.getIndex()); assertParsed(parsed, expected); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_startStringMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(pattern, "").parseUnresolved(parse + ":OTHER", pos); - assertEquals(pos.getIndex(), parse.length()); + assertEquals(parse.length(), pos.getIndex()); assertParsed(parsed, expected); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_midStringMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter(pattern, "").parseUnresolved("OTHER" + parse + ":OTHER", pos); - assertEquals(pos.getIndex(), parse.length() + 5); + assertEquals(parse.length() + 5, pos.getIndex()); assertParsed(parsed, expected); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_parse_endStringMatch_EmptyUTC(String pattern, String parse, ZoneOffset expected) throws Exception { ParsePosition pos = new ParsePosition(5); TemporalAccessor parsed = getFormatter(pattern, "").parseUnresolved("OTHER" + parse, pos); - assertEquals(pos.getIndex(), parse.length() + 5); + assertEquals(parse.length() + 5, pos.getIndex()); assertParsed(parsed, expected); } //----------------------------------------------------------------------- - @DataProvider(name="bigOffsets") Object[][] provider_bigOffsets() { return new Object[][] { {"+HH", "+19", 19 * 3600}, @@ -319,16 +336,16 @@ public class TestZoneOffsetParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="bigOffsets") + @ParameterizedTest + @MethodSource("provider_bigOffsets") public void test_parse_bigOffsets(String pattern, String parse, long offsetSecs) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(pattern, "").parseUnresolved(parse, pos); - assertEquals(pos.getIndex(), parse.length()); - assertEquals(parsed.getLong(OFFSET_SECONDS), offsetSecs); + assertEquals(parse.length(), pos.getIndex()); + assertEquals(offsetSecs, parsed.getLong(OFFSET_SECONDS)); } //----------------------------------------------------------------------- - @DataProvider(name="badOffsets") Object[][] provider_badOffsets() { return new Object[][] { {"+HH", "+1", 0}, @@ -390,55 +407,60 @@ public class TestZoneOffsetParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="badOffsets") + @ParameterizedTest + @MethodSource("provider_badOffsets") public void test_parse_invalid(String pattern, String parse, int expectedPosition) throws Exception { ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter(pattern, "Z").parseUnresolved(parse, pos); - assertEquals(pos.getErrorIndex(), expectedPosition); - assertEquals(parsed, null); + assertEquals(expectedPosition, pos.getErrorIndex()); + assertEquals(null, parsed); } //----------------------------------------------------------------------- //----------------------------------------------------------------------- //----------------------------------------------------------------------- + @Test public void test_parse_caseSensitiveUTC_matchedCase() throws Exception { setCaseSensitive(true); ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("Z", pos); - assertEquals(pos.getIndex(), 1); + assertEquals(1, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_caseSensitiveUTC_unmatchedCase() throws Exception { setCaseSensitive(true); ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("z", pos); - assertEquals(pos.getErrorIndex(), 0); - assertEquals(parsed, null); + assertEquals(0, pos.getErrorIndex()); + assertEquals(null, parsed); } + @Test public void test_parse_caseInsensitiveUTC_matchedCase() throws Exception { setCaseSensitive(false); ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("Z", pos); - assertEquals(pos.getIndex(), 1); + assertEquals(1, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } + @Test public void test_parse_caseInsensitiveUTC_unmatchedCase() throws Exception { setCaseSensitive(false); ParsePosition pos = new ParsePosition(0); TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("z", pos); - assertEquals(pos.getIndex(), 1); + assertEquals(1, pos.getIndex()); assertParsed(parsed, ZoneOffset.UTC); } private void assertParsed(TemporalAccessor parsed, ZoneOffset expectedOffset) { if (expectedOffset == null) { - assertEquals(parsed, null); + assertEquals(null, parsed); } else { - assertEquals(parsed.isSupported(OFFSET_SECONDS), true); - assertEquals(parsed.getLong(OFFSET_SECONDS), (long) expectedOffset.getTotalSeconds()); + assertEquals(true, parsed.isSupported(OFFSET_SECONDS)); + assertEquals((long) expectedOffset.getTotalSeconds(), parsed.getLong(OFFSET_SECONDS)); } } diff --git a/test/jdk/java/time/test/java/time/format/TestZoneOffsetPrinter.java b/test/jdk/java/time/test/java/time/format/TestZoneOffsetPrinter.java index 4e1b7a402c7..12d54d12200 100644 --- a/test/jdk/java/time/test/java/time/format/TestZoneOffsetPrinter.java +++ b/test/jdk/java/time/test/java/time/format/TestZoneOffsetPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,24 +59,26 @@ */ package test.java.time.format; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.DateTimeException; import java.time.ZoneOffset; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test ZoneOffsetPrinterParser. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestZoneOffsetPrinter extends AbstractTestPrinterParser { private static final ZoneOffset OFFSET_0130 = ZoneOffset.of("+01:30"); //----------------------------------------------------------------------- - @DataProvider(name="offsets") Object[][] provider_offsets() { return new Object[][] { {"+HH", "NO-OFFSET", ZoneOffset.UTC}, @@ -147,27 +149,30 @@ public class TestZoneOffsetPrinter extends AbstractTestPrinterParser { }; } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_format(String pattern, String expected, ZoneOffset offset) throws Exception { buf.append("EXISTING"); getFormatter(pattern, "NO-OFFSET").formatTo(offset, buf); - assertEquals(buf.toString(), "EXISTING" + expected); + assertEquals("EXISTING" + expected, buf.toString()); } - @Test(dataProvider="offsets") + @ParameterizedTest + @MethodSource("provider_offsets") public void test_toString(String pattern, String expected, ZoneOffset offset) throws Exception { - assertEquals(getFormatter(pattern, "NO-OFFSET").toString(), "Offset(" + pattern + ",'NO-OFFSET')"); + assertEquals("Offset(" + pattern + ",'NO-OFFSET')", getFormatter(pattern, "NO-OFFSET").toString()); } //----------------------------------------------------------------------- - @Test(expectedExceptions=DateTimeException.class) + @Test public void test_print_emptyCalendrical() throws Exception { - getFormatter("+HH:MM:ss", "Z").formatTo(EMPTY_DTA, buf); + Assertions.assertThrows(DateTimeException.class, () -> getFormatter("+HH:MM:ss", "Z").formatTo(EMPTY_DTA, buf)); } + @Test public void test_print_emptyAppendable() throws Exception { getFormatter("+HH:MM:ss", "Z").formatTo(OFFSET_0130, buf); - assertEquals(buf.toString(), "+01:30"); + assertEquals("+01:30", buf.toString()); } } diff --git a/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java b/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java index 20861f151e0..abe3cd6b154 100644 --- a/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java +++ b/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java @@ -23,8 +23,8 @@ package test.java.time.format; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.text.DateFormatSymbols; import java.time.ZoneId; @@ -46,8 +46,10 @@ import java.util.Set; import java.util.TimeZone; import jdk.test.lib.RandomFactory; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* * @test @@ -59,7 +61,7 @@ import org.testng.annotations.Test; /** * Test ZoneTextPrinterParser */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { private static final Locale[] SAMPLE_LOCALES = { @@ -73,6 +75,7 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { .withDecimalStyle(DecimalStyle.of(locale)); } + @Test public void test_printText() { Random r = RandomFactory.getRandom(); int N = 8; @@ -123,9 +126,10 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { System.out.printf("[%-5s, %5s] :[%s]%n", locale.toString(), style.toString(),result); System.out.printf(" %5s, %5s :[%s] %s%n", "", "", expected, zone); } - assertEquals(result, expected); + assertEquals(expected, result); } + @Test public void test_ParseText() { Set zids = ZoneRulesProvider.getAvailableZoneIds(); for (Locale locale : SAMPLE_LOCALES) { @@ -153,7 +157,6 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { private static Set none = new HashSet<>(); - @DataProvider(name="preferredZones") Object[][] data_preferredZones() { return new Object[][] { {"America/New_York", "Eastern Standard Time", none, Locale.ENGLISH, TextStyle.FULL}, @@ -178,7 +181,8 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="preferredZones") + @ParameterizedTest + @MethodSource("data_preferredZones") public void test_ParseText(String expected, String text, Set preferred, Locale locale, TextStyle style) { DateTimeFormatter fmt = new DateTimeFormatterBuilder().appendZoneText(style, preferred) .toFormatter(locale) @@ -191,7 +195,7 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { style == TextStyle.FULL ? " full" :"short", text, ret, expected); - assertEquals(ret, expected); + assertEquals(expected, ret); } @@ -246,7 +250,6 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { .withDecimalStyle(DecimalStyle.of(locale)); } - @DataProvider(name="roundTripAtOverlap") Object[][] data_roundTripAtOverlap() { return new Object[][] { {"yyyy-MM-dd HH:mm:ss.SSS z", "2021-10-31 02:30:00.000 CET"}, @@ -265,10 +268,11 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { }; } - @Test(dataProvider="roundTripAtOverlap") + @ParameterizedTest + @MethodSource("data_roundTripAtOverlap") public void test_roundTripAtOverlap(String pattern, String input) { var dtf = DateTimeFormatter.ofPattern(pattern, Locale.US); - assertEquals(dtf.format(ZonedDateTime.parse(input, dtf)), input); + assertEquals(input, dtf.format(ZonedDateTime.parse(input, dtf))); var lc = input.toLowerCase(Locale.ROOT); try { ZonedDateTime.parse(lc, dtf); @@ -276,7 +280,7 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { } catch (DateTimeParseException ignore) {} dtf = new DateTimeFormatterBuilder().parseCaseInsensitive().appendPattern(pattern).toFormatter(Locale.US); - assertEquals(dtf.format(ZonedDateTime.parse(input, dtf)), input); - assertEquals(dtf.format(ZonedDateTime.parse(lc, dtf)), input); + assertEquals(input, dtf.format(ZonedDateTime.parse(input, dtf))); + assertEquals(input, dtf.format(ZonedDateTime.parse(lc, dtf))); } } diff --git a/test/jdk/java/time/test/java/time/temporal/TestChronoField.java b/test/jdk/java/time/test/java/time/temporal/TestChronoField.java index a353a6b247b..716f586ff79 100644 --- a/test/jdk/java/time/test/java/time/temporal/TestChronoField.java +++ b/test/jdk/java/time/test/java/time/temporal/TestChronoField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, 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 @@ -54,8 +54,7 @@ */ package test.java.time.temporal; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.temporal.ChronoField; import java.time.temporal.IsoFields; @@ -64,18 +63,18 @@ import java.time.temporal.WeekFields; import java.util.HashMap; import java.util.Locale; import java.util.Map; -import java.util.ResourceBundle; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestChronoField { Map fieldMap; - @BeforeClass + @BeforeAll public void initClass() { fieldMap = new HashMap<>(); fieldMap.put(ChronoField.ERA, "era"); @@ -91,7 +90,6 @@ public class TestChronoField { fieldMap.put(ChronoField.OFFSET_SECONDS, "zone"); } - @DataProvider(name = "localeList") Locale[] data_localeList() { return new Locale[] { Locale.US, @@ -101,7 +99,6 @@ public class TestChronoField { }; } //----------------------------------------------------------------------- - @DataProvider(name = "localeDisplayNames") Object[][] data_localeDisplayNames() { return new Object[][] { {ChronoField.ERA}, @@ -121,12 +118,14 @@ public class TestChronoField { public void test_IsoFields_week_based_year() { Locale locale = Locale.US; String name = IsoFields.WEEK_OF_WEEK_BASED_YEAR.getDisplayName(locale); - assertEquals(name, "week"); + assertEquals("week", name); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_nullIsoFields_week_based_year() { - String name = IsoFields.WEEK_OF_WEEK_BASED_YEAR.getDisplayName((Locale)null); + Assertions.assertThrows(NullPointerException.class, () -> { + String name = IsoFields.WEEK_OF_WEEK_BASED_YEAR.getDisplayName((Locale)null); + }); } @Test @@ -134,24 +133,28 @@ public class TestChronoField { Locale locale = Locale.US; TemporalField weekOfYearField = WeekFields.SUNDAY_START.weekOfYear(); String name = weekOfYearField.getDisplayName(locale); - assertEquals(name, "week"); + assertEquals("week", name); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_nullWeekFields_week_based_year() { - TemporalField weekOfYearField = WeekFields.SUNDAY_START.weekOfYear(); - String name = weekOfYearField.getDisplayName((Locale)null); + Assertions.assertThrows(NullPointerException.class, () -> { + TemporalField weekOfYearField = WeekFields.SUNDAY_START.weekOfYear(); + String name = weekOfYearField.getDisplayName((Locale)null); + }); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_nullLocaleChronoFieldDisplayName() { - ChronoField.YEAR.getDisplayName((Locale)null); + Assertions.assertThrows(NullPointerException.class, () -> ChronoField.YEAR.getDisplayName((Locale)null)); } - @Test(expectedExceptions=NullPointerException.class) + @Test public void test_nullLocaleTemporalFieldDisplayName() { - // Test the default method in TemporalField using the - // IsoFields.DAY_OF_QUARTER which does not override getDisplayName - IsoFields.DAY_OF_QUARTER.getDisplayName((Locale)null); + Assertions.assertThrows(NullPointerException.class, () -> { + // Test the default method in TemporalField using the + // IsoFields.DAY_OF_QUARTER which does not override getDisplayName + IsoFields.DAY_OF_QUARTER.getDisplayName((Locale)null); + }); } } diff --git a/test/jdk/java/time/test/java/time/temporal/TestChronoUnit.java b/test/jdk/java/time/test/java/time/temporal/TestChronoUnit.java index 95e5f6503ed..11ebcfd13bd 100644 --- a/test/jdk/java/time/test/java/time/temporal/TestChronoUnit.java +++ b/test/jdk/java/time/test/java/time/temporal/TestChronoUnit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -65,23 +65,24 @@ import static java.time.temporal.ChronoUnit.DAYS; import static java.time.temporal.ChronoUnit.MONTHS; import static java.time.temporal.ChronoUnit.WEEKS; import static java.time.temporal.ChronoUnit.YEARS; -import static org.testng.Assert.assertEquals; + +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.LocalDate; import java.time.Month; import java.time.ZoneOffset; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestChronoUnit { //----------------------------------------------------------------------- - @DataProvider(name = "yearsBetween") Object[][] data_yearsBetween() { return new Object[][] { {date(1939, SEPTEMBER, 2), date(1939, SEPTEMBER, 1), 0}, @@ -102,47 +103,52 @@ public class TestChronoUnit { }; } - @Test(dataProvider = "yearsBetween") + @ParameterizedTest + @MethodSource("data_yearsBetween") public void test_yearsBetween(LocalDate start, LocalDate end, long expected) { - assertEquals(YEARS.between(start, end), expected); + assertEquals(expected, YEARS.between(start, end)); } - @Test(dataProvider = "yearsBetween") + @ParameterizedTest + @MethodSource("data_yearsBetween") public void test_yearsBetweenReversed(LocalDate start, LocalDate end, long expected) { - assertEquals(YEARS.between(end, start), -expected); + assertEquals(-expected, YEARS.between(end, start)); } - @Test(dataProvider = "yearsBetween") + @ParameterizedTest + @MethodSource("data_yearsBetween") public void test_yearsBetween_LocalDateTimeSameTime(LocalDate start, LocalDate end, long expected) { - assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 30)), expected); + assertEquals(expected, YEARS.between(start.atTime(12, 30), end.atTime(12, 30))); } - @Test(dataProvider = "yearsBetween") + @ParameterizedTest + @MethodSource("data_yearsBetween") public void test_yearsBetween_LocalDateTimeLaterTime(LocalDate start, LocalDate end, long expected) { if (expected >= 0) { - assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 31)), expected); + assertEquals(expected, YEARS.between(start.atTime(12, 30), end.atTime(12, 31))); } else { - assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 29)), expected); + assertEquals(expected, YEARS.between(start.atTime(12, 30), end.atTime(12, 29))); } } - @Test(dataProvider = "yearsBetween") + @ParameterizedTest + @MethodSource("data_yearsBetween") public void test_yearsBetween_ZonedDateSameOffset(LocalDate start, LocalDate end, long expected) { - assertEquals(YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected); + assertEquals(expected, YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(2)))); } - @Test(dataProvider = "yearsBetween") + @ParameterizedTest + @MethodSource("data_yearsBetween") public void test_yearsBetween_ZonedDateLaterOffset(LocalDate start, LocalDate end, long expected) { // +01:00 is later than +02:00 if (expected >= 0) { - assertEquals(YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(1))), expected); + assertEquals(expected, YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(1)))); } else { - assertEquals(YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(1)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected); + assertEquals(expected, YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(1)), end.atStartOfDay(ZoneOffset.ofHours(2)))); } } //----------------------------------------------------------------------- - @DataProvider(name = "monthsBetween") Object[][] data_monthsBetween() { return new Object[][] { {date(2012, JULY, 2), date(2012, JULY, 1), 0}, @@ -175,47 +181,52 @@ public class TestChronoUnit { }; } - @Test(dataProvider = "monthsBetween") + @ParameterizedTest + @MethodSource("data_monthsBetween") public void test_monthsBetween(LocalDate start, LocalDate end, long expected) { - assertEquals(MONTHS.between(start, end), expected); + assertEquals(expected, MONTHS.between(start, end)); } - @Test(dataProvider = "monthsBetween") + @ParameterizedTest + @MethodSource("data_monthsBetween") public void test_monthsBetweenReversed(LocalDate start, LocalDate end, long expected) { - assertEquals(MONTHS.between(end, start), -expected); + assertEquals(-expected, MONTHS.between(end, start)); } - @Test(dataProvider = "monthsBetween") + @ParameterizedTest + @MethodSource("data_monthsBetween") public void test_monthsBetween_LocalDateTimeSameTime(LocalDate start, LocalDate end, long expected) { - assertEquals(MONTHS.between(start.atTime(12, 30), end.atTime(12, 30)), expected); + assertEquals(expected, MONTHS.between(start.atTime(12, 30), end.atTime(12, 30))); } - @Test(dataProvider = "monthsBetween") + @ParameterizedTest + @MethodSource("data_monthsBetween") public void test_monthsBetween_LocalDateTimeLaterTime(LocalDate start, LocalDate end, long expected) { if (expected >= 0) { - assertEquals(MONTHS.between(start.atTime(12, 30), end.atTime(12, 31)), expected); + assertEquals(expected, MONTHS.between(start.atTime(12, 30), end.atTime(12, 31))); } else { - assertEquals(MONTHS.between(start.atTime(12, 30), end.atTime(12, 29)), expected); + assertEquals(expected, MONTHS.between(start.atTime(12, 30), end.atTime(12, 29))); } } - @Test(dataProvider = "monthsBetween") + @ParameterizedTest + @MethodSource("data_monthsBetween") public void test_monthsBetween_ZonedDateSameOffset(LocalDate start, LocalDate end, long expected) { - assertEquals(MONTHS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected); + assertEquals(expected, MONTHS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(2)))); } - @Test(dataProvider = "monthsBetween") + @ParameterizedTest + @MethodSource("data_monthsBetween") public void test_monthsBetween_ZonedDateLaterOffset(LocalDate start, LocalDate end, long expected) { // +01:00 is later than +02:00 if (expected >= 0) { - assertEquals(MONTHS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(1))), expected); + assertEquals(expected, MONTHS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(1)))); } else { - assertEquals(MONTHS.between(start.atStartOfDay(ZoneOffset.ofHours(1)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected); + assertEquals(expected, MONTHS.between(start.atStartOfDay(ZoneOffset.ofHours(1)), end.atStartOfDay(ZoneOffset.ofHours(2)))); } } //----------------------------------------------------------------------- - @DataProvider(name = "weeksBetween") Object[][] data_weeksBetween() { return new Object[][] { {date(2012, JULY, 2), date(2012, JUNE, 25), -1}, @@ -242,18 +253,19 @@ public class TestChronoUnit { }; } - @Test(dataProvider = "weeksBetween") + @ParameterizedTest + @MethodSource("data_weeksBetween") public void test_weeksBetween(LocalDate start, LocalDate end, long expected) { - assertEquals(WEEKS.between(start, end), expected); + assertEquals(expected, WEEKS.between(start, end)); } - @Test(dataProvider = "weeksBetween") + @ParameterizedTest + @MethodSource("data_weeksBetween") public void test_weeksBetweenReversed(LocalDate start, LocalDate end, long expected) { - assertEquals(WEEKS.between(end, start), -expected); + assertEquals(-expected, WEEKS.between(end, start)); } //----------------------------------------------------------------------- - @DataProvider(name = "daysBetween") Object[][] data_daysBetween() { return new Object[][] { {date(2012, JULY, 2), date(2012, JULY, 1), -1}, @@ -285,42 +297,48 @@ public class TestChronoUnit { }; } - @Test(dataProvider = "daysBetween") + @ParameterizedTest + @MethodSource("data_daysBetween") public void test_daysBetween(LocalDate start, LocalDate end, long expected) { - assertEquals(DAYS.between(start, end), expected); + assertEquals(expected, DAYS.between(start, end)); } - @Test(dataProvider = "daysBetween") + @ParameterizedTest + @MethodSource("data_daysBetween") public void test_daysBetweenReversed(LocalDate start, LocalDate end, long expected) { - assertEquals(DAYS.between(end, start), -expected); + assertEquals(-expected, DAYS.between(end, start)); } - @Test(dataProvider = "daysBetween") + @ParameterizedTest + @MethodSource("data_daysBetween") public void test_daysBetween_LocalDateTimeSameTime(LocalDate start, LocalDate end, long expected) { - assertEquals(DAYS.between(start.atTime(12, 30), end.atTime(12, 30)), expected); + assertEquals(expected, DAYS.between(start.atTime(12, 30), end.atTime(12, 30))); } - @Test(dataProvider = "daysBetween") + @ParameterizedTest + @MethodSource("data_daysBetween") public void test_daysBetween_LocalDateTimeLaterTime(LocalDate start, LocalDate end, long expected) { if (expected >= 0) { - assertEquals(DAYS.between(start.atTime(12, 30), end.atTime(12, 31)), expected); + assertEquals(expected, DAYS.between(start.atTime(12, 30), end.atTime(12, 31))); } else { - assertEquals(DAYS.between(start.atTime(12, 30), end.atTime(12, 29)), expected); + assertEquals(expected, DAYS.between(start.atTime(12, 30), end.atTime(12, 29))); } } - @Test(dataProvider = "daysBetween") + @ParameterizedTest + @MethodSource("data_daysBetween") public void test_daysBetween_ZonedDateSameOffset(LocalDate start, LocalDate end, long expected) { - assertEquals(DAYS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected); + assertEquals(expected, DAYS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(2)))); } - @Test(dataProvider = "daysBetween") + @ParameterizedTest + @MethodSource("data_daysBetween") public void test_daysBetween_ZonedDateLaterOffset(LocalDate start, LocalDate end, long expected) { // +01:00 is later than +02:00 if (expected >= 0) { - assertEquals(DAYS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(1))), expected); + assertEquals(expected, DAYS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(1)))); } else { - assertEquals(DAYS.between(start.atStartOfDay(ZoneOffset.ofHours(1)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected); + assertEquals(expected, DAYS.between(start.atStartOfDay(ZoneOffset.ofHours(1)), end.atStartOfDay(ZoneOffset.ofHours(2)))); } } diff --git a/test/jdk/java/time/test/java/time/temporal/TestDateTimeBuilderCombinations.java b/test/jdk/java/time/test/java/time/temporal/TestDateTimeBuilderCombinations.java index ffa9fc3c342..8a81da27458 100644 --- a/test/jdk/java/time/test/java/time/temporal/TestDateTimeBuilderCombinations.java +++ b/test/jdk/java/time/test/java/time/temporal/TestDateTimeBuilderCombinations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -70,8 +70,9 @@ import static java.time.temporal.ChronoField.EPOCH_DAY; import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.ChronoField.PROLEPTIC_MONTH; import static java.time.temporal.ChronoField.YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.time.DateTimeException; import java.time.LocalDate; @@ -80,15 +81,16 @@ import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test. */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeBuilderCombinations { - @DataProvider(name = "combine") Object[][] data_combine() { return new Object[][] { {YEAR, 2012, MONTH_OF_YEAR, 6, DAY_OF_MONTH, 3, null, null, LocalDate.class, LocalDate.of(2012, 6, 3)}, @@ -101,7 +103,8 @@ public class TestDateTimeBuilderCombinations { }; } - @Test(dataProvider = "combine") + @ParameterizedTest + @MethodSource("data_combine") public void test_derive(final TemporalField field1, final Number value1, final TemporalField field2, final Number value2, final TemporalField field3, final Number value3, @@ -149,7 +152,7 @@ public class TestDateTimeBuilderCombinations { TemporalAccessor parsed = dtfb.toFormatter().parse(str); if (query == LocalDate.class) { if (expectedVal != null) { - assertEquals(parsed.query(LocalDate::from), expectedVal); + assertEquals(expectedVal, parsed.query(LocalDate::from)); } else { try { parsed.query(LocalDate::from); @@ -164,7 +167,6 @@ public class TestDateTimeBuilderCombinations { } //----------------------------------------------------------------------- - @DataProvider(name = "normalized") Object[][] data_normalized() { return new Object[][] { {YEAR, 2127, YEAR, 2127}, @@ -182,7 +184,8 @@ public class TestDateTimeBuilderCombinations { }; } - @Test(dataProvider = "normalized") + @ParameterizedTest + @MethodSource("data_normalized") public void test_normalized(final TemporalField field1, final Number value1, TemporalField expectedField, Number expectedVal) { // mock for testing that does not fully comply with TemporalAccessor contract TemporalAccessor test = new TemporalAccessor() { @@ -202,9 +205,9 @@ public class TestDateTimeBuilderCombinations { String str = value1.toString(); TemporalAccessor temporal = f.parse(str); if (expectedVal != null) { - assertEquals(temporal.getLong(expectedField), expectedVal.longValue()); + assertEquals(expectedVal.longValue(), temporal.getLong(expectedField)); } else { - assertEquals(temporal.isSupported(expectedField), false); + assertEquals(false, temporal.isSupported(expectedField)); } } diff --git a/test/jdk/java/time/test/java/time/temporal/TestDateTimeValueRange.java b/test/jdk/java/time/test/java/time/temporal/TestDateTimeValueRange.java index 570e6634a8a..e3e2f1758b9 100644 --- a/test/jdk/java/time/test/java/time/temporal/TestDateTimeValueRange.java +++ b/test/jdk/java/time/test/java/time/temporal/TestDateTimeValueRange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,7 +59,7 @@ */ package test.java.time.temporal; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -69,15 +69,19 @@ import java.time.DateTimeException; import java.time.temporal.ChronoField; import java.time.temporal.ValueRange; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + import test.java.time.AbstractTest; /** * Test. * @bug 8239520 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestDateTimeValueRange extends AbstractTest { //----------------------------------------------------------------------- @@ -91,63 +95,65 @@ public class TestDateTimeValueRange extends AbstractTest { //----------------------------------------------------------------------- // of(long,long) //----------------------------------------------------------------------- + @Test public void test_of_longlong() { ValueRange test = ValueRange.of(1, 12); - assertEquals(test.getMinimum(), 1); - assertEquals(test.getLargestMinimum(), 1); - assertEquals(test.getSmallestMaximum(), 12); - assertEquals(test.getMaximum(), 12); - assertEquals(test.isFixed(), true); - assertEquals(test.isIntValue(), true); + assertEquals(1, test.getMinimum()); + assertEquals(1, test.getLargestMinimum()); + assertEquals(12, test.getSmallestMaximum()); + assertEquals(12, test.getMaximum()); + assertEquals(true, test.isFixed()); + assertEquals(true, test.isIntValue()); } + @Test public void test_of_longlong_big() { ValueRange test = ValueRange.of(1, 123456789012345L); - assertEquals(test.getMinimum(), 1); - assertEquals(test.getLargestMinimum(), 1); - assertEquals(test.getSmallestMaximum(), 123456789012345L); - assertEquals(test.getMaximum(), 123456789012345L); - assertEquals(test.isFixed(), true); - assertEquals(test.isIntValue(), false); + assertEquals(1, test.getMinimum()); + assertEquals(1, test.getLargestMinimum()); + assertEquals(123456789012345L, test.getSmallestMaximum()); + assertEquals(123456789012345L, test.getMaximum()); + assertEquals(true, test.isFixed()); + assertEquals(false, test.isIntValue()); } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test public void test_of_longlong_minGtMax() { - ValueRange.of(12, 1); + Assertions.assertThrows(IllegalArgumentException.class, () -> ValueRange.of(12, 1)); } //----------------------------------------------------------------------- // of(long,long,long) //----------------------------------------------------------------------- + @Test public void test_of_longlonglong() { ValueRange test = ValueRange.of(1, 28, 31); - assertEquals(test.getMinimum(), 1); - assertEquals(test.getLargestMinimum(), 1); - assertEquals(test.getSmallestMaximum(), 28); - assertEquals(test.getMaximum(), 31); - assertEquals(test.isFixed(), false); - assertEquals(test.isIntValue(), true); + assertEquals(1, test.getMinimum()); + assertEquals(1, test.getLargestMinimum()); + assertEquals(28, test.getSmallestMaximum()); + assertEquals(31, test.getMaximum()); + assertEquals(false, test.isFixed()); + assertEquals(true, test.isIntValue()); } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test public void test_of_longlonglong_minGtMax() { - ValueRange.of(12, 1, 2); + Assertions.assertThrows(IllegalArgumentException.class, () -> ValueRange.of(12, 1, 2)); } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test public void test_of_longlonglong_smallestmaxminGtMax() { - ValueRange.of(1, 31, 28); + Assertions.assertThrows(IllegalArgumentException.class, () -> ValueRange.of(1, 31, 28)); } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test public void test_of_longlonglong_minGtSmallestMax() { - ValueRange.of(5, 2, 10); + Assertions.assertThrows(IllegalArgumentException.class, () -> ValueRange.of(5, 2, 10)); } //----------------------------------------------------------------------- // of(long,long,long,long) //----------------------------------------------------------------------- - @DataProvider(name="valid") Object[][] data_valid() { return new Object[][] { {1, 1, 1, 1}, @@ -162,18 +168,18 @@ public class TestDateTimeValueRange extends AbstractTest { }; } - @Test(dataProvider="valid") + @ParameterizedTest + @MethodSource("data_valid") public void test_of_longlonglonglong(long sMin, long lMin, long sMax, long lMax) { ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); - assertEquals(test.getMinimum(), sMin); - assertEquals(test.getLargestMinimum(), lMin); - assertEquals(test.getSmallestMaximum(), sMax); - assertEquals(test.getMaximum(), lMax); - assertEquals(test.isFixed(), sMin == lMin && sMax == lMax); - assertEquals(test.isIntValue(), true); + assertEquals(sMin, test.getMinimum()); + assertEquals(lMin, test.getLargestMinimum()); + assertEquals(sMax, test.getSmallestMaximum()); + assertEquals(lMax, test.getMaximum()); + assertEquals(sMin == lMin && sMax == lMax, test.isFixed()); + assertEquals(true, test.isIntValue()); } - @DataProvider(name="invalid") Object[][] data_invalid() { return new Object[][] { {1, 2, 31, 28}, @@ -192,118 +198,138 @@ public class TestDateTimeValueRange extends AbstractTest { }; } - @Test(dataProvider="invalid", expectedExceptions=IllegalArgumentException.class) + @ParameterizedTest + @MethodSource("data_invalid") public void test_of_longlonglonglong_invalid(long sMin, long lMin, long sMax, long lMax) { - ValueRange.of(sMin, lMin, sMax, lMax); + Assertions.assertThrows(IllegalArgumentException.class, () -> ValueRange.of(sMin, lMin, sMax, lMax)); } //----------------------------------------------------------------------- // isValidValue(long) //----------------------------------------------------------------------- + @Test public void test_isValidValue_long() { ValueRange test = ValueRange.of(1, 28, 31); - assertEquals(test.isValidValue(0), false); - assertEquals(test.isValidValue(1), true); - assertEquals(test.isValidValue(2), true); - assertEquals(test.isValidValue(30), true); - assertEquals(test.isValidValue(31), true); - assertEquals(test.isValidValue(32), false); + assertEquals(false, test.isValidValue(0)); + assertEquals(true, test.isValidValue(1)); + assertEquals(true, test.isValidValue(2)); + assertEquals(true, test.isValidValue(30)); + assertEquals(true, test.isValidValue(31)); + assertEquals(false, test.isValidValue(32)); } //----------------------------------------------------------------------- // isValidIntValue(long) //----------------------------------------------------------------------- + @Test public void test_isValidValue_long_int() { ValueRange test = ValueRange.of(1, 28, 31); - assertEquals(test.isValidValue(0), false); - assertEquals(test.isValidValue(1), true); - assertEquals(test.isValidValue(31), true); - assertEquals(test.isValidValue(32), false); + assertEquals(false, test.isValidValue(0)); + assertEquals(true, test.isValidValue(1)); + assertEquals(true, test.isValidValue(31)); + assertEquals(false, test.isValidValue(32)); } + @Test public void test_isValidValue_long_long() { ValueRange test = ValueRange.of(1, 28, Integer.MAX_VALUE + 1L); - assertEquals(test.isValidIntValue(0), false); - assertEquals(test.isValidIntValue(1), false); - assertEquals(test.isValidIntValue(31), false); - assertEquals(test.isValidIntValue(32), false); + assertEquals(false, test.isValidIntValue(0)); + assertEquals(false, test.isValidIntValue(1)); + assertEquals(false, test.isValidIntValue(31)); + assertEquals(false, test.isValidIntValue(32)); } //----------------------------------------------------------------------- // checkValidValue //----------------------------------------------------------------------- - @Test(dataProvider="valid") + @ParameterizedTest + @MethodSource("data_valid") public void test_of_checkValidValue(long sMin, long lMin, long sMax, long lMax) { ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); - assertEquals(test.checkValidIntValue(sMin, null), sMin); - assertEquals(test.checkValidIntValue(lMin, null), lMin); - assertEquals(test.checkValidIntValue(sMax, null), sMax); - assertEquals(test.checkValidIntValue(lMax, null), lMax); + assertEquals(sMin, test.checkValidIntValue(sMin, null)); + assertEquals(lMin, test.checkValidIntValue(lMin, null)); + assertEquals(sMax, test.checkValidIntValue(sMax, null)); + assertEquals(lMax, test.checkValidIntValue(lMax, null)); } - @Test(dataProvider="valid", expectedExceptions = DateTimeException.class) + @ParameterizedTest + @MethodSource("data_valid") public void test_of_checkValidValueMinException(long sMin, long lMin, long sMax, long lMax) { - ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); - test.checkValidIntValue(sMin-1, null); + Assertions.assertThrows(DateTimeException.class, () -> { + ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); + test.checkValidIntValue(sMin-1, null); + }); } - @Test(dataProvider="valid", expectedExceptions = DateTimeException.class) + @ParameterizedTest + @MethodSource("data_valid") public void test_of_checkValidValueMaxException(long sMin, long lMin, long sMax, long lMax) { - ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); - test.checkValidIntValue(lMax+1, null); + Assertions.assertThrows(DateTimeException.class, () -> { + ValueRange test = ValueRange.of(sMin, lMin, sMax, lMax); + test.checkValidIntValue(lMax+1, null); + }); } - @Test(expectedExceptions = DateTimeException.class) + @Test public void test_checkValidValueUnsupported_long_long() { - ValueRange test = ValueRange.of(1, 28, Integer.MAX_VALUE + 1L); - test.checkValidIntValue(0, (ChronoField)null); + Assertions.assertThrows(DateTimeException.class, () -> { + ValueRange test = ValueRange.of(1, 28, Integer.MAX_VALUE + 1L); + test.checkValidIntValue(0, (ChronoField)null); + }); } - @Test(expectedExceptions = DateTimeException.class) + @Test public void test_checkValidValueInvalid_long_long() { - ValueRange test = ValueRange.of(1, 28, Integer.MAX_VALUE + 1L); - test.checkValidIntValue(Integer.MAX_VALUE + 2L, (ChronoField)null); + Assertions.assertThrows(DateTimeException.class, () -> { + ValueRange test = ValueRange.of(1, 28, Integer.MAX_VALUE + 1L); + test.checkValidIntValue(Integer.MAX_VALUE + 2L, (ChronoField)null); + }); } //----------------------------------------------------------------------- // equals() / hashCode() //----------------------------------------------------------------------- + @Test public void test_equals1() { ValueRange a = ValueRange.of(1, 2, 3, 4); ValueRange b = ValueRange.of(1, 2, 3, 4); - assertEquals(a.equals(a), true); - assertEquals(a.equals(b), true); - assertEquals(b.equals(a), true); - assertEquals(b.equals(b), true); - assertEquals(a.hashCode() == b.hashCode(), true); + assertEquals(true, a.equals(a)); + assertEquals(true, a.equals(b)); + assertEquals(true, b.equals(a)); + assertEquals(true, b.equals(b)); + assertEquals(true, a.hashCode() == b.hashCode()); } + @Test public void test_equals2() { ValueRange a = ValueRange.of(1, 2, 3, 4); - assertEquals(a.equals(ValueRange.of(0, 2, 3, 4)), false); - assertEquals(a.equals(ValueRange.of(1, 3, 3, 4)), false); - assertEquals(a.equals(ValueRange.of(1, 2, 4, 4)), false); - assertEquals(a.equals(ValueRange.of(1, 2, 3, 5)), false); + assertEquals(false, a.equals(ValueRange.of(0, 2, 3, 4))); + assertEquals(false, a.equals(ValueRange.of(1, 3, 3, 4))); + assertEquals(false, a.equals(ValueRange.of(1, 2, 4, 4))); + assertEquals(false, a.equals(ValueRange.of(1, 2, 3, 5))); } + @Test public void test_equals_otherType() { ValueRange a = ValueRange.of(1, 12); - assertEquals(a.equals("Rubbish"), false); + assertEquals(false, a.equals("Rubbish")); } + @Test public void test_equals_null() { ValueRange a = ValueRange.of(1, 12); - assertEquals(a.equals(null), false); + assertEquals(false, a.equals(null)); } //----------------------------------------------------------------------- // toString() //----------------------------------------------------------------------- + @Test public void test_toString() { - assertEquals(ValueRange.of(1, 1, 4, 4).toString(), "1 - 4"); - assertEquals(ValueRange.of(1, 1, 3, 4).toString(), "1 - 3/4"); - assertEquals(ValueRange.of(1, 2, 3, 4).toString(), "1/2 - 3/4"); - assertEquals(ValueRange.of(1, 2, 4, 4).toString(), "1/2 - 4"); + assertEquals("1 - 4", ValueRange.of(1, 1, 4, 4).toString()); + assertEquals("1 - 3/4", ValueRange.of(1, 1, 3, 4).toString()); + assertEquals("1/2 - 3/4", ValueRange.of(1, 2, 3, 4).toString()); + assertEquals("1/2 - 4", ValueRange.of(1, 2, 4, 4).toString()); } } diff --git a/test/jdk/java/time/test/java/time/temporal/TestIsoFields.java b/test/jdk/java/time/test/java/time/temporal/TestIsoFields.java index 53cd721c0e5..8a74582d976 100644 --- a/test/jdk/java/time/test/java/time/temporal/TestIsoFields.java +++ b/test/jdk/java/time/test/java/time/temporal/TestIsoFields.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 @@ -26,8 +26,9 @@ import static java.time.temporal.IsoFields.DAY_OF_QUARTER; import static java.time.temporal.IsoFields.QUARTER_OF_YEAR; import static java.time.temporal.IsoFields.WEEK_BASED_YEAR; import static java.time.temporal.IsoFields.WEEK_OF_WEEK_BASED_YEAR; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.LocalDate; import java.time.chrono.ChronoLocalDate; @@ -38,15 +39,16 @@ import java.time.temporal.TemporalField; import java.time.temporal.ValueRange; import java.util.List; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Tests fields in IsoFields class are supported in Japanese/Minguo/ThaiBuddhist * date classes * @bug 8279185 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestIsoFields { private static final LocalDate ld = LocalDate.of(2022, 2, 25); private static final ChronoLocalDate J_DATE = JapaneseDate.from(ld); @@ -54,7 +56,6 @@ public class TestIsoFields { private static final ChronoLocalDate TB_DATE = ThaiBuddhistDate.from(ld); private static final List CLDATES = List.of(J_DATE, M_DATE, TB_DATE); - @DataProvider(name = "isSupported") Object[][] data_isSupported() { return new Object[][]{ {DAY_OF_QUARTER}, @@ -64,7 +65,6 @@ public class TestIsoFields { }; } - @DataProvider(name = "range") Object[][] data_range() { return new Object[][]{ {J_DATE, DAY_OF_QUARTER, ValueRange.of(1, 90)}, @@ -82,7 +82,6 @@ public class TestIsoFields { }; } - @DataProvider(name = "with_getLong") Object[][] data_with_getLong() { return new Object[][]{ {DAY_OF_QUARTER, 45}, @@ -92,24 +91,27 @@ public class TestIsoFields { }; } - @Test(dataProvider = "isSupported") + @ParameterizedTest + @MethodSource("data_isSupported") public void test_isSupported(TemporalField f) { CLDATES.forEach(d -> assertTrue(d.isSupported(f))); } - @Test(dataProvider = "range") + @ParameterizedTest + @MethodSource("data_range") public void test_range(ChronoLocalDate cld, TemporalField f, ValueRange r) { - assertEquals(cld.range(f), r); + assertEquals(r, cld.range(f)); } - @Test(dataProvider = "with_getLong") + @ParameterizedTest + @MethodSource("data_with_getLong") public void test_with_getLong(TemporalField f, long val) { CLDATES.forEach(d -> { var min = d.range(f).getMinimum(); var max = d.range(f).getMaximum(); - assertEquals(d.with(f, min).getLong(f), min); - assertEquals(d.with(f, max).getLong(f), max); - assertEquals(d.with(f, val).getLong(f), val); + assertEquals(min, d.with(f, min).getLong(f)); + assertEquals(max, d.with(f, max).getLong(f)); + assertEquals(val, d.with(f, val).getLong(f)); }); } } diff --git a/test/jdk/java/time/test/java/time/temporal/TestIsoWeekFields.java b/test/jdk/java/time/test/java/time/temporal/TestIsoWeekFields.java index 4c40e7278ed..80caa3ffcc1 100644 --- a/test/jdk/java/time/test/java/time/temporal/TestIsoWeekFields.java +++ b/test/jdk/java/time/test/java/time/temporal/TestIsoWeekFields.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -23,8 +23,9 @@ package test.java.time.temporal; import static java.time.temporal.ChronoField.DAY_OF_WEEK; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.DayOfWeek; import java.time.LocalDate; @@ -40,16 +41,17 @@ import java.time.temporal.TemporalField; import java.time.temporal.ValueRange; import java.time.temporal.WeekFields; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * Test. */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestIsoWeekFields { - @DataProvider(name = "fields") Object[][] data_Fields() { return new Object[][] { {IsoFields.WEEK_OF_WEEK_BASED_YEAR, IsoFields.WEEK_BASED_YEAR}, @@ -60,92 +62,101 @@ public class TestIsoWeekFields { //----------------------------------------------------------------------- // WEEK_OF_WEEK_BASED_YEAR //----------------------------------------------------------------------- - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WOWBY_basics(TemporalField weekField, TemporalField yearField) { - assertEquals(weekField.isDateBased(), true); - assertEquals(weekField.isTimeBased(), false); - assertEquals(weekField.getBaseUnit(), ChronoUnit.WEEKS); - assertEquals(weekField.getRangeUnit(), IsoFields.WEEK_BASED_YEARS); + assertEquals(true, weekField.isDateBased()); + assertEquals(false, weekField.isTimeBased()); + assertEquals(ChronoUnit.WEEKS, weekField.getBaseUnit()); + assertEquals(IsoFields.WEEK_BASED_YEARS, weekField.getRangeUnit()); } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WOWBY_isSupportedBy(TemporalField weekField, TemporalField yearField) { - assertEquals(weekField.isSupportedBy(LocalTime.NOON), false); - assertEquals(weekField.isSupportedBy(MonthDay.of(2, 1)), false); - assertEquals(weekField.isSupportedBy(LocalDate.MIN), true); - assertEquals(weekField.isSupportedBy(OffsetDateTime.MAX), true); - assertEquals(weekField.isSupportedBy(ThaiBuddhistDate.now()), true); + assertEquals(false, weekField.isSupportedBy(LocalTime.NOON)); + assertEquals(false, weekField.isSupportedBy(MonthDay.of(2, 1))); + assertEquals(true, weekField.isSupportedBy(LocalDate.MIN)); + assertEquals(true, weekField.isSupportedBy(OffsetDateTime.MAX)); + assertEquals(true, weekField.isSupportedBy(ThaiBuddhistDate.now())); } @Test public void test_WOWBY_isSupportedBy_fieldsDiffer() { - assertEquals(IsoFields.WEEK_OF_WEEK_BASED_YEAR.isSupportedBy(HijrahDate.now()), false); - assertEquals(WeekFields.ISO.weekOfWeekBasedYear().isSupportedBy(HijrahDate.now()), true); + assertEquals(false, IsoFields.WEEK_OF_WEEK_BASED_YEAR.isSupportedBy(HijrahDate.now())); + assertEquals(true, WeekFields.ISO.weekOfWeekBasedYear().isSupportedBy(HijrahDate.now())); } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WOWBY_range(TemporalField weekField, TemporalField yearField) { - assertEquals(weekField.range(), ValueRange.of(1, 52, 53)); + assertEquals(ValueRange.of(1, 52, 53), weekField.range()); } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WOWBY_rangeRefinedBy(TemporalField weekField, TemporalField yearField) { - assertEquals(weekField.rangeRefinedBy(LocalDate.of(2012, 12, 31)), ValueRange.of(1, 52)); - assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 29)), ValueRange.of(1, 52)); - assertEquals(weekField.rangeRefinedBy(LocalDate.of(2013, 12, 30)), ValueRange.of(1, 52)); - assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 28)), ValueRange.of(1, 52)); - assertEquals(weekField.rangeRefinedBy(LocalDate.of(2014, 12, 29)), ValueRange.of(1, 53)); - assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 3)), ValueRange.of(1, 53)); - assertEquals(weekField.rangeRefinedBy(LocalDate.of(2016, 1, 4)), ValueRange.of(1, 52)); + assertEquals(ValueRange.of(1, 52), weekField.rangeRefinedBy(LocalDate.of(2012, 12, 31))); + assertEquals(ValueRange.of(1, 52), weekField.rangeRefinedBy(LocalDate.of(2013, 12, 29))); + assertEquals(ValueRange.of(1, 52), weekField.rangeRefinedBy(LocalDate.of(2013, 12, 30))); + assertEquals(ValueRange.of(1, 52), weekField.rangeRefinedBy(LocalDate.of(2014, 12, 28))); + assertEquals(ValueRange.of(1, 53), weekField.rangeRefinedBy(LocalDate.of(2014, 12, 29))); + assertEquals(ValueRange.of(1, 53), weekField.rangeRefinedBy(LocalDate.of(2016, 1, 3))); + assertEquals(ValueRange.of(1, 52), weekField.rangeRefinedBy(LocalDate.of(2016, 1, 4))); } //----------------------------------------------------------------------- // WEEK_BASED_YEAR //----------------------------------------------------------------------- - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WBY_basics(TemporalField weekField, TemporalField yearField) { - assertEquals(yearField.isDateBased(), true); - assertEquals(yearField.isTimeBased(), false); - assertEquals(yearField.getBaseUnit(), IsoFields.WEEK_BASED_YEARS); - assertEquals(yearField.getRangeUnit(), ChronoUnit.FOREVER); + assertEquals(true, yearField.isDateBased()); + assertEquals(false, yearField.isTimeBased()); + assertEquals(IsoFields.WEEK_BASED_YEARS, yearField.getBaseUnit()); + assertEquals(ChronoUnit.FOREVER, yearField.getRangeUnit()); } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WBY_isSupportedBy(TemporalField weekField, TemporalField yearField) { - assertEquals(yearField.isSupportedBy(LocalTime.NOON), false); - assertEquals(yearField.isSupportedBy(MonthDay.of(2, 1)), false); - assertEquals(yearField.isSupportedBy(LocalDate.MIN), true); - assertEquals(yearField.isSupportedBy(OffsetDateTime.MAX), true); - assertEquals(yearField.isSupportedBy(ThaiBuddhistDate.now()), true); + assertEquals(false, yearField.isSupportedBy(LocalTime.NOON)); + assertEquals(false, yearField.isSupportedBy(MonthDay.of(2, 1))); + assertEquals(true, yearField.isSupportedBy(LocalDate.MIN)); + assertEquals(true, yearField.isSupportedBy(OffsetDateTime.MAX)); + assertEquals(true, yearField.isSupportedBy(ThaiBuddhistDate.now())); } @Test public void test_WBY_isSupportedBy_ISO() { - assertEquals(IsoFields.WEEK_BASED_YEAR.isSupportedBy(HijrahDate.now()), false); + assertEquals(false, IsoFields.WEEK_BASED_YEAR.isSupportedBy(HijrahDate.now())); } @Test public void test_Unit_isSupportedBy_ISO() { - assertEquals(IsoFields.WEEK_BASED_YEARS.isSupportedBy(LocalDate.now()), true); - assertEquals(IsoFields.WEEK_BASED_YEARS.isSupportedBy(ThaiBuddhistDate.now()), true); - assertEquals(IsoFields.WEEK_BASED_YEARS.isSupportedBy(HijrahDate.now()), false); - assertEquals(IsoFields.QUARTER_YEARS.isSupportedBy(LocalDate.now()), true); - assertEquals(IsoFields.QUARTER_YEARS.isSupportedBy(ThaiBuddhistDate.now()), true); - assertEquals(IsoFields.QUARTER_YEARS.isSupportedBy(HijrahDate.now()), false); + assertEquals(true, IsoFields.WEEK_BASED_YEARS.isSupportedBy(LocalDate.now())); + assertEquals(true, IsoFields.WEEK_BASED_YEARS.isSupportedBy(ThaiBuddhistDate.now())); + assertEquals(false, IsoFields.WEEK_BASED_YEARS.isSupportedBy(HijrahDate.now())); + assertEquals(true, IsoFields.QUARTER_YEARS.isSupportedBy(LocalDate.now())); + assertEquals(true, IsoFields.QUARTER_YEARS.isSupportedBy(ThaiBuddhistDate.now())); + assertEquals(false, IsoFields.QUARTER_YEARS.isSupportedBy(HijrahDate.now())); } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WBY_range(TemporalField weekField, TemporalField yearField) { - assertEquals(yearField.range(), ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE)); + assertEquals(ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE), yearField.range()); } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_WBY_rangeRefinedBy(TemporalField weekField, TemporalField yearField) { - assertEquals(yearField.rangeRefinedBy(LocalDate.of(2012, 12, 31)), ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE)); + assertEquals(ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE), yearField.rangeRefinedBy(LocalDate.of(2012, 12, 31))); } //----------------------------------------------------------------------- - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_getFrom(TemporalField weekField, TemporalField yearField) { // tests every day from 2011 to 2016 inclusive LocalDate date = LocalDate.of(2011, 1, 3); @@ -153,9 +164,9 @@ public class TestIsoWeekFields { int week = 1; int dow = 1; for (int i = 1; i <= ((52 + 52 + 52 + 52 + 53 + 52) * 7); i++) { - assertEquals(yearField.getFrom(date), wby); - assertEquals(weekField.getFrom(date), week); - assertEquals(DAY_OF_WEEK.getFrom(date), dow); + assertEquals(wby, yearField.getFrom(date)); + assertEquals(week, weekField.getFrom(date)); + assertEquals(dow, DAY_OF_WEEK.getFrom(date)); if (dow == 7) { dow = 1; week++; @@ -168,12 +179,13 @@ public class TestIsoWeekFields { } date = date.plusDays(1); } - assertEquals(yearField.getFrom(date), 2017); - assertEquals(weekField.getFrom(date), 1); - assertEquals(DAY_OF_WEEK.getFrom(date), 1); + assertEquals(2017, yearField.getFrom(date)); + assertEquals(1, weekField.getFrom(date)); + assertEquals(1, DAY_OF_WEEK.getFrom(date)); } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_adjustInto_dow(TemporalField weekField, TemporalField yearField) { // tests every day from 2012 to 2016 inclusive LocalDate date = LocalDate.of(2012, 1, 2); @@ -183,9 +195,9 @@ public class TestIsoWeekFields { for (int i = 1; i <= ((52 + 52 + 52 + 53 + 52) * 7); i++) { for (int j = 1; j <= 7; j++) { LocalDate adjusted = DAY_OF_WEEK.adjustInto(date, j); - assertEquals(adjusted.get(DAY_OF_WEEK), j); - assertEquals(adjusted.get(weekField), week); - assertEquals(adjusted.get(yearField), wby); + assertEquals(j, adjusted.get(DAY_OF_WEEK)); + assertEquals(week, adjusted.get(weekField)); + assertEquals(wby, adjusted.get(yearField)); } if (dow == 7) { dow = 1; @@ -201,7 +213,8 @@ public class TestIsoWeekFields { } } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_adjustInto_week(TemporalField weekField, TemporalField yearField) { // tests every day from 2012 to 2016 inclusive LocalDate date = LocalDate.of(2012, 1, 2); @@ -212,9 +225,9 @@ public class TestIsoWeekFields { int weeksInYear = (wby == 2015 ? 53 : 52); for (int j = 1; j <= weeksInYear; j++) { LocalDate adjusted = weekField.adjustInto(date, j); - assertEquals(adjusted.get(weekField), j); - assertEquals(adjusted.get(DAY_OF_WEEK), dow); - assertEquals(adjusted.get(yearField), wby); + assertEquals(j, adjusted.get(weekField)); + assertEquals(dow, adjusted.get(DAY_OF_WEEK)); + assertEquals(wby, adjusted.get(yearField)); } if (dow == 7) { dow = 1; @@ -230,7 +243,8 @@ public class TestIsoWeekFields { } } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_adjustInto_wby(TemporalField weekField, TemporalField yearField) { // tests every day from 2012 to 2016 inclusive LocalDate date = LocalDate.of(2012, 1, 2); @@ -240,9 +254,9 @@ public class TestIsoWeekFields { for (int i = 1; i <= ((52 + 52 + 52 + 53 + 52) * 7); i++) { for (int j = 2004; j <= 2015; j++) { LocalDate adjusted = yearField.adjustInto(date, j); - assertEquals(adjusted.get(yearField), j); - assertEquals(adjusted.get(DAY_OF_WEEK), dow); - assertEquals(adjusted.get(weekField), (week == 53 && wbyLen(j) == 52 ? 52 : week), "" + date + " " + adjusted); + assertEquals(j, adjusted.get(yearField)); + assertEquals(dow, adjusted.get(DAY_OF_WEEK)); + assertEquals((week == 53 && wbyLen(j) == 52 ? 52 : week), adjusted.get(weekField), "" + date + " " + adjusted); } if (dow == 7) { dow = 1; @@ -258,7 +272,8 @@ public class TestIsoWeekFields { } } - @Test(dataProvider = "fields") + @ParameterizedTest + @MethodSource("data_Fields") public void test_addTo_weekBasedYears(TemporalField weekField, TemporalField yearField) { // tests every day from 2012 to 2016 inclusive LocalDate date = LocalDate.of(2012, 1, 2); @@ -268,9 +283,9 @@ public class TestIsoWeekFields { for (int i = 1; i <= ((52 + 52 + 52 + 53 + 52) * 7); i++) { for (int j = -5; j <= 5; j++) { LocalDate adjusted = IsoFields.WEEK_BASED_YEARS.addTo(date, j); - assertEquals(adjusted.get(yearField), wby + j); - assertEquals(adjusted.get(DAY_OF_WEEK), dow); - assertEquals(adjusted.get(weekField), (week == 53 && wbyLen(wby + j) == 52 ? 52 : week), "" + date + " " + adjusted); + assertEquals(wby + j, adjusted.get(yearField)); + assertEquals(dow, adjusted.get(DAY_OF_WEEK)); + assertEquals((week == 53 && wbyLen(wby + j) == 52 ? 52 : week), adjusted.get(weekField), "" + date + " " + adjusted); } if (dow == 7) { dow = 1; diff --git a/test/jdk/java/time/test/java/time/temporal/TestJulianFields.java b/test/jdk/java/time/test/java/time/temporal/TestJulianFields.java index 0d9d79e3158..5ed393d1b87 100644 --- a/test/jdk/java/time/test/java/time/temporal/TestJulianFields.java +++ b/test/jdk/java/time/test/java/time/temporal/TestJulianFields.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -59,16 +59,15 @@ */ package test.java.time.temporal; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.temporal.JulianFields; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test. */ -@Test public class TestJulianFields { //----------------------------------------------------------------------- @@ -76,9 +75,9 @@ public class TestJulianFields { //----------------------------------------------------------------------- @Test public void test_toString() { - assertEquals(JulianFields.JULIAN_DAY.toString(), "JulianDay"); - assertEquals(JulianFields.MODIFIED_JULIAN_DAY.toString(), "ModifiedJulianDay"); - assertEquals(JulianFields.RATA_DIE.toString(), "RataDie"); + assertEquals("JulianDay", JulianFields.JULIAN_DAY.toString()); + assertEquals("ModifiedJulianDay", JulianFields.MODIFIED_JULIAN_DAY.toString()); + assertEquals("RataDie", JulianFields.RATA_DIE.toString()); } } diff --git a/test/jdk/java/time/test/java/time/zone/TestFixedZoneRules.java b/test/jdk/java/time/test/java/time/zone/TestFixedZoneRules.java index d479134c26e..8f52372ab01 100644 --- a/test/jdk/java/time/test/java/time/zone/TestFixedZoneRules.java +++ b/test/jdk/java/time/test/java/time/zone/TestFixedZoneRules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -61,19 +61,18 @@ package test.java.time.zone; import java.time.zone.ZoneRules; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneOffset; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; /** * Test ZoneRules for fixed offset time-zones. */ -@Test public class TestFixedZoneRules { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); @@ -86,16 +85,16 @@ public class TestFixedZoneRules { @Test public void test_data_nullInput() { ZoneRules test = make(OFFSET_PONE); - assertEquals(test.getOffset((Instant) null), OFFSET_PONE); - assertEquals(test.getOffset((LocalDateTime) null), OFFSET_PONE); - assertEquals(test.getValidOffsets(null).size(), 1); - assertEquals(test.getValidOffsets(null).get(0), OFFSET_PONE); - assertEquals(test.getTransition(null), null); - assertEquals(test.getStandardOffset(null), OFFSET_PONE); - assertEquals(test.getDaylightSavings(null), Duration.ZERO); - assertEquals(test.isDaylightSavings(null), false); - assertEquals(test.nextTransition(null), null); - assertEquals(test.previousTransition(null), null); + assertEquals(OFFSET_PONE, test.getOffset((Instant) null)); + assertEquals(OFFSET_PONE, test.getOffset((LocalDateTime) null)); + assertEquals(1, test.getValidOffsets(null).size()); + assertEquals(OFFSET_PONE, test.getValidOffsets(null).get(0)); + assertEquals(null, test.getTransition(null)); + assertEquals(OFFSET_PONE, test.getStandardOffset(null)); + assertEquals(Duration.ZERO, test.getDaylightSavings(null)); + assertEquals(false, test.isDaylightSavings(null)); + assertEquals(null, test.nextTransition(null)); + assertEquals(null, test.previousTransition(null)); } } diff --git a/test/jdk/java/time/test/java/time/zone/TestMutableZoneRules.java b/test/jdk/java/time/test/java/time/zone/TestMutableZoneRules.java index 4474f70db05..a8d7f4746c7 100644 --- a/test/jdk/java/time/test/java/time/zone/TestMutableZoneRules.java +++ b/test/jdk/java/time/test/java/time/zone/TestMutableZoneRules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 @@ -27,16 +27,15 @@ import java.time.*; import java.time.zone.*; import java.util.*; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.Test; /** * @summary ZoneRules invariants can be broken. * * @bug 8246788 */ -@Test public class TestMutableZoneRules { static final ZoneOffset offset = ZoneOffset.ofHoursMinutes(1, 30); @@ -48,16 +47,18 @@ public class TestMutableZoneRules { ZoneOffsetTransitionRule.of(Month.MARCH, 2, DayOfWeek.MONDAY, LocalTime.MIN, true, ZoneOffsetTransitionRule.TimeDefinition.UTC, offset, offset, offset); + @Test public void testMutation() { ZoneOffsetTransitionRule[] array = { rule1 }; ZoneRules zr1 = ZoneRules.of(offset, offset, List.of(), List.of(), List.of(rule1)); ZoneRules zr2 = ZoneRules.of(offset, offset, List.of(), List.of(), new TestList(array, array.length)); - assertEquals(zr2, zr1); + assertEquals(zr1, zr2); array[0] = rule2; - assertEquals(zr2, zr1); + assertEquals(zr1, zr2); } + @Test public void testLength() { ZoneOffsetTransitionRule[] array = new ZoneOffsetTransitionRule[17]; Arrays.setAll(array, i -> rule1); diff --git a/test/jdk/java/time/test/java/time/zone/TestZoneRules.java b/test/jdk/java/time/test/java/time/zone/TestZoneRules.java index 584ed2e56c7..7a1e656ee87 100644 --- a/test/jdk/java/time/test/java/time/zone/TestZoneRules.java +++ b/test/jdk/java/time/test/java/time/zone/TestZoneRules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -40,17 +40,19 @@ import java.time.zone.ZoneRules; import java.util.Collections; import java.util.List; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** * @summary Tests for ZoneRules class. * * @bug 8212970 8236903 8239836 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestZoneRules { private static final ZoneId DUBLIN = ZoneId.of("Europe/Dublin"); @@ -68,7 +70,6 @@ public class TestZoneRules { private static final ZoneOffsetTransition ZOT = ZoneId.of("America/Los_Angeles").getRules().getTransitions().get(0); private static final ZoneOffsetTransitionRule ZOTR = ZoneId.of("America/Los_Angeles").getRules().getTransitionRules().get(0); - @DataProvider private Object[][] negativeDST () { return new Object[][] { // ZoneId, localDate, offset, standard offset, isDaylightSavings @@ -102,7 +103,6 @@ public class TestZoneRules { }; } - @DataProvider private Object[][] transitionBeyondDay() { return new Object[][] { // ZoneId, LocalDateTime, beforeOffset, afterOffset @@ -117,7 +117,6 @@ public class TestZoneRules { }; } - @DataProvider private Object[][] emptyTransitionList() { return new Object[][] { // days, offset, std offset, savings, isDST @@ -126,7 +125,6 @@ public class TestZoneRules { }; } - @DataProvider private Object[][] isFixedOffset() { return new Object[][] { // ZoneRules, expected @@ -144,20 +142,22 @@ public class TestZoneRules { * negative savings in the source TZ files. * @bug 8212970 */ - @Test(dataProvider="negativeDST") + @ParameterizedTest + @MethodSource("negativeDST") public void test_NegativeDST(ZoneId zid, LocalDate ld, ZoneOffset offset, ZoneOffset stdOffset, boolean isDST) { Instant i = Instant.from(ZonedDateTime.of(ld, LocalTime.MIN, zid)); ZoneRules zr = zid.getRules(); - assertEquals(zr.getOffset(i), offset); - assertEquals(zr.getStandardOffset(i), stdOffset); - assertEquals(zr.isDaylightSavings(i), isDST); + assertEquals(offset, zr.getOffset(i)); + assertEquals(stdOffset, zr.getStandardOffset(i)); + assertEquals(isDST, zr.isDaylightSavings(i)); } /** * Check the transition cutover time beyond 24:00, which should translate into the next day. * @bug 8212970 */ - @Test(dataProvider="transitionBeyondDay") + @ParameterizedTest + @MethodSource("transitionBeyondDay") public void test_TransitionBeyondDay(ZoneId zid, LocalDateTime ldt, ZoneOffset before, ZoneOffset after) { ZoneOffsetTransition zot = ZoneOffsetTransition.of(ldt, before, after); ZoneRules zr = zid.getRules(); @@ -198,14 +198,15 @@ public class TestZoneRules { Collections.singletonList(transitionRule)); ZoneOffset offsetA = zoneRulesA.getOffset(maxLocalDateTime); ZoneOffset offsetB = zoneRulesB.getOffset(maxLocalDateTime); - assertEquals(offsetA, offsetB); + assertEquals(offsetB, offsetA); } /** * Tests whether empty "transitionList" is correctly interpreted. * @bug 8239836 */ - @Test(dataProvider="emptyTransitionList") + @ParameterizedTest + @MethodSource("emptyTransitionList") public void test_EmptyTransitionList(int days, int offset, int stdOffset, int savings, boolean isDST) { LocalDateTime transitionDay = LocalDateTime.of(2020, 1, 1, 2, 0); Instant testDay = transitionDay.plusDays(days).toInstant(ZoneOffset.UTC); @@ -217,18 +218,19 @@ public class TestZoneRules { Collections.singletonList(trans), Collections.emptyList(), Collections.emptyList()); - assertEquals(rules.getOffset(testDay), ZoneOffset.ofHours(offset)); - assertEquals(rules.getStandardOffset(testDay), ZoneOffset.ofHours(stdOffset)); - assertEquals(rules.getDaylightSavings(testDay), Duration.ofHours(savings)); - assertEquals(rules.isDaylightSavings(testDay), isDST); + assertEquals(ZoneOffset.ofHours(offset), rules.getOffset(testDay)); + assertEquals(ZoneOffset.ofHours(stdOffset), rules.getStandardOffset(testDay)); + assertEquals(Duration.ofHours(savings), rules.getDaylightSavings(testDay)); + assertEquals(isDST, rules.isDaylightSavings(testDay)); } /** * Tests whether isFixedOffset() is working correctly * @bug 8239836 */ - @Test(dataProvider="isFixedOffset") + @ParameterizedTest + @MethodSource("isFixedOffset") public void test_IsFixedOffset(ZoneRules zr, boolean expected) { - assertEquals(zr.isFixedOffset(), expected); + assertEquals(expected, zr.isFixedOffset()); } } diff --git a/test/jdk/java/time/test/java/time/zone/TestZoneRulesProvider.java b/test/jdk/java/time/test/java/time/zone/TestZoneRulesProvider.java index 3a20dc2b864..6b0463d1b26 100644 --- a/test/jdk/java/time/test/java/time/zone/TestZoneRulesProvider.java +++ b/test/jdk/java/time/test/java/time/zone/TestZoneRulesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 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 @@ -32,17 +32,15 @@ import java.util.LinkedHashSet; import java.util.NavigableMap; import java.util.Set; -import org.testng.annotations.Test; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import org.junit.jupiter.api.Test; /** * @summary Tests for ZoneRulesProvider class. * @bug 8299571 8302983 */ -@Test public class TestZoneRulesProvider { /** diff --git a/test/jdk/java/time/test/java/util/TestFormatter.java b/test/jdk/java/time/test/java/util/TestFormatter.java index 903e48ba96d..72b859e533e 100644 --- a/test/jdk/java/time/test/java/util/TestFormatter.java +++ b/test/jdk/java/time/test/java/util/TestFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -22,7 +22,7 @@ */ package test.java.util; -import static org.testng.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.Instant; import java.time.LocalTime; @@ -42,14 +42,15 @@ import java.time.temporal.UnsupportedTemporalTypeException; import java.util.*; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /* @test * @summary Unit test for j.u.Formatter threeten date/time support * @bug 8003680 8043387 8012638 */ -@Test +@TestInstance(TestInstance.Lifecycle.PER_CLASS) public class TestFormatter { // time @@ -71,7 +72,6 @@ public class TestFormatter { private int failure = 0; private boolean verbose = false; - @DataProvider(name = "calendarsByLocale") Object[][] data_calendars() { return new Object[][] { {"en_US"}, @@ -80,7 +80,8 @@ public class TestFormatter { }; } - @Test(dataProvider="calendarsByLocale") + @ParameterizedTest + @MethodSource("data_calendars") public void test (String calendarLocale) { failure = 0; int N = 12; @@ -128,7 +129,7 @@ public class TestFormatter { System.out.println("All tests (" + total + ") PASSED"); } } - assertEquals(failure, 0); + assertEquals(0, failure); } private String getClassName(Object o) { From 7c979c148724ab7de650593caa22df8405d740e5 Mon Sep 17 00:00:00 2001 From: David Beaumont Date: Tue, 6 Jan 2026 19:54:49 +0000 Subject: [PATCH 53/56] 8374308: ImageBufferCache has no effect and can be removed Reviewed-by: alanb, rriggs --- .../jdk/internal/jimage/BasicImageReader.java | 42 ++--- .../jdk/internal/jimage/ImageBufferCache.java | 158 ------------------ .../jdk/internal/jimage/ImageReader.java | 17 +- .../internal/module/SystemModuleFinders.java | 8 +- 4 files changed, 16 insertions(+), 209 deletions(-) delete mode 100644 src/java.base/share/classes/jdk/internal/jimage/ImageBufferCache.java diff --git a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java index 6807928b2c2..10aa0397f0c 100644 --- a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java +++ b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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 @@ -220,14 +220,6 @@ public class BasicImageReader implements AutoCloseable { return slice(buffer, offset, size).order(byteOrder).asIntBuffer(); } - public static void releaseByteBuffer(ByteBuffer buffer) { - Objects.requireNonNull(buffer); - - if (!MAP_ALL) { - ImageBufferCache.releaseBuffer(buffer); - } - } - public String getName() { return name; } @@ -362,13 +354,15 @@ public class BasicImageReader implements AutoCloseable { if (offset < 0 || Integer.MAX_VALUE <= offset) { throw new IndexOutOfBoundsException("Bad offset: " + offset); } + int checkedOffset = (int) offset; if (size < 0 || Integer.MAX_VALUE <= size) { - throw new IndexOutOfBoundsException("Bad size: " + size); + throw new IllegalArgumentException("Bad size: " + size); } + int checkedSize = (int) size; if (MAP_ALL) { - ByteBuffer buffer = slice(memoryMap, (int)offset, (int)size); + ByteBuffer buffer = slice(memoryMap, checkedOffset, checkedSize); buffer.order(ByteOrder.BIG_ENDIAN); return buffer; @@ -376,21 +370,18 @@ public class BasicImageReader implements AutoCloseable { if (channel == null) { throw new InternalError("Image file channel not open"); } - - ByteBuffer buffer = ImageBufferCache.getBuffer(size); + ByteBuffer buffer = ByteBuffer.allocate(checkedSize); int read; try { - read = channel.read(buffer, offset); + read = channel.read(buffer, checkedOffset); buffer.rewind(); } catch (IOException ex) { - ImageBufferCache.releaseBuffer(buffer); throw new RuntimeException(ex); } - if (read != size) { - ImageBufferCache.releaseBuffer(buffer); + if (read != checkedSize) { throw new RuntimeException("Short read: " + read + - " instead of " + size + " bytes"); + " instead of " + checkedSize + " bytes"); } return buffer; @@ -406,17 +397,12 @@ public class BasicImageReader implements AutoCloseable { public byte[] getResource(ImageLocation loc) { ByteBuffer buffer = getResourceBuffer(loc); - - if (buffer != null) { - byte[] bytes = getBufferBytes(buffer); - ImageBufferCache.releaseBuffer(buffer); - - return bytes; - } - - return null; + return buffer != null ? getBufferBytes(buffer) : null; } + /** + * Returns the content of jimage location in a newly allocated byte buffer. + */ public ByteBuffer getResourceBuffer(ImageLocation loc) { Objects.requireNonNull(loc); long offset = loc.getContentOffset() + indexSize; @@ -437,10 +423,8 @@ public class BasicImageReader implements AutoCloseable { return readBuffer(offset, uncompressedSize); } else { ByteBuffer buffer = readBuffer(offset, compressedSize); - if (buffer != null) { byte[] bytesIn = getBufferBytes(buffer); - ImageBufferCache.releaseBuffer(buffer); byte[] bytesOut; try { diff --git a/src/java.base/share/classes/jdk/internal/jimage/ImageBufferCache.java b/src/java.base/share/classes/jdk/internal/jimage/ImageBufferCache.java deleted file mode 100644 index c2cc4a028be..00000000000 --- a/src/java.base/share/classes/jdk/internal/jimage/ImageBufferCache.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2014, 2016, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.internal.jimage; - -import java.lang.ref.WeakReference; -import java.nio.ByteBuffer; -import java.util.AbstractMap; -import java.util.Arrays; -import java.util.Comparator; -import java.util.Map; - -/** - * @implNote This class needs to maintain JDK 8 source compatibility. - * - * It is used internally in the JDK to implement jimage/jrtfs access, - * but also compiled and delivered as part of the jrt-fs.jar to support access - * to the jimage file provided by the shipped JDK by tools running on JDK 8. - */ -class ImageBufferCache { - private static final int MAX_CACHED_BUFFERS = 3; - private static final int LARGE_BUFFER = 0x10000; - - /* - * We used to have a class BufferReference extending from WeakReference. - * BufferReference class had an instance field called "capacity". This field was - * used to make DECREASING_CAPACITY_NULLS_LAST comparator stable in the presence - * of GC clearing the WeakReference concurrently. - * - * But this scheme results in metaspace leak. The thread local is alive till the - * the thread is alive. And so ImageBufferCache$BufferReference class was kept alive. - * Because this class and ImageBufferCache$BufferReference are all loaded by a URL - * class loader from jrt-fs.jar, the class loader and so all the classes loaded by it - * were alive! - * - * Solution is to avoid using a URL loader loaded class type with thread local. All we - * need is a pair of WeakReference, Integer (saved capacity for stability - * of comparator). We use Map.Entry as pair implementation. With this, all types used - * with thread local are bootstrap types and so no metaspace leak. - */ - @SuppressWarnings("unchecked") - private static final ThreadLocal, Integer>[]> CACHE = - new ThreadLocal, Integer>[]>() { - @Override - protected Map.Entry, Integer>[] initialValue() { - // 1 extra slot to simplify logic of releaseBuffer() - return (Map.Entry, Integer>[])new Map.Entry[MAX_CACHED_BUFFERS + 1]; - } - }; - - private static ByteBuffer allocateBuffer(long size) { - return ByteBuffer.allocateDirect((int)((size + 0xFFF) & ~0xFFF)); - } - - static ByteBuffer getBuffer(long size) { - if (size < 0 || Integer.MAX_VALUE < size) { - throw new IndexOutOfBoundsException("size"); - } - - ByteBuffer result = null; - - if (size > LARGE_BUFFER) { - result = allocateBuffer(size); - } else { - Map.Entry, Integer>[] cache = CACHE.get(); - - // buffers are ordered by decreasing capacity - // cache[MAX_CACHED_BUFFERS] is always null - for (int i = MAX_CACHED_BUFFERS - 1; i >= 0; i--) { - Map.Entry, Integer> reference = cache[i]; - - if (reference != null) { - ByteBuffer buffer = getByteBuffer(reference); - - if (buffer != null && size <= buffer.capacity()) { - cache[i] = null; - result = buffer; - result.rewind(); - break; - } - } - } - - if (result == null) { - result = allocateBuffer(size); - } - } - - result.limit((int)size); - - return result; - } - - static void releaseBuffer(ByteBuffer buffer) { - if (buffer.capacity() > LARGE_BUFFER) { - return; - } - - Map.Entry, Integer>[] cache = CACHE.get(); - - // expunge cleared BufferRef(s) - for (int i = 0; i < MAX_CACHED_BUFFERS; i++) { - Map.Entry, Integer> reference = cache[i]; - if (reference != null && getByteBuffer(reference) == null) { - cache[i] = null; - } - } - - // insert buffer back with new BufferRef wrapping it - cache[MAX_CACHED_BUFFERS] = newCacheEntry(buffer); - Arrays.sort(cache, DECREASING_CAPACITY_NULLS_LAST); - // squeeze the smallest one out - cache[MAX_CACHED_BUFFERS] = null; - } - - private static Map.Entry, Integer> newCacheEntry(ByteBuffer bb) { - return new AbstractMap.SimpleEntry, Integer>( - new WeakReference(bb), bb.capacity()); - } - - private static int getCapacity(Map.Entry, Integer> e) { - return e == null? 0 : e.getValue(); - } - - private static ByteBuffer getByteBuffer(Map.Entry, Integer> e) { - return e == null? null : e.getKey().get(); - } - - private static Comparator, Integer>> DECREASING_CAPACITY_NULLS_LAST = - new Comparator, Integer>>() { - @Override - public int compare(Map.Entry, Integer> br1, - Map.Entry, Integer> br2) { - return Integer.compare(getCapacity(br1), getCapacity(br2)); - } - }; -} diff --git a/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java b/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java index e062e1629ff..c36e265ee2f 100644 --- a/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java +++ b/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2026, 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 @@ -190,20 +190,7 @@ public final class ImageReader implements AutoCloseable { } /** - * Releases a (possibly cached) {@link ByteBuffer} obtained via - * {@link #getResourceBuffer(Node)}. - * - *

Note that no testing is performed to check whether the buffer about - * to be released actually came from a call to {@code getResourceBuffer()}. - */ - public static void releaseByteBuffer(ByteBuffer buffer) { - BasicImageReader.releaseByteBuffer(buffer); - } - - /** - * Returns the content of a resource node in a possibly cached byte buffer. - * Callers of this method must call {@link #releaseByteBuffer(ByteBuffer)} - * when they are finished with it. + * Returns the content of a resource node in a newly allocated byte buffer. */ public ByteBuffer getResourceBuffer(Node node) { requireOpen(); diff --git a/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java b/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java index 370c151af84..afebb89168c 100644 --- a/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java +++ b/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2026, 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 @@ -467,12 +467,6 @@ public final class SystemModuleFinders { .map(reader::getResourceBuffer); } - @Override - public void release(ByteBuffer bb) { - Objects.requireNonNull(bb); - ImageReader.releaseByteBuffer(bb); - } - @Override public Stream list() throws IOException { if (closed) From 6b3c1e0f786a889d2ac25c8bd05f4d83e666425f Mon Sep 17 00:00:00 2001 From: Alexey Semenyuk Date: Tue, 6 Jan 2026 23:56:59 +0000 Subject: [PATCH 54/56] 8373833: "error.cert.not.found" and "error.explicit-sign-no-cert" errors duplicate each other Reviewed-by: almatvee --- .../jdk/jpackage/internal/SigningIdentityBuilder.java | 11 +++++------ .../internal/resources/MacResources.properties | 4 +--- test/jdk/tools/jpackage/share/ErrorTest.java | 8 +------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java index 87193783041..0f753c07569 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/SigningIdentityBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -40,6 +40,7 @@ import javax.naming.ldap.Rdn; import javax.security.auth.x500.X500Principal; import jdk.jpackage.internal.MacCertificateUtils.CertificateHash; import jdk.jpackage.internal.model.ConfigException; +import jdk.jpackage.internal.model.JPackageException; import jdk.jpackage.internal.model.SigningIdentity; final class SigningIdentityBuilder { @@ -147,11 +148,9 @@ final class SigningIdentityBuilder { Objects.requireNonNull(keychain); switch (certs.size()) { case 0 -> { - var errMsg = I18N.format("error.cert.not.found", certificateSelector.signingIdentities().getFirst(), - keychain.map(Keychain::name).orElse("")); - Log.error(I18N.format("message.error-header", errMsg)); - throw I18N.buildConfigException("error.explicit-sign-no-cert") - .advice("error.explicit-sign-no-cert.advice").create(); + throw new JPackageException(I18N.format("error.cert.not.found", + certificateSelector.signingIdentities().getFirst(), + keychain.map(Keychain::name).orElse(""))); } case 1 -> { return certs.getFirst(); diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties index d01297aa814..240e82dcc9b 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2026, 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 @@ -24,8 +24,6 @@ # # error.invalid-cfbundle-version.advice=Set a compatible 'app-version' value. Valid versions are one to three integers separated by dots. -error.explicit-sign-no-cert=Signature explicitly requested but no signing certificate found -error.explicit-sign-no-cert.advice=Specify a valid mac-signing-key-user-name and mac-signing-keychain error.certificate.expired=Certificate expired {0} error.cert.not.found=No certificate found matching [{0}] using keychain [{1}] error.multiple.certs.found=Multiple certificates matching name [{0}] found in keychain [{1}] diff --git a/test/jdk/tools/jpackage/share/ErrorTest.java b/test/jdk/tools/jpackage/share/ErrorTest.java index 955c17e6043..bc12577fa20 100644 --- a/test/jdk/tools/jpackage/share/ErrorTest.java +++ b/test/jdk/tools/jpackage/share/ErrorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2026, 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 @@ -707,12 +707,6 @@ public final class ErrorTest { final List errorMessages = new ArrayList<>(); errorMessages.add(makeError(JPackageStringBundle.MAIN.cannedFormattedString( "error.cert.not.found", "Developer ID Application: " + signingId, ""))); - errorMessages.addAll(Stream.of( - Map.>entry("error.explicit-sign-no-cert", JPackageCommand::makeError), - Map.>entry("error.explicit-sign-no-cert.advice", JPackageCommand::makeAdvice) - ).map(e -> { - return e.getValue().apply(JPackageStringBundle.MAIN.cannedFormattedString(e.getKey())); - }).toList()); final var cmd = JPackageCommand.helloAppImage() .ignoreDefaultVerbose(true) From 5c6947f736568413d53d5a00de2e865f86e637c4 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 7 Jan 2026 06:30:14 +0000 Subject: [PATCH 55/56] 8373429: gc/g1/TestCodeCacheUnloadDuringConcCycle fails on various platforms Reviewed-by: mbaesken, mdoerr --- .../jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java b/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java index af746ad206d..e36ccace9dc 100644 --- a/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java +++ b/test/hotspot/jtreg/gc/g1/TestCodeCacheUnloadDuringConcCycle.java @@ -53,9 +53,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import jdk.test.lib.Asserts; +import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import static jdk.test.lib.Asserts.*; import jdk.test.whitebox.WhiteBox; public class TestCodeCacheUnloadDuringConcCycle { @@ -70,9 +70,10 @@ public class TestCodeCacheUnloadDuringConcCycle { "-Xbootclasspath/a:.", "-Xlog:gc=trace,codecache", "-XX:+WhiteBoxAPI", - "-XX:ReservedCodeCacheSize=8M", + "-XX:ReservedCodeCacheSize=" + (Platform.is32bit() ? "4M" : "8M"), "-XX:StartAggressiveSweepingAt=50", "-XX:CompileCommand=compileonly,gc.g1.SomeClass::*", + "-XX:CompileCommand=compileonly,gc.g1.Foo*::*", TestCodeCacheUnloadDuringConcCycleRunner.class.getName(), concPhase); return output; @@ -140,7 +141,7 @@ class TestCodeCacheUnloadDuringConcCycleRunner { System.out.println("Compiled " + i + " classes"); } i++; - } while (i < 1000); + } while (i < 200); System.out.println("Compilation done, compiled " + i + " classes"); } catch (Throwable t) { } From c1c0ac877033c3edb0c2681c2c5f825be8adcfb3 Mon Sep 17 00:00:00 2001 From: Damon Fenacci Date: Wed, 7 Jan 2026 07:29:00 +0000 Subject: [PATCH 56/56] 8342772: Assert in LateInlineMHCallGenerator::do_late_inline_check Reviewed-by: vlivanov, chagedorn, thartmann --- src/hotspot/share/opto/callGenerator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/opto/callGenerator.cpp b/src/hotspot/share/opto/callGenerator.cpp index db03dd9d80c..1465da02ac8 100644 --- a/src/hotspot/share/opto/callGenerator.cpp +++ b/src/hotspot/share/opto/callGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2026, 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 @@ -418,7 +418,8 @@ bool LateInlineMHCallGenerator::do_late_inline_check(Compile* C, JVMState* jvms) C->inline_printer()->record(cg->method(), call_node()->jvms(), InliningResult::FAILURE, "late method handle call resolution"); } - assert(!cg->is_late_inline() || cg->is_mh_late_inline() || AlwaysIncrementalInline || StressIncrementalInlining, "we're doing late inlining"); + assert(!cg->is_late_inline() || cg->is_mh_late_inline() || cg->is_virtual_late_inline() || + AlwaysIncrementalInline || StressIncrementalInlining, "we're doing late inlining"); _inline_cg = cg; return true; } else {