diff --git a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp index 836caa86cb0..017e86a9dc3 100644 --- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp @@ -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, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -503,7 +503,7 @@ void InterpreterMacroAssembler::remove_activation( // get method access flags ldr(r1, Address(rfp, frame::interpreter_frame_method_offset * wordSize)); - ldr(r2, Address(r1, Method::access_flags_offset())); + ldrh(r2, Address(r1, Method::access_flags_offset())); tbz(r2, exact_log2(JVM_ACC_SYNCHRONIZED), unlocked); // Don't unlock anything if the _do_not_unlock_if_synchronized flag diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp index fa48092fd50..6010ddd25fe 100644 --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp @@ -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, 2021, 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. @@ -760,7 +760,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm Label L_skip_barrier; { // Bypass the barrier for non-static methods - __ ldrw(rscratch1, Address(rmethod, Method::access_flags_offset())); + __ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset())); __ andsw(zr, rscratch1, JVM_ACC_STATIC); __ br(Assembler::EQ, L_skip_barrier); // non-static } diff --git a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp index f70450b7222..0a3240fa56e 100644 --- a/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp @@ -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, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -809,7 +809,7 @@ void TemplateInterpreterGenerator::lock_method() { #ifdef ASSERT { Label L; - __ ldrw(r0, access_flags); + __ ldrh(r0, access_flags); __ tst(r0, JVM_ACC_SYNCHRONIZED); __ br(Assembler::NE, L); __ stop("method doesn't need synchronization"); @@ -820,7 +820,7 @@ void TemplateInterpreterGenerator::lock_method() { // get synchronization object { Label done; - __ ldrw(r0, access_flags); + __ ldrh(r0, access_flags); __ tst(r0, JVM_ACC_STATIC); // get receiver (assume this is frequent case) __ ldr(r0, Address(rlocals, Interpreter::local_offset_in_bytes(0))); @@ -1225,7 +1225,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // make sure method is native & not abstract #ifdef ASSERT - __ ldrw(r0, access_flags); + __ ldrh(r0, access_flags); { Label L; __ tst(r0, JVM_ACC_NATIVE); @@ -1277,7 +1277,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { #ifdef ASSERT { Label L; - __ ldrw(r0, access_flags); + __ ldrh(r0, access_flags); __ tst(r0, JVM_ACC_SYNCHRONIZED); __ br(Assembler::EQ, L); __ stop("method needs synchronization"); @@ -1354,7 +1354,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // pass mirror handle if static call { Label L; - __ ldrw(t, Address(rmethod, Method::access_flags_offset())); + __ ldrh(t, Address(rmethod, Method::access_flags_offset())); __ tbz(t, exact_log2(JVM_ACC_STATIC), L); // get mirror __ load_mirror(t, rmethod, r10, rscratch2); @@ -1564,7 +1564,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // do unlocking if necessary { Label L; - __ ldrw(t, Address(rmethod, Method::access_flags_offset())); + __ ldrh(t, Address(rmethod, Method::access_flags_offset())); __ tbz(t, exact_log2(JVM_ACC_SYNCHRONIZED), L); // the code below should be shared with interpreter macro // assembler implementation @@ -1695,7 +1695,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // make sure method is not native & not abstract #ifdef ASSERT - __ ldrw(r0, access_flags); + __ ldrh(r0, access_flags); { Label L; __ tst(r0, JVM_ACC_NATIVE); @@ -1751,7 +1751,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { #ifdef ASSERT { Label L; - __ ldrw(r0, access_flags); + __ ldrh(r0, access_flags); __ tst(r0, JVM_ACC_SYNCHRONIZED); __ br(Assembler::EQ, L); __ stop("method needs synchronization"); diff --git a/src/hotspot/cpu/arm/interp_masm_arm.cpp b/src/hotspot/cpu/arm/interp_masm_arm.cpp index 3a81fdddb3c..b70a4b495b2 100644 --- a/src/hotspot/cpu/arm/interp_masm_arm.cpp +++ b/src/hotspot/cpu/arm/interp_masm_arm.cpp @@ -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 @@ -736,7 +736,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, Register ret_a ldrb(Rflag, do_not_unlock_if_synchronized); // get method access flags - ldr_u32(Raccess_flags, Address(Rmethod, Method::access_flags_offset())); + ldrh(Raccess_flags, Address(Rmethod, Method::access_flags_offset())); strb(zero_register(Rtemp), do_not_unlock_if_synchronized); // reset the flag diff --git a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp index 9df7a455eeb..d84ae9d14d6 100644 --- a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp +++ b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp @@ -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 @@ -579,7 +579,7 @@ void TemplateInterpreterGenerator::lock_method() { #ifdef ASSERT { Label L; - __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset())); + __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset())); __ tbnz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L); __ stop("method doesn't need synchronization"); __ bind(L); @@ -588,7 +588,7 @@ void TemplateInterpreterGenerator::lock_method() { // get synchronization object { Label done; - __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset())); + __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset())); __ tst(Rtemp, JVM_ACC_STATIC); __ ldr(R0, Address(Rlocals, Interpreter::local_offset_in_bytes(0)), eq); // get receiver (assume this is frequent case) __ b(done, eq); @@ -851,7 +851,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // make sure method is native & not abstract #ifdef ASSERT - __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset())); + __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset())); { Label L; __ tbnz(Rtemp, JVM_ACC_NATIVE_BIT, L); @@ -893,7 +893,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // no synchronization necessary #ifdef ASSERT { Label L; - __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset())); + __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset())); __ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L); __ stop("method needs synchronization"); __ bind(L); @@ -975,7 +975,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // Pass JNIEnv and mirror for static methods { Label L; - __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset())); + __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset())); __ add(R0, Rthread, in_bytes(JavaThread::jni_environment_offset())); __ tbz(Rtemp, JVM_ACC_STATIC_BIT, L); __ load_mirror(Rtemp, Rmethod, Rtemp); @@ -1204,7 +1204,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // make sure method is not native & not abstract #ifdef ASSERT - __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset())); + __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset())); { Label L; __ tbz(Rtemp, JVM_ACC_NATIVE_BIT, L); @@ -1249,7 +1249,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // no synchronization necessary #ifdef ASSERT { Label L; - __ ldr_u32(Rtemp, Address(Rmethod, Method::access_flags_offset())); + __ ldrh(Rtemp, Address(Rmethod, Method::access_flags_offset())); __ tbz(Rtemp, JVM_ACC_SYNCHRONIZED_BIT, L); __ stop("method needs synchronization"); __ bind(L); diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp index 67b9bdc0414..e097adb1dbf 100644 --- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp @@ -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) 2012, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -681,14 +681,14 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state, // Check if synchronized method or unlocking prevented by // JavaThread::do_not_unlock_if_synchronized flag. lbz(Rdo_not_unlock_flag, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread); - lwz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method); + lhz(Raccess_flags, in_bytes(Method::access_flags_offset()), R19_method); li(R0, 0); stb(R0, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread); // reset flag push(state); // Skip if we don't have to unlock. - rldicl_(R0, Raccess_flags, 64-JVM_ACC_SYNCHRONIZED_BIT, 63); // Extract bit and compare to 0. + testbitdi(CCR0, R0, Raccess_flags, JVM_ACC_SYNCHRONIZED_BIT); beq(CCR0, Lunlocked); cmpwi(CCR0, Rdo_not_unlock_flag, 0); diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp index c2e4c2e9b55..bad1a037b9a 100644 --- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp +++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.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. * Copyright (c) 2012, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1202,7 +1202,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm Label L_skip_barrier; { // Bypass the barrier for non-static methods - __ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method); + __ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method); __ andi_(R0, R0, JVM_ACC_STATIC); __ beq(CCR0, L_skip_barrier); // non-static } diff --git a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp index 9147dfc1677..ec372bfb07d 100644 --- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp @@ -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) 2015, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -144,9 +144,9 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() { // TODO PPC port: requires change in shared code. //assert(in_bytes(AccessFlags::flags_offset()) == 0, // "MethodDesc._access_flags == MethodDesc._access_flags._flags"); - // _access_flags must be a 32 bit value. - assert(sizeof(AccessFlags) == 4, "wrong size"); - __ lwa(R11_scratch1/*access_flags*/, method_(access_flags)); + // _access_flags must be a 16 bit value. + assert(sizeof(AccessFlags) == 2, "wrong size"); + __ lhz(R11_scratch1/*access_flags*/, method_(access_flags)); // testbit with condition register. __ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT); __ btrue(CCR0, L); @@ -823,7 +823,7 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc { if (!flags_preloaded) { - __ lwz(Rflags, method_(access_flags)); + __ lhz(Rflags, method_(access_flags)); } #ifdef ASSERT @@ -1301,8 +1301,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { assert(__ nonvolatile_accross_vthread_preemtion(access_flags), "access_flags not preserved"); // Type check. - assert(4 == sizeof(AccessFlags), "unexpected field size"); - __ lwz(access_flags, method_(access_flags)); + assert(2 == sizeof(AccessFlags), "unexpected field size"); + __ lhz(access_flags, method_(access_flags)); // We don't want to reload R19_method and access_flags after calls // to some helper functions. @@ -1769,7 +1769,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { #ifdef ASSERT else { Label Lok; - __ lwz(R0, in_bytes(Method::access_flags_offset()), R19_method); + __ lhz(R0, in_bytes(Method::access_flags_offset()), R19_method); __ andi_(R0, R0, JVM_ACC_SYNCHRONIZED); __ asm_assert_eq("method needs synchronization"); __ bind(Lok); diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp index e17a3765b50..70fec29d4f7 100644 --- a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp +++ b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp @@ -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, 2020, 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. @@ -544,7 +544,7 @@ void InterpreterMacroAssembler::remove_activation( // get method access flags ld(x11, Address(fp, frame::interpreter_frame_method_offset * wordSize)); - ld(x12, Address(x11, Method::access_flags_offset())); + load_unsigned_short(x12, Address(x11, Method::access_flags_offset())); test_bit(t0, x12, exact_log2(JVM_ACC_SYNCHRONIZED)); beqz(t0, unlocked); diff --git a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp index 9af1b6a9bb1..12e38d97b13 100644 --- a/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp +++ b/src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp @@ -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, 2020, 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. @@ -641,7 +641,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm Label L_skip_barrier; { // Bypass the barrier for non-static methods - __ lwu(t0, Address(xmethod, Method::access_flags_offset())); + __ load_unsigned_short(t0, Address(xmethod, Method::access_flags_offset())); __ test_bit(t1, t0, exact_log2(JVM_ACC_STATIC)); __ beqz(t1, L_skip_barrier); // non-static } diff --git a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp index 5ea9077a2b7..a2187b35bd5 100644 --- a/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp @@ -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, 2020, 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. @@ -714,14 +714,14 @@ void TemplateInterpreterGenerator::lock_method() { const int entry_size = frame::interpreter_frame_monitor_size_in_bytes(); #ifdef ASSERT - __ lwu(x10, access_flags); + __ load_unsigned_short(x10, access_flags); __ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method doesn't need synchronization", false); #endif // ASSERT // get synchronization object { Label done; - __ lwu(x10, access_flags); + __ load_unsigned_short(x10, access_flags); __ andi(t0, x10, JVM_ACC_STATIC); // get receiver (assume this is frequent case) __ ld(x10, Address(xlocals, Interpreter::local_offset_in_bytes(0))); @@ -1028,7 +1028,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // make sure method is native & not abstract #ifdef ASSERT - __ lwu(x10, access_flags); + __ load_unsigned_short(x10, access_flags); __ verify_access_flags(x10, JVM_ACC_NATIVE, "tried to execute non-native method as native", false); __ verify_access_flags(x10, JVM_ACC_ABSTRACT, "tried to execute abstract method in interpreter"); #endif @@ -1066,7 +1066,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { } else { // no synchronization necessary #ifdef ASSERT - __ lwu(x10, access_flags); + __ load_unsigned_short(x10, access_flags); __ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method needs synchronization"); #endif } @@ -1130,7 +1130,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // pass mirror handle if static call { Label L; - __ lwu(t, Address(xmethod, Method::access_flags_offset())); + __ load_unsigned_short(t, Address(xmethod, Method::access_flags_offset())); __ test_bit(t0, t, exact_log2(JVM_ACC_STATIC)); __ beqz(t0, L); // get mirror @@ -1346,7 +1346,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // do unlocking if necessary { Label L; - __ lwu(t, Address(xmethod, Method::access_flags_offset())); + __ load_unsigned_short(t, Address(xmethod, Method::access_flags_offset())); __ test_bit(t0, t, exact_log2(JVM_ACC_SYNCHRONIZED)); __ beqz(t0, L); // the code below should be shared with interpreter macro @@ -1472,7 +1472,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // make sure method is not native & not abstract #ifdef ASSERT - __ lwu(x10, access_flags); + __ load_unsigned_short(x10, access_flags); __ verify_access_flags(x10, JVM_ACC_NATIVE, "tried to execute native method as non-native"); __ verify_access_flags(x10, JVM_ACC_ABSTRACT, "tried to execute abstract method in interpreter"); #endif @@ -1519,7 +1519,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { } else { // no synchronization necessary #ifdef ASSERT - __ lwu(x10, access_flags); + __ load_unsigned_short(x10, access_flags); __ verify_access_flags(x10, JVM_ACC_SYNCHRONIZED, "method needs synchronization"); #endif } diff --git a/src/hotspot/cpu/s390/interp_masm_s390.cpp b/src/hotspot/cpu/s390/interp_masm_s390.cpp index 5e80817aaba..0e31dbd33e1 100644 --- a/src/hotspot/cpu/s390/interp_masm_s390.cpp +++ b/src/hotspot/cpu/s390/interp_masm_s390.cpp @@ -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. * @@ -780,7 +780,7 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state, get_method(R_method); verify_oop(Z_tos, state); push(state); // Save tos/result. - testbit(method2_(R_method, access_flags), JVM_ACC_SYNCHRONIZED_BIT); + testbit_ushort(method2_(R_method, access_flags), JVM_ACC_SYNCHRONIZED_BIT); z_bfalse(unlocked); // Don't unlock anything if the _do_not_unlock_if_synchronized flag diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index a069d6ceafb..3647aca0008 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -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. * Copyright 2024 IBM Corporation. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1015,6 +1015,18 @@ void MacroAssembler::load_and_test_long(Register dst, const Address &a) { z_ltg(dst, a); } +// Test a bit in memory for 2 byte datatype. +void MacroAssembler::testbit_ushort(const Address &a, unsigned int bit) { + assert(a.index() == noreg, "no index reg allowed in testbit"); + if (bit <= 7) { + z_tm(a.disp() + 1, a.base(), 1 << bit); + } else if (bit <= 15) { + z_tm(a.disp() + 0, a.base(), 1 << (bit - 8)); + } else { + ShouldNotReachHere(); + } +} + // Test a bit in memory. void MacroAssembler::testbit(const Address &a, unsigned int bit) { assert(a.index() == noreg, "no index reg allowed in testbit"); diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.hpp b/src/hotspot/cpu/s390/macroAssembler_s390.hpp index 15968812818..d45f1321e0f 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/macroAssembler_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. * Copyright (c) 2024 IBM Corporation. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -199,6 +199,7 @@ class MacroAssembler: public Assembler { // Test a bit in memory. Result is reflected in CC. void testbit(const Address &a, unsigned int bit); + void testbit_ushort(const Address &a, unsigned int bit); // Test a bit in a register. Result is reflected in CC. void testbit(Register r, unsigned int bitPos); diff --git a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp index 2396a2a7105..62f5c8fa524 100644 --- a/src/hotspot/cpu/s390/sharedRuntime_s390.cpp +++ b/src/hotspot/cpu/s390/sharedRuntime_s390.cpp @@ -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. * @@ -2395,7 +2395,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm Label L_skip_barrier; { // Bypass the barrier for non-static methods - __ testbit(Address(Z_method, Method::access_flags_offset()), JVM_ACC_STATIC_BIT); + __ testbit_ushort(Address(Z_method, Method::access_flags_offset()), JVM_ACC_STATIC_BIT); __ z_bfalse(L_skip_barrier); // non-static } diff --git a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp index 1c4089d5beb..99179bcad06 100644 --- a/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp @@ -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. * @@ -164,7 +164,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() { // Therefore add 3 to address that byte within "_flags". // Reload method. VM call above may have destroyed register contents __ get_method(method); - __ testbit(method2_(method, access_flags), JVM_ACC_STATIC_BIT); + __ testbit_ushort(method2_(method, access_flags), JVM_ACC_STATIC_BIT); method = noreg; // end of life __ z_btrue(isStatic); @@ -883,7 +883,7 @@ void TemplateInterpreterGenerator::lock_method(void) { address reentry = nullptr; { Label L; - __ testbit(method2_(method, access_flags), JVM_ACC_SYNCHRONIZED_BIT); + __ testbit_ushort(method2_(method, access_flags), JVM_ACC_SYNCHRONIZED_BIT); __ z_btrue(L); reentry = __ stop_chain_static(reentry, "method doesn't need synchronization"); __ bind(L); @@ -897,7 +897,7 @@ void TemplateInterpreterGenerator::lock_method(void) { Label done; Label static_method; - __ testbit(method2_(method, access_flags), JVM_ACC_STATIC_BIT); + __ testbit_ushort(method2_(method, access_flags), JVM_ACC_STATIC_BIT); __ z_btrue(static_method); // non-static method: Load receiver obj from stack. @@ -1349,15 +1349,17 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // Make sure method is native and not abstract. #ifdef ASSERT + // _access_flags must be a 16 bit value. + assert(sizeof(AccessFlags) == 2, "testbit_ushort will fail"); address reentry = nullptr; { Label L; - __ testbit(method_(access_flags), JVM_ACC_NATIVE_BIT); + __ testbit_ushort(method_(access_flags), JVM_ACC_NATIVE_BIT); __ z_btrue(L); reentry = __ stop_chain_static(reentry, "tried to execute non-native method as native"); __ bind(L); } { Label L; - __ testbit(method_(access_flags), JVM_ACC_ABSTRACT_BIT); + __ testbit_ushort(method_(access_flags), JVM_ACC_ABSTRACT_BIT); __ z_bfalse(L); reentry = __ stop_chain_static(reentry, "tried to execute abstract method as non-abstract"); __ bind(L); @@ -1403,7 +1405,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { #ifdef ASSERT { Label L; __ get_method(Z_R1_scratch); - __ testbit(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT); + __ testbit_ushort(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT); __ z_bfalse(L); reentry = __ stop_chain_static(reentry, "method needs synchronization"); __ bind(L); @@ -1461,7 +1463,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // Pass mirror handle if static call. { Label method_is_not_static; - __ testbit(method2_(Rmethod, access_flags), JVM_ACC_STATIC_BIT); + __ testbit_ushort(method2_(Rmethod, access_flags), JVM_ACC_STATIC_BIT); __ z_bfalse(method_is_not_static); // Load mirror from interpreter frame. __ z_lg(Z_R1, _z_ijava_state_neg(mirror), Z_fp); @@ -1719,13 +1721,13 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { #ifdef ASSERT address reentry = nullptr; { Label L; - __ testbit(method_(access_flags), JVM_ACC_NATIVE_BIT); + __ testbit_ushort(method_(access_flags), JVM_ACC_NATIVE_BIT); __ z_bfalse(L); reentry = __ stop_chain_static(reentry, "tried to execute native method as non-native"); __ bind(L); } { Label L; - __ testbit(method_(access_flags), JVM_ACC_ABSTRACT_BIT); + __ testbit_ushort(method_(access_flags), JVM_ACC_ABSTRACT_BIT); __ z_bfalse(L); reentry = __ stop_chain_static(reentry, "tried to execute abstract method as non-abstract"); __ bind(L); @@ -1775,7 +1777,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { #ifdef ASSERT { Label L; __ get_method(Z_R1_scratch); - __ testbit(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT); + __ testbit_ushort(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT); __ z_bfalse(L); reentry = __ stop_chain_static(reentry, "method needs synchronization"); __ bind(L); diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp index 3a3f01a6409..ff5b1c1454d 100644 --- a/src/hotspot/cpu/x86/interp_masm_x86.cpp +++ b/src/hotspot/cpu/x86/interp_masm_x86.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 @@ -1030,7 +1030,7 @@ void InterpreterMacroAssembler::remove_activation( // get method access flags movptr(rcx, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); - movl(rcx, Address(rcx, Method::access_flags_offset())); + load_unsigned_short(rcx, Address(rcx, Method::access_flags_offset())); testl(rcx, JVM_ACC_SYNCHRONIZED); jcc(Assembler::zero, unlocked); diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp index ab7cbb94374..b9901a1e95b 100644 --- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp +++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp @@ -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 @@ -1099,7 +1099,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm { // Bypass the barrier for non-static methods Register flags = rscratch1; - __ movl(flags, Address(method, Method::access_flags_offset())); + __ load_unsigned_short(flags, Address(method, Method::access_flags_offset())); __ testl(flags, JVM_ACC_STATIC); __ jcc(Assembler::zero, L_skip_barrier); // non-static } diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp index 823b965a09b..b4e005faff3 100644 --- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp +++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp @@ -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 @@ -596,7 +596,7 @@ void TemplateInterpreterGenerator::lock_method() { #ifdef ASSERT { Label L; - __ movl(rax, access_flags); + __ load_unsigned_short(rax, access_flags); __ testl(rax, JVM_ACC_SYNCHRONIZED); __ jcc(Assembler::notZero, L); __ stop("method doesn't need synchronization"); @@ -607,7 +607,7 @@ void TemplateInterpreterGenerator::lock_method() { // get synchronization object { Label done; - __ movl(rax, access_flags); + __ load_unsigned_short(rax, access_flags); __ testl(rax, JVM_ACC_STATIC); // get receiver (assume this is frequent case) __ movptr(rax, Address(rlocals, Interpreter::local_offset_in_bytes(0))); @@ -855,7 +855,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // make sure method is native & not abstract #ifdef ASSERT - __ movl(rax, access_flags); + __ load_unsigned_short(rax, access_flags); { Label L; __ testl(rax, JVM_ACC_NATIVE); @@ -909,7 +909,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { #ifdef ASSERT { Label L; - __ movl(rax, access_flags); + __ load_unsigned_short(rax, access_flags); __ testl(rax, JVM_ACC_SYNCHRONIZED); __ jcc(Assembler::zero, L); __ stop("method needs synchronization"); @@ -999,7 +999,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // pass mirror handle if static call { Label L; - __ movl(t, Address(method, Method::access_flags_offset())); + __ load_unsigned_short(t, Address(method, Method::access_flags_offset())); __ testl(t, JVM_ACC_STATIC); __ jcc(Assembler::zero, L); // get mirror @@ -1280,7 +1280,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // do unlocking if necessary { Label L; - __ movl(t, Address(method, Method::access_flags_offset())); + __ load_unsigned_short(t, Address(method, Method::access_flags_offset())); __ testl(t, JVM_ACC_SYNCHRONIZED); __ jcc(Assembler::zero, L); // the code below should be shared with interpreter macro @@ -1432,7 +1432,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // make sure method is not native & not abstract #ifdef ASSERT - __ movl(rax, access_flags); + __ load_unsigned_short(rax, access_flags); { Label L; __ testl(rax, JVM_ACC_NATIVE); @@ -1489,7 +1489,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { #ifdef ASSERT { Label L; - __ movl(rax, access_flags); + __ load_unsigned_short(rax, access_flags); __ testl(rax, JVM_ACC_SYNCHRONIZED); __ jcc(Assembler::zero, L); __ stop("method needs synchronization"); diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp index 5ea2d8eba25..b2124c6b157 100644 --- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp @@ -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 @@ -74,7 +74,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() { // Do Int register here switch ( i ) { case 0: - __ movl(rscratch1, Address(rbx, Method::access_flags_offset())); + __ load_unsigned_short(rscratch1, Address(rbx, Method::access_flags_offset())); __ testl(rscratch1, JVM_ACC_STATIC); __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); break; @@ -159,7 +159,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() { } // Now handle integrals. Only do c_rarg1 if not static. - __ movl(c_rarg3, Address(rbx, Method::access_flags_offset())); + __ load_unsigned_short(c_rarg3, Address(rbx, Method::access_flags_offset())); __ testl(c_rarg3, JVM_ACC_STATIC); __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index 74fdf7a5b76..2df2fbf8adc 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -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 @@ -1337,7 +1337,7 @@ void LIRGenerator::do_getModifiers(Intrinsic* x) { __ cmove(lir_cond_equal, prim_klass, recv_klass, klass, T_ADDRESS); // Get the answer. - __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_INT), result); + __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_CHAR), result); } void LIRGenerator::do_getObjectSize(Intrinsic* x) { diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp index f102282f682..2133f85ae00 100644 --- a/src/hotspot/share/cds/dynamicArchive.cpp +++ b/src/hotspot/share/cds/dynamicArchive.cpp @@ -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 @@ -509,12 +509,9 @@ void DynamicArchive::dump_at_exit(JavaThread* current, const char* archive_name) JavaThread* THREAD = current; // For TRAPS processing related to link_shared_classes MetaspaceShared::link_shared_classes(false/*not from jcmd*/, THREAD); if (!HAS_PENDING_EXCEPTION) { - // copy shared path table to saved. - if (!HAS_PENDING_EXCEPTION) { - VM_PopulateDynamicDumpSharedSpace op(archive_name); - VMThread::execute(&op); - return; - } + VM_PopulateDynamicDumpSharedSpace op(archive_name); + VMThread::execute(&op); + return; } // One of the prepatory steps failed diff --git a/src/hotspot/share/ci/ciFlags.cpp b/src/hotspot/share/ci/ciFlags.cpp index 1401a432a9e..043470a32a2 100644 --- a/src/hotspot/share/ci/ciFlags.cpp +++ b/src/hotspot/share/ci/ciFlags.cpp @@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,5 +92,5 @@ void ciFlags::print_member_flags(outputStream* st) { // ------------------------------------------------------------------ // ciFlags::print void ciFlags::print(outputStream* st) { - st->print(" flags=%x", _flags); + st->print(" flags=%x", _flags.as_unsigned_short()); } diff --git a/src/hotspot/share/ci/ciFlags.hpp b/src/hotspot/share/ci/ciFlags.hpp index dd1df622487..426f953611f 100644 --- a/src/hotspot/share/ci/ciFlags.hpp +++ b/src/hotspot/share/ci/ciFlags.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 @@ -26,7 +26,6 @@ #define SHARE_CI_CIFLAGS_HPP #include "ci/ciClassList.hpp" -#include "jvm_constants.h" #include "utilities/accessFlags.hpp" #include "utilities/ostream.hpp" @@ -39,37 +38,37 @@ class ciFlags { friend class ciField; friend class ciMethod; - jint _flags; + AccessFlags _flags; bool _stable; - bool _intialized_final_update; + bool _initialized_final_update; - ciFlags() :_flags(0), _stable(false), _intialized_final_update(false) { } + ciFlags() :_flags(0), _stable(false), _initialized_final_update(false) { } ciFlags(AccessFlags flags, bool is_stable = false, bool is_initialized_final_update = false) : - _flags(flags.as_int()), _stable(is_stable), _intialized_final_update(is_initialized_final_update) { } + _flags(flags), _stable(is_stable), _initialized_final_update(is_initialized_final_update) { } public: // Java access flags - bool is_public () const { return (_flags & JVM_ACC_PUBLIC ) != 0; } - bool is_private () const { return (_flags & JVM_ACC_PRIVATE ) != 0; } - bool is_protected () const { return (_flags & JVM_ACC_PROTECTED ) != 0; } - bool is_static () const { return (_flags & JVM_ACC_STATIC ) != 0; } - bool is_final () const { return (_flags & JVM_ACC_FINAL ) != 0; } - bool is_synchronized () const { return (_flags & JVM_ACC_SYNCHRONIZED ) != 0; } - bool is_super () const { return (_flags & JVM_ACC_SUPER ) != 0; } - bool is_volatile () const { return (_flags & JVM_ACC_VOLATILE ) != 0; } - bool is_transient () const { return (_flags & JVM_ACC_TRANSIENT ) != 0; } - bool is_native () const { return (_flags & JVM_ACC_NATIVE ) != 0; } - bool is_interface () const { return (_flags & JVM_ACC_INTERFACE ) != 0; } - bool is_abstract () const { return (_flags & JVM_ACC_ABSTRACT ) != 0; } + bool is_public () const { return _flags.is_public(); } + bool is_private () const { return _flags.is_private(); } + bool is_protected () const { return _flags.is_protected(); } + bool is_static () const { return _flags.is_static(); } + bool is_final () const { return _flags.is_final(); } + bool is_synchronized () const { return _flags.is_synchronized(); } + bool is_super () const { return _flags.is_super(); } + bool is_volatile () const { return _flags.is_volatile(); } + bool is_transient () const { return _flags.is_transient(); } + bool is_native () const { return _flags.is_native(); } + bool is_interface () const { return _flags.is_interface(); } + bool is_abstract () const { return _flags.is_abstract(); } bool is_stable () const { return _stable; } // In case the current object represents a field, return true if // the field is modified outside of instance initializer methods // (or class/initializer methods if the field is static) and false // otherwise. - bool has_initialized_final_update() const { return _intialized_final_update; }; + bool has_initialized_final_update() const { return _initialized_final_update; }; // Conversion - jint as_int() { return _flags; } + jint as_int() { return _flags.as_unsigned_short(); } void print_klass_flags(outputStream* st = tty); void print_member_flags(outputStream* st = tty); diff --git a/src/hotspot/share/ci/ciKlass.cpp b/src/hotspot/share/ci/ciKlass.cpp index f65d4a0311c..e14e237167d 100644 --- a/src/hotspot/share/ci/ciKlass.cpp +++ b/src/hotspot/share/ci/ciKlass.cpp @@ -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 @@ -222,7 +222,7 @@ jint ciKlass::modifier_flags() { jint ciKlass::access_flags() { assert(is_loaded(), "not loaded"); GUARDED_VM_ENTRY( - return get_Klass()->access_flags().as_int(); + return get_Klass()->access_flags().as_unsigned_short(); ) } diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 5c58f200006..c552e48c8b8 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.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 @@ -2981,7 +2981,7 @@ u2 ClassFileParser::parse_classfile_inner_classes_attribute(const ClassFileStrea "Class is both outer and inner class in class file %s", CHECK_0); } // Access flags - jint flags; + u2 flags; // JVM_ACC_MODULE is defined in JDK-9 and later. if (_major_version >= JAVA_9_VERSION) { flags = cfs->get_u2_fast() & (RECOGNIZED_INNER_CLASS_MODIFIERS | JVM_ACC_MODULE); @@ -2998,7 +2998,7 @@ u2 ClassFileParser::parse_classfile_inner_classes_attribute(const ClassFileStrea inner_classes->at_put(index++, inner_class_info_index); inner_classes->at_put(index++, outer_class_info_index); inner_classes->at_put(index++, inner_name_index); - inner_classes->at_put(index++, inner_access_flags.as_short()); + inner_classes->at_put(index++, inner_access_flags.as_unsigned_short()); } // Check for circular and duplicate entries. @@ -3750,7 +3750,7 @@ void ClassFileParser::apply_parsed_class_metadata( // Initialize cached modifier_flags to support Class.getModifiers(). // This must follow setting inner_class attributes. - int computed_modifiers = this_klass->compute_modifier_flags(); + u2 computed_modifiers = this_klass->compute_modifier_flags(); this_klass->set_modifier_flags(computed_modifiers); // Delay the setting of _local_interfaces and _transitive_interfaces until after @@ -5336,7 +5336,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream, assert(_stream != nullptr, "invariant"); assert(_stream->buffer() == _stream->current(), "invariant"); assert(_class_name != nullptr, "invariant"); - assert(0 == _access_flags.as_int(), "invariant"); + assert(0 == _access_flags.as_unsigned_short(), "invariant"); // Figure out whether we can skip format checking (matching classic VM behavior) _need_verify = Verifier::should_verify_for(_loader_data->class_loader()); @@ -5488,7 +5488,7 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream, stream->guarantee_more(8, CHECK); // flags, this_class, super_class, infs_len // Access flags - jint flags; + u2 flags; // JVM_ACC_MODULE is defined in JDK-9 and later. if (_major_version >= JAVA_9_VERSION) { flags = stream->get_u2_fast() & (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_MODULE); diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index 1aedb43973c..650d0a9fa74 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.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 @@ -3169,7 +3169,7 @@ void java_lang_ClassFrameInfo::serialize_offsets(SerializeClosure* f) { #endif static int get_flags(const methodHandle& m) { - int flags = (jushort)( m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS ); + int flags = m->access_flags().as_method_flags(); if (m->is_object_initializer()) { flags |= java_lang_invoke_MemberName::MN_IS_CONSTRUCTOR; } else { @@ -5537,7 +5537,7 @@ int InjectedField::compute_offset() { ik->print(); tty->print_cr("all fields:"); for (AllFieldStream fs(ik); !fs.done(); fs.next()) { - tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int()); + tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_field_flags()); } #endif //PRODUCT vm_exit_during_initialization("Invalid layout of well-known class: use -Xlog:class+load=info to see the origin of the problem class"); diff --git a/src/hotspot/share/classfile/vmIntrinsics.cpp b/src/hotspot/share/classfile/vmIntrinsics.cpp index 407cdafaf20..38226d232ef 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.cpp +++ b/src/hotspot/share/classfile/vmIntrinsics.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 @@ -36,31 +36,31 @@ #include "utilities/tribool.hpp" // These are flag-matching functions: -inline bool match_F_R(jshort flags) { +inline bool match_F_R(u2 flags) { const int req = 0; const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED | JVM_ACC_NATIVE; return (flags & (req | neg)) == req; } -inline bool match_F_Y(jshort flags) { +inline bool match_F_Y(u2 flags) { const int req = JVM_ACC_SYNCHRONIZED; const int neg = JVM_ACC_STATIC | JVM_ACC_NATIVE; return (flags & (req | neg)) == req; } -inline bool match_F_RN(jshort flags) { +inline bool match_F_RN(u2 flags) { const int req = JVM_ACC_NATIVE; const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED; return (flags & (req | neg)) == req; } -inline bool match_F_S(jshort flags) { +inline bool match_F_S(u2 flags) { const int req = JVM_ACC_STATIC; const int neg = JVM_ACC_SYNCHRONIZED | JVM_ACC_NATIVE; return (flags & (req | neg)) == req; } -inline bool match_F_SN(jshort flags) { +inline bool match_F_SN(u2 flags) { const int req = JVM_ACC_STATIC | JVM_ACC_NATIVE; const int neg = JVM_ACC_SYNCHRONIZED; return (flags & (req | neg)) == req; @@ -711,7 +711,7 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) { vmIntrinsics::ID vmIntrinsics::find_id_impl(vmSymbolID holder, vmSymbolID name, vmSymbolID sig, - jshort flags) { + u2 flags) { assert((int)vmSymbolID::SID_LIMIT <= (1< { void increment_total_collections(bool full = false) { _total_collections++; if (full) { - increment_total_full_collections(); + _total_full_collections++; } } - void increment_total_full_collections() { _total_full_collections++; } - // Return the SoftRefPolicy for the heap; SoftRefPolicy* soft_ref_policy() { return &_soft_ref_policy; } diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp index ca8a85c8bba..507206e2147 100644 --- a/src/hotspot/share/interpreter/linkResolver.cpp +++ b/src/hotspot/share/interpreter/linkResolver.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 @@ -583,7 +583,7 @@ void LinkResolver::check_method_accessability(Klass* ref_klass, resolved_klass->is_array_klass()) { // We need to change "protected" to "public". assert(flags.is_protected(), "clone not protected?"); - jint new_flags = flags.as_int(); + u2 new_flags = flags.as_method_flags(); new_flags = new_flags & (~JVM_ACC_PROTECTED); new_flags = new_flags | JVM_ACC_PUBLIC; flags.set_flags(new_flags); diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp index edb87c7fc8e..27b01e99e55 100644 --- a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp +++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp @@ -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 @@ -72,7 +72,7 @@ const Symbol* EdgeUtils::field_name(const Edge& edge, jshort* modifiers) { JavaFieldStream jfs(ik); while (!jfs.done()) { if (offset == jfs.offset()) { - *modifiers = jfs.access_flags().as_short(); + *modifiers = jfs.access_flags().as_field_flags(); return jfs.name(); } jfs.next(); diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp index a53eaa474f3..bc5f97c719a 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp @@ -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 @@ -227,9 +227,9 @@ static traceid method_id(KlassPtr klass, MethodPtr method) { } template -static s4 get_flags(const T* ptr) { +static u2 get_flags(const T* ptr) { assert(ptr != nullptr, "invariant"); - return ptr->access_flags().get_flags(); + return ptr->access_flags().as_unsigned_short(); } // Same as JVM_GetClassModifiers @@ -968,7 +968,7 @@ static int write_method(JfrCheckpointWriter* writer, MethodPtr method, bool leak writer->write(artifact_id(klass)); writer->write(mark_symbol(method->name(), leakp)); writer->write(mark_symbol(method->signature(), leakp)); - writer->write(static_cast(get_flags(method))); + writer->write(get_flags(method)); writer->write(get_visibility(method)); return 1; } diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp index f53eecad2cf..b487b5e6670 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp @@ -97,7 +97,7 @@ #define METHOD_USED_THIS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (THIS_EPOCH_METHOD_BIT))) #define METHOD_NOT_USED_THIS_EPOCH(kls) (!(METHOD_USED_THIS_EPOCH(kls))) #define METHOD_USED_PREVIOUS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (PREVIOUS_EPOCH_METHOD_BIT))) -#define METHOD_USED_ANY_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (EPOCH_1_METHOD_BIT) | EPOCH_0_METHOD_BIT))) +#define METHOD_USED_ANY_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (EPOCH_1_METHOD_BIT | EPOCH_0_METHOD_BIT))) #define METHOD_AND_CLASS_USED_THIS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (THIS_EPOCH_METHOD_AND_CLASS_BITS))) #define METHOD_AND_CLASS_USED_PREVIOUS_EPOCH(kls) (TRACE_ID_PREDICATE(kls, (PREVIOUS_EPOCH_METHOD_AND_CLASS_BITS))) #define METHOD_AND_CLASS_USED_ANY_EPOCH(kls) (METHOD_USED_ANY_EPOCH(kls) && USED_ANY_EPOCH(kls)) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 9052e622894..1fa3f23173c 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -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 @@ -1000,7 +1000,7 @@ C2V_VMENTRY_NULL(jobject, resolveFieldInPool, (JNIEnv* env, jobject, ARGUMENT_PA if (info.is_null() || JVMCIENV->get_length(info) != 4) { JVMCI_ERROR_NULL("info must not be null and have a length of 4"); } - JVMCIENV->put_int_at(info, 0, fd.access_flags().as_int()); + JVMCIENV->put_int_at(info, 0, fd.access_flags().as_field_flags()); JVMCIENV->put_int_at(info, 1, fd.offset()); JVMCIENV->put_int_at(info, 2, fd.index()); JVMCIENV->put_int_at(info, 3, fd.field_flags().as_uint()); diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp index 712745e2a02..1a53f6b6d2c 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.cpp +++ b/src/hotspot/share/jvmci/jvmciEnv.cpp @@ -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 @@ -1592,7 +1592,7 @@ JVMCIObject JVMCIEnv::new_FieldInfo(FieldInfo* fieldinfo, JVMCI_TRAPS) { HotSpotJVMCI::FieldInfo::set_nameIndex(JVMCIENV, obj_h(), (jint)fieldinfo->name_index()); HotSpotJVMCI::FieldInfo::set_signatureIndex(JVMCIENV, obj_h(), (jint)fieldinfo->signature_index()); HotSpotJVMCI::FieldInfo::set_offset(JVMCIENV, obj_h(), (jint)fieldinfo->offset()); - HotSpotJVMCI::FieldInfo::set_classfileFlags(JVMCIENV, obj_h(), (jint)fieldinfo->access_flags().as_int()); + HotSpotJVMCI::FieldInfo::set_classfileFlags(JVMCIENV, obj_h(), (jint)fieldinfo->access_flags().as_field_flags()); HotSpotJVMCI::FieldInfo::set_internalFlags(JVMCIENV, obj_h(), (jint)fieldinfo->field_flags().as_uint()); HotSpotJVMCI::FieldInfo::set_initializerIndex(JVMCIENV, obj_h(), (jint)fieldinfo->initializer_index()); return wrap(obj_h()); @@ -1603,7 +1603,7 @@ JVMCIObject JVMCIEnv::new_FieldInfo(FieldInfo* fieldinfo, JVMCI_TRAPS) { (jint)fieldinfo->name_index(), (jint)fieldinfo->signature_index(), (jint)fieldinfo->offset(), - (jint)fieldinfo->access_flags().as_int(), + (jint)fieldinfo->access_flags().as_field_flags(), (jint)fieldinfo->field_flags().as_uint(), (jint)fieldinfo->initializer_index()); diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index ba47e559957..97447c43b6e 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -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 @@ -273,7 +273,7 @@ nonstatic_field(Klass, _name, Symbol*) \ volatile_nonstatic_field(Klass, _next_sibling, Klass*) \ nonstatic_field(Klass, _java_mirror, OopHandle) \ - nonstatic_field(Klass, _modifier_flags, jint) \ + nonstatic_field(Klass, _modifier_flags, u2) \ nonstatic_field(Klass, _access_flags, AccessFlags) \ nonstatic_field(Klass, _class_loader_data, ClassLoaderData*) \ nonstatic_field(Klass, _secondary_supers_bitmap, uintx) \ @@ -488,7 +488,6 @@ declare_constant(InvocationEntryBci) \ declare_constant(JVMCINMethodData::SPECULATION_LENGTH_BITS) \ \ - declare_constant(JVM_ACC_WRITTEN_FLAGS) \ declare_constant(FieldInfo::FieldFlags::_ff_injected) \ declare_constant(FieldInfo::FieldFlags::_ff_stable) \ declare_preprocessor_constant("JVM_ACC_VARARGS", JVM_ACC_VARARGS) \ diff --git a/src/hotspot/share/oops/fieldInfo.cpp b/src/hotspot/share/oops/fieldInfo.cpp index 50a3b427d17..3ae91a03b67 100644 --- a/src/hotspot/share/oops/fieldInfo.cpp +++ b/src/hotspot/share/oops/fieldInfo.cpp @@ -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 @@ -34,7 +34,7 @@ void FieldInfo::print(outputStream* os, ConstantPool* cp) { name_index(), name(cp)->as_utf8(), signature_index(), signature(cp)->as_utf8(), offset(), - access_flags().as_int(), + access_flags().as_field_flags(), field_flags().as_uint(), initializer_index(), generic_signature_index(), @@ -97,7 +97,7 @@ Array* FieldInfoStream::create_FieldInfoStream(GrowableArray* fie assert(fi_ref->name_index() == fi.name_index(), "Must be"); assert(fi_ref->signature_index() == fi.signature_index(), "Must be"); assert(fi_ref->offset() == fi.offset(), "Must be"); - assert(fi_ref->access_flags().as_int() == fi.access_flags().as_int(), "Must be"); + assert(fi_ref->access_flags().as_field_flags() == fi.access_flags().as_field_flags(), "Must be"); assert(fi_ref->field_flags().as_uint() == fi.field_flags().as_uint(), " Must be"); if(fi_ref->field_flags().is_initialized()) { assert(fi_ref->initializer_index() == fi.initializer_index(), "Must be"); diff --git a/src/hotspot/share/oops/fieldInfo.inline.hpp b/src/hotspot/share/oops/fieldInfo.inline.hpp index 2e6727f1fb9..bf37d280510 100644 --- a/src/hotspot/share/oops/fieldInfo.inline.hpp +++ b/src/hotspot/share/oops/fieldInfo.inline.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 @@ -73,7 +73,7 @@ inline void Mapper::map_field_info(const FieldInfo& fi) { _consumer->accept_uint(fi.name_index()); _consumer->accept_uint(fi.signature_index()); _consumer->accept_uint(fi.offset()); - _consumer->accept_uint(fi.access_flags().as_int()); + _consumer->accept_uint(fi.access_flags().as_field_flags()); _consumer->accept_uint(fi.field_flags().as_uint()); if(fi.field_flags().has_any_optionals()) { if (fi.field_flags().is_initialized()) { diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index ce46da55f98..43b078a8af2 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.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 @@ -3339,8 +3339,8 @@ InstanceKlass* InstanceKlass::compute_enclosing_class(bool* inner_is_member, TRA return outer_klass; } -jint InstanceKlass::compute_modifier_flags() const { - jint access = access_flags().as_int(); +u2 InstanceKlass::compute_modifier_flags() const { + u2 access = access_flags().as_unsigned_short(); // But check if it happens to be member class. InnerClassesIterator iter(this); @@ -3360,7 +3360,7 @@ jint InstanceKlass::compute_modifier_flags() const { } } // Remember to strip ACC_SUPER bit - return (access & (~JVM_ACC_SUPER)) & JVM_ACC_WRITTEN_FLAGS; + return (access & (~JVM_ACC_SUPER)); } jint InstanceKlass::jvmti_class_status() const { diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index 8209a692a82..cedc17e9baf 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.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 @@ -391,7 +391,7 @@ class InstanceKlass: public Klass { public: int field_offset (int index) const { return field(index).offset(); } - int field_access_flags(int index) const { return field(index).access_flags().as_int(); } + int field_access_flags(int index) const { return field(index).access_flags().as_field_flags(); } FieldInfo::FieldFlags field_flags(int index) const { return field(index).field_flags(); } FieldStatus field_status(int index) const { return fields_status()->at(index); } inline Symbol* field_name (int index) const; @@ -682,8 +682,6 @@ class InstanceKlass: public Klass { #if INCLUDE_JVMTI // Redefinition locking. Class can only be redefined by one thread at a time. - // The flag is in access_flags so that it can be set and reset using atomic - // operations, and not be reset by other misc_flag settings. bool is_being_redefined() const { return _misc_flags.is_being_redefined(); } void set_is_being_redefined(bool value) { _misc_flags.set_is_being_redefined(value); } @@ -1127,7 +1125,7 @@ class InstanceKlass: public Klass { void compute_has_loops_flag_for_methods(); #endif - jint compute_modifier_flags() const; + u2 compute_modifier_flags() const; public: // JVMTI support diff --git a/src/hotspot/share/oops/klass.hpp b/src/hotspot/share/oops/klass.hpp index 2c75d6da3b8..d27665bbcc1 100644 --- a/src/hotspot/share/oops/klass.hpp +++ b/src/hotspot/share/oops/klass.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 @@ -66,7 +66,7 @@ class Klass : public Metadata { friend class JVMCIVMStructs; public: // Klass Kinds for all subclasses of Klass - enum KlassKind { + enum KlassKind : u2 { InstanceKlassKind, InstanceRefKlassKind, InstanceMirrorKlassKind, @@ -113,15 +113,20 @@ class Klass : public Metadata { // // Final note: This comes first, immediately after C++ vtable, // because it is frequently queried. - jint _layout_helper; + jint _layout_helper; // Klass kind used to resolve the runtime type of the instance. // - Used to implement devirtualized oop closure dispatching. // - Various type checking in the JVM const KlassKind _kind; + AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here. + // Some flags created by the JVM, not in the class file itself, + // are in _misc_flags below. // Processed access flags, for use by Class.getModifiers. - jint _modifier_flags; + u2 _modifier_flags; + + KlassFlags _misc_flags; // The fields _super_check_offset, _secondary_super_cache, _secondary_supers // and _primary_supers all help make fast subtype checks. See big discussion @@ -157,22 +162,12 @@ class Klass : public Metadata { // Provide access the corresponding instance java.lang.ClassLoader. ClassLoaderData* _class_loader_data; + markWord _prototype_header; // Used to initialize objects' header + // Bitmap and hash code used by hashed secondary supers. uintx _secondary_supers_bitmap; uint8_t _hash_slot; - markWord _prototype_header; // Used to initialize objects' header - - int _vtable_len; // vtable length. This field may be read very often when we - // have lots of itable dispatches (e.g., lambdas and streams). - // Keep it away from the beginning of a Klass to avoid cacheline - // contention that may happen when a nearby object is modified. - AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here. - // Some flags created by the JVM, not in the class file itself, - // are in _misc_flags below. - - JFR_ONLY(DEFINE_TRACE_ID_FIELD;) - private: // This is an index into FileMapHeader::_shared_path_table[], to // associate this class with the JAR file where it's loaded from during @@ -200,10 +195,17 @@ class Klass : public Metadata { }; #endif - KlassFlags _misc_flags; + int _vtable_len; // vtable length. This field may be read very often when we + // have lots of itable dispatches (e.g., lambdas and streams). + // Keep it away from the beginning of a Klass to avoid cacheline + // contention that may happen when a nearby object is modified. CDS_JAVA_HEAP_ONLY(int _archived_mirror_index;) +public: + + JFR_ONLY(DEFINE_TRACE_ID_FIELD;) + protected: Klass(KlassKind kind); @@ -292,8 +294,8 @@ class Klass : public Metadata { void clear_java_mirror_handle() { _java_mirror = OopHandle(); } // modifier flags - jint modifier_flags() const { return _modifier_flags; } - void set_modifier_flags(jint flags) { _modifier_flags = flags; } + u2 modifier_flags() const { return _modifier_flags; } + void set_modifier_flags(u2 flags) { _modifier_flags = flags; } // size helper int layout_helper() const { return _layout_helper; } @@ -756,7 +758,7 @@ class Klass : public Metadata { virtual void release_C_heap_structures(bool release_constant_pool = true); public: - virtual jint compute_modifier_flags() const = 0; + virtual u2 compute_modifier_flags() const = 0; // JVMTI support virtual jint jvmti_class_status() const; diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp index d0b29a4a309..ab15379409f 100644 --- a/src/hotspot/share/oops/method.cpp +++ b/src/hotspot/share/oops/method.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 @@ -1652,8 +1652,8 @@ void Method::init_intrinsic_id(vmSymbolID klass_id) { && sig_id == vmSymbolID::NO_SID) { return; } - jshort flags = access_flags().as_short(); + u2 flags = access_flags().as_method_flags(); vmIntrinsics::ID id = vmIntrinsics::find_id(klass_id, name_id, sig_id, flags); if (id != vmIntrinsics::_none) { set_intrinsic_id(id); @@ -2300,7 +2300,7 @@ void Method::print_on(outputStream* st) const { st->print (" - method holder: "); method_holder()->print_value_on(st); st->cr(); st->print (" - constants: " PTR_FORMAT " ", p2i(constants())); constants()->print_value_on(st); st->cr(); - st->print (" - access: 0x%x ", access_flags().as_int()); access_flags().print_on(st); st->cr(); + st->print (" - access: 0x%x ", access_flags().as_method_flags()); access_flags().print_on(st); st->cr(); st->print (" - flags: 0x%x ", _flags.as_int()); _flags.print_on(st); st->cr(); st->print (" - name: "); name()->print_value_on(st); st->cr(); st->print (" - signature: "); signature()->print_value_on(st); st->cr(); diff --git a/src/hotspot/share/oops/method.hpp b/src/hotspot/share/oops/method.hpp index 271d8b39863..7b13337ecaf 100644 --- a/src/hotspot/share/oops/method.hpp +++ b/src/hotspot/share/oops/method.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 @@ -75,8 +75,8 @@ class Method : public Metadata { MethodData* _method_data; MethodCounters* _method_counters; AdapterHandlerEntry* _adapter; - AccessFlags _access_flags; // Access flags int _vtable_index; // vtable index of this method (see VtableIndexFlag) + AccessFlags _access_flags; // Access flags MethodFlags _flags; u2 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none) diff --git a/src/hotspot/share/oops/objArrayKlass.cpp b/src/hotspot/share/oops/objArrayKlass.cpp index 04bc374e522..903c5660d53 100644 --- a/src/hotspot/share/oops/objArrayKlass.cpp +++ b/src/hotspot/share/oops/objArrayKlass.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 @@ -341,12 +341,12 @@ void ObjArrayKlass::metaspace_pointers_do(MetaspaceClosure* it) { it->push(&_bottom_klass); } -jint ObjArrayKlass::compute_modifier_flags() const { +u2 ObjArrayKlass::compute_modifier_flags() const { // The modifier for an objectArray is the same as its element assert (element_klass() != nullptr, "should be initialized"); // Return the flags of the bottom element type. - jint element_flags = bottom_klass()->compute_modifier_flags(); + u2 element_flags = bottom_klass()->compute_modifier_flags(); return (element_flags & (JVM_ACC_PUBLIC | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED)) | (JVM_ACC_ABSTRACT | JVM_ACC_FINAL); diff --git a/src/hotspot/share/oops/objArrayKlass.hpp b/src/hotspot/share/oops/objArrayKlass.hpp index e16f1f2eb0f..c44c8d28f62 100644 --- a/src/hotspot/share/oops/objArrayKlass.hpp +++ b/src/hotspot/share/oops/objArrayKlass.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 @@ -143,7 +143,7 @@ class ObjArrayKlass : public ArrayKlass { inline void oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, void* low, void* high); public: - jint compute_modifier_flags() const; + u2 compute_modifier_flags() const; public: // Printing diff --git a/src/hotspot/share/oops/typeArrayKlass.cpp b/src/hotspot/share/oops/typeArrayKlass.cpp index 8ca6a49fc46..86c4f9d7138 100644 --- a/src/hotspot/share/oops/typeArrayKlass.cpp +++ b/src/hotspot/share/oops/typeArrayKlass.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 @@ -75,7 +75,7 @@ TypeArrayKlass* TypeArrayKlass::allocate(ClassLoaderData* loader_data, BasicType return new (loader_data, size, THREAD) TypeArrayKlass(type, name); } -jint TypeArrayKlass::compute_modifier_flags() const { +u2 TypeArrayKlass::compute_modifier_flags() const { return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC; } diff --git a/src/hotspot/share/oops/typeArrayKlass.hpp b/src/hotspot/share/oops/typeArrayKlass.hpp index 9dc3ed607fe..6ec72ae49c0 100644 --- a/src/hotspot/share/oops/typeArrayKlass.hpp +++ b/src/hotspot/share/oops/typeArrayKlass.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 @@ -73,7 +73,7 @@ class TypeArrayKlass : public ArrayKlass { // Copying void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); - jint compute_modifier_flags() const; + u2 compute_modifier_flags() const; // Oop iterators. Since there are no oops in TypeArrayKlasses, // these functions only return the size of the object. diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 40b19eecd9f..56cfb9fe16e 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -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 @@ -3871,7 +3871,7 @@ Node* LibraryCallKit::generate_klass_flags_guard(Node* kls, int modifier_mask, i } Node* LibraryCallKit::generate_interface_guard(Node* kls, RegionNode* region) { return generate_klass_flags_guard(kls, JVM_ACC_INTERFACE, 0, region, - Klass::access_flags_offset(), TypeInt::INT, T_INT); + Klass::access_flags_offset(), TypeInt::CHAR, T_CHAR); } // Use this for testing if Klass is_hidden, has_finalizer, and is_cloneable_fast. @@ -3904,8 +3904,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { break; case vmIntrinsics::_getModifiers: prim_return_value = intcon(JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC); - assert(is_power_of_2((int)JVM_ACC_WRITTEN_FLAGS+1), "change next line"); - return_type = TypeInt::make(0, JVM_ACC_WRITTEN_FLAGS, Type::WidenMin); + return_type = TypeInt::CHAR; break; case vmIntrinsics::_isInterface: prim_return_value = intcon(0); @@ -3927,7 +3926,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { break; case vmIntrinsics::_getClassAccessFlags: prim_return_value = intcon(JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC); - return_type = TypeInt::INT; // not bool! 6297094 + return_type = TypeInt::CHAR; break; default: fatal_unexpected_iid(id); @@ -3988,7 +3987,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { case vmIntrinsics::_getModifiers: p = basic_plus_adr(kls, in_bytes(Klass::modifier_flags_offset())); - query_value = make_load(nullptr, p, TypeInt::INT, T_INT, MemNode::unordered); + query_value = make_load(nullptr, p, TypeInt::CHAR, T_CHAR, MemNode::unordered); break; case vmIntrinsics::_isInterface: @@ -4053,7 +4052,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { case vmIntrinsics::_getClassAccessFlags: p = basic_plus_adr(kls, in_bytes(Klass::access_flags_offset())); - query_value = make_load(nullptr, p, TypeInt::INT, T_INT, MemNode::unordered); + query_value = make_load(nullptr, p, TypeInt::CHAR, T_CHAR, MemNode::unordered); break; default: diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index ad351fb81ad..78ffbe05ae4 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.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. * Copyright (c) 2024, Alibaba Group Holding Limited. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1976,24 +1976,24 @@ LoadNode::load_array_final_field(const TypeKlassPtr *tkls, if (tkls->offset() == in_bytes(Klass::modifier_flags_offset())) { // The field is Klass::_modifier_flags. Return its (constant) value. // (Folds up the 2nd indirection in aClassConstant.getModifiers().) - assert(this->Opcode() == Op_LoadI, "must load an int from _modifier_flags"); + assert(Opcode() == Op_LoadUS, "must load an unsigned short from _modifier_flags"); return TypeInt::make(klass->modifier_flags()); } if (tkls->offset() == in_bytes(Klass::access_flags_offset())) { // The field is Klass::_access_flags. Return its (constant) value. // (Folds up the 2nd indirection in Reflection.getClassAccessFlags(aClassConstant).) - assert(this->Opcode() == Op_LoadI, "must load an int from _access_flags"); + assert(Opcode() == Op_LoadUS, "must load an unsigned short from _access_flags"); return TypeInt::make(klass->access_flags()); } if (tkls->offset() == in_bytes(Klass::misc_flags_offset())) { // The field is Klass::_misc_flags. Return its (constant) value. // (Folds up the 2nd indirection in Reflection.getClassAccessFlags(aClassConstant).) - assert(this->Opcode() == Op_LoadUB, "must load an unsigned byte from _misc_flags"); + assert(Opcode() == Op_LoadUB, "must load an unsigned byte from _misc_flags"); return TypeInt::make(klass->misc_flags()); } if (tkls->offset() == in_bytes(Klass::layout_helper_offset())) { // The field is Klass::_layout_helper. Return its constant value if known. - assert(this->Opcode() == Op_LoadI, "must load an int from _layout_helper"); + assert(Opcode() == Op_LoadI, "must load an int from _layout_helper"); return TypeInt::make(klass->layout_helper()); } diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 50ae1deecbf..101006d9afc 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -345,7 +345,7 @@ class Node { // The PhaseRenumberLive phase renumbers nodes based on liveness information. // Therefore, it updates the value of the _idx field. The parse-time _idx is // preserved in _parse_idx. - const node_idx_t _idx; + node_idx_t _idx; DEBUG_ONLY(const node_idx_t _parse_idx;) // IGV node identifier. Two nodes, possibly in different compilation phases, // have the same IGV identifier if (and only if) they are the very same node @@ -586,8 +586,7 @@ class Node { // Set this node's index, used by cisc_version to replace current node void set_idx(uint new_idx) { - const node_idx_t* ref = &_idx; - *(node_idx_t*)ref = new_idx; + _idx = new_idx; } // Swap input edge order. (Edge indexes i1 and i2 are usually 1 and 2.) void swap_edges(uint i1, uint i2) { diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index 12c7898f4cf..198165cdd1e 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.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 @@ -1306,7 +1306,7 @@ JVM_ENTRY(jint, JVM_GetClassModifiers(JNIEnv *env, jclass cls)) } Klass* k = java_lang_Class::as_Klass(mirror); - debug_only(int computed_modifiers = k->compute_modifier_flags()); + debug_only(u2 computed_modifiers = k->compute_modifier_flags()); assert(k->modifier_flags() == computed_modifiers, "modifiers cache is OK"); return k->modifier_flags(); JVM_END @@ -1817,7 +1817,7 @@ JVM_ENTRY(jint, JVM_GetClassAccessFlags(JNIEnv *env, jclass cls)) } Klass* k = java_lang_Class::as_Klass(mirror); - return k->access_flags().as_int() & JVM_ACC_WRITTEN_FLAGS; + return k->access_flags().as_class_flags(); } JVM_END @@ -2460,14 +2460,14 @@ JVM_ENTRY(jint, JVM_GetMethodIxModifiers(JNIEnv *env, jclass cls, int method_ind Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls)); k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread); Method* method = InstanceKlass::cast(k)->methods()->at(method_index); - return method->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS; + return method->access_flags().as_method_flags(); JVM_END JVM_ENTRY(jint, JVM_GetFieldIxModifiers(JNIEnv *env, jclass cls, int field_index)) Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls)); k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread); - return InstanceKlass::cast(k)->field_access_flags(field_index) & JVM_RECOGNIZED_FIELD_MODIFIERS; + return InstanceKlass::cast(k)->field_access_flags(field_index); JVM_END @@ -2657,7 +2657,7 @@ JVM_ENTRY(jint, JVM_GetCPFieldModifiers(JNIEnv *env, jclass cls, int cp_index, j InstanceKlass* ik = InstanceKlass::cast(k_called); for (JavaFieldStream fs(ik); !fs.done(); fs.next()) { if (fs.name() == name && fs.signature() == signature) { - return fs.access_flags().as_short() & JVM_RECOGNIZED_FIELD_MODIFIERS; + return fs.access_flags().as_field_flags(); } } return -1; @@ -2686,7 +2686,7 @@ JVM_ENTRY(jint, JVM_GetCPMethodModifiers(JNIEnv *env, jclass cls, int cp_index, for (int i = 0; i < methods_count; i++) { Method* method = methods->at(i); if (method->name() == name && method->signature() == signature) { - return method->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS; + return method->access_flags().as_method_flags(); } } return -1; diff --git a/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp b/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp index ceed1d8ad95..10fb4121472 100644 --- a/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp +++ b/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp @@ -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 @@ -85,7 +85,7 @@ void JvmtiClassFileReconstituter::write_field_infos() { // JVMSpec| attribute_info attributes[attributes_count]; // JVMSpec| } - write_u2(access_flags.get_flags() & JVM_RECOGNIZED_FIELD_MODIFIERS); + write_u2(access_flags.as_field_flags()); write_u2(name_index); write_u2(signature_index); u2 attr_count = 0; @@ -704,7 +704,7 @@ void JvmtiClassFileReconstituter::write_method_info(const methodHandle& method) return; } - write_u2(access_flags.get_flags() & JVM_RECOGNIZED_METHOD_MODIFIERS); + write_u2(access_flags.as_method_flags()); write_u2(const_method->name_index()); write_u2(const_method->signature_index()); @@ -919,7 +919,7 @@ void JvmtiClassFileReconstituter::write_class_file_format() { copy_cpool_bytes(writeable_address(cpool_size())); // JVMSpec| u2 access_flags; - write_u2(ik()->access_flags().get_flags() & JVM_RECOGNIZED_CLASS_MODIFIERS); + write_u2(ik()->access_flags().as_class_flags()); // JVMSpec| u2 this_class; // JVMSpec| u2 super_class; diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp index 554b4baf7b2..e97bfc30042 100644 --- a/src/hotspot/share/prims/jvmtiEnv.cpp +++ b/src/hotspot/share/prims/jvmtiEnv.cpp @@ -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 @@ -3149,7 +3149,7 @@ jvmtiError JvmtiEnv::GetFieldModifiers(fieldDescriptor* fdesc_ptr, jint* modifiers_ptr) { AccessFlags resultFlags = fdesc_ptr->access_flags(); - jint result = resultFlags.as_int(); + jint result = resultFlags.as_field_flags(); *modifiers_ptr = result; return JVMTI_ERROR_NONE; @@ -3228,7 +3228,7 @@ JvmtiEnv::GetMethodDeclaringClass(Method* method, jclass* declaring_class_ptr) { jvmtiError JvmtiEnv::GetMethodModifiers(Method* method, jint* modifiers_ptr) { NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID); - (*modifiers_ptr) = method->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS; + (*modifiers_ptr) = method->access_flags().as_method_flags(); return JVMTI_ERROR_NONE; } /* end GetMethodModifiers */ diff --git a/src/hotspot/share/prims/jvmtiEventController.cpp b/src/hotspot/share/prims/jvmtiEventController.cpp index df14047e700..32d691a5793 100644 --- a/src/hotspot/share/prims/jvmtiEventController.cpp +++ b/src/hotspot/share/prims/jvmtiEventController.cpp @@ -598,7 +598,7 @@ JvmtiEventControllerPrivate::recompute_thread_enabled(JvmtiThreadState *state) { } // compute interp_only mode bool should_be_interp = (any_env_enabled & INTERP_EVENT_BITS) != 0 || has_frame_pops; - bool is_now_interp = state->is_interp_only_mode(); + bool is_now_interp = state->is_interp_only_mode() || state->is_pending_interp_only_mode(); if (should_be_interp != is_now_interp) { if (should_be_interp) { diff --git a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp index a982ac97c47..0a53eadbbd8 100644 --- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp +++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp @@ -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 @@ -1005,8 +1005,8 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions( } // Check whether class modifiers are the same. - jushort old_flags = (jushort) the_class->access_flags().get_flags(); - jushort new_flags = (jushort) scratch_class->access_flags().get_flags(); + u2 old_flags = the_class->access_flags().as_class_flags(); + u2 new_flags = scratch_class->access_flags().as_class_flags(); if (old_flags != new_flags) { log_info(redefine, class, normalize) ("redefined class %s modifiers change error: modifiers changed from %d to %d.", @@ -1040,9 +1040,9 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions( return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED; } // access - old_flags = old_fs.access_flags().as_short(); - new_flags = new_fs.access_flags().as_short(); - if ((old_flags ^ new_flags) & JVM_RECOGNIZED_FIELD_MODIFIERS) { + old_flags = old_fs.access_flags().as_field_flags(); + new_flags = new_fs.access_flags().as_field_flags(); + if (old_flags != new_flags) { log_info(redefine, class, normalize) ("redefined class %s field %s change error: modifiers changed from %d to %d.", the_class->external_name(), name_sym2->as_C_string(), old_flags, new_flags); @@ -1147,8 +1147,8 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions( switch (method_was) { case matched: // methods match, be sure modifiers do too - old_flags = (jushort) k_old_method->access_flags().get_flags(); - new_flags = (jushort) k_new_method->access_flags().get_flags(); + old_flags = k_old_method->access_flags().as_method_flags(); + new_flags = k_new_method->access_flags().as_method_flags(); if ((old_flags ^ new_flags) & ~(JVM_ACC_NATIVE)) { log_info(redefine, class, normalize) ("redefined class %s method %s modifiers error: modifiers changed from %d to %d", diff --git a/src/hotspot/share/prims/methodHandles.cpp b/src/hotspot/share/prims/methodHandles.cpp index 1e44ea95731..5b406828510 100644 --- a/src/hotspot/share/prims/methodHandles.cpp +++ b/src/hotspot/share/prims/methodHandles.cpp @@ -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 @@ -239,7 +239,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { assert(m.not_null(), "null method handle"); InstanceKlass* m_klass = m->method_holder(); assert(m_klass != nullptr, "null holder for method handle"); - int flags = (jushort)( m->access_flags().as_short() & JVM_RECOGNIZED_METHOD_MODIFIERS ); + int flags = (m->access_flags().as_method_flags()); int vmindex = Method::invalid_vtable_index; LogTarget(Debug, methodhandles, indy) lt_indy; @@ -352,7 +352,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { oop MethodHandles::init_field_MemberName(Handle mname, fieldDescriptor& fd, bool is_setter) { InstanceKlass* ik = fd.field_holder(); - int flags = (jushort)( fd.access_flags().as_short() & JVM_RECOGNIZED_FIELD_MODIFIERS ); + int flags = fd.access_flags().as_field_flags(); flags |= IS_FIELD | ((fd.is_static() ? JVM_REF_getStatic : JVM_REF_getField) << REFERENCE_KIND_SHIFT); if (fd.is_trusted_final()) flags |= TRUSTED_FINAL; if (is_setter) flags += ((JVM_REF_putField - JVM_REF_getField) << REFERENCE_KIND_SHIFT); @@ -404,7 +404,7 @@ bool MethodHandles::is_method_handle_invoke_name(Klass* klass, Symbol* name) { Method* m = iklass->find_method(name, poly_sig); if (m != nullptr) { int required = JVM_ACC_NATIVE | JVM_ACC_VARARGS; - int flags = m->access_flags().as_int(); + int flags = m->access_flags().as_method_flags(); if ((flags & required) == required) { return true; } @@ -417,7 +417,7 @@ bool MethodHandles::is_method_handle_invoke_name(Klass* klass, Symbol* name) { for (; ms < me; ms++) { Method* m = iklass->methods()->at(ms); int required = JVM_ACC_NATIVE | JVM_ACC_VARARGS; - int flags = m->access_flags().as_int(); + int flags = m->access_flags().as_method_flags(); if ((flags & required) == required && ArgumentCount(m->signature()).size() == 1) { return true; } @@ -522,7 +522,7 @@ bool MethodHandles::is_signature_polymorphic_public_name(Klass* klass, Symbol* n for (; ms < me; ms++) { Method* m = iklass->methods()->at(ms); int required = JVM_ACC_NATIVE | JVM_ACC_VARARGS | JVM_ACC_PUBLIC; - int flags = m->access_flags().as_int(); + int flags = m->access_flags().as_method_flags(); if ((flags & required) == required && ArgumentCount(m->signature()).size() == 1) { return true; } diff --git a/src/hotspot/share/runtime/continuationFreezeThaw.cpp b/src/hotspot/share/runtime/continuationFreezeThaw.cpp index a6c8e64e55e..ccbcaf452af 100644 --- a/src/hotspot/share/runtime/continuationFreezeThaw.cpp +++ b/src/hotspot/share/runtime/continuationFreezeThaw.cpp @@ -2603,6 +2603,7 @@ void ThawBase::recurse_thaw_compiled_frame(const frame& hf, frame& caller, int n || (stub_caller && f.cb()->as_nmethod()->is_marked_for_deoptimization())) { // The caller of the safepoint stub when the continuation is preempted is not at a call instruction, and so // cannot rely on nmethod patching for deopt. + assert(_thread->is_interp_only_mode() || stub_caller, "expected a stub-caller"); log_develop_trace(continuations)("Deoptimizing thawed frame"); DEBUG_ONLY(ContinuationHelper::Frame::patch_pc(f, nullptr)); diff --git a/src/hotspot/share/runtime/reflection.cpp b/src/hotspot/share/runtime/reflection.cpp index 7739cff03bf..3aef7028a79 100644 --- a/src/hotspot/share/runtime/reflection.cpp +++ b/src/hotspot/share/runtime/reflection.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 @@ -778,7 +778,7 @@ oop Reflection::new_method(const methodHandle& method, bool for_constant_pool_ac Handle name = Handle(THREAD, name_oop); if (name == nullptr) return nullptr; - const int modifiers = method->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS; + const int modifiers = method->access_flags().as_method_flags(); Handle mh = java_lang_reflect_Method::create(CHECK_NULL); @@ -819,7 +819,7 @@ oop Reflection::new_constructor(const methodHandle& method, TRAPS) { objArrayHandle exception_types = get_exception_types(method, CHECK_NULL); assert(!exception_types.is_null(), "cannot return null"); - const int modifiers = method->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS; + const int modifiers = method->access_flags().as_method_flags(); Handle ch = java_lang_reflect_Constructor::create(CHECK_NULL); @@ -859,7 +859,7 @@ oop Reflection::new_field(fieldDescriptor* fd, TRAPS) { java_lang_reflect_Field::set_trusted_final(rh()); } // Note the ACC_ANNOTATION bit, which is a per-class access flag, is never set here. - java_lang_reflect_Field::set_modifiers(rh(), fd->access_flags().as_int() & JVM_RECOGNIZED_FIELD_MODIFIERS); + java_lang_reflect_Field::set_modifiers(rh(), fd->access_flags().as_field_flags()); java_lang_reflect_Field::set_override(rh(), false); if (fd->has_generic_signature()) { Symbol* gs = fd->generic_signature(); diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index 941309ca2ac..fdce6d21531 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -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 @@ -1264,36 +1264,49 @@ static bool monitors_used_above_threshold(MonitorList* list) { if (MonitorUsedDeflationThreshold == 0) { // disabled case is easy return false; } - // Start with ceiling based on a per-thread estimate: - size_t ceiling = ObjectSynchronizer::in_use_list_ceiling(); - size_t old_ceiling = ceiling; - if (ceiling < list->max()) { - // The max used by the system has exceeded the ceiling so use that: - ceiling = list->max(); - } size_t monitors_used = list->count(); if (monitors_used == 0) { // empty list is easy return false; } - if (NoAsyncDeflationProgressMax != 0 && - _no_progress_cnt >= NoAsyncDeflationProgressMax) { - double remainder = (100.0 - MonitorUsedDeflationThreshold) / 100.0; - size_t new_ceiling = ceiling + (size_t)((double)ceiling * remainder) + 1; - ObjectSynchronizer::set_in_use_list_ceiling(new_ceiling); - log_info(monitorinflation)("Too many deflations without progress; " - "bumping in_use_list_ceiling from " SIZE_FORMAT - " to " SIZE_FORMAT, old_ceiling, new_ceiling); - _no_progress_cnt = 0; - ceiling = new_ceiling; - } + size_t old_ceiling = ObjectSynchronizer::in_use_list_ceiling(); + // Make sure that we use a ceiling value that is not lower than + // previous, not lower than the recorded max used by the system, and + // not lower than the current number of monitors in use (which can + // race ahead of max). The result is guaranteed > 0. + size_t ceiling = MAX3(old_ceiling, list->max(), monitors_used); // Check if our monitor usage is above the threshold: size_t monitor_usage = (monitors_used * 100LL) / ceiling; if (int(monitor_usage) > MonitorUsedDeflationThreshold) { + // Deflate monitors if over the threshold percentage, unless no + // progress on previous deflations. + bool is_above_threshold = true; + + // Check if it's time to adjust the in_use_list_ceiling up, due + // to too many async deflation attempts without any progress. + if (NoAsyncDeflationProgressMax != 0 && + _no_progress_cnt >= NoAsyncDeflationProgressMax) { + double remainder = (100.0 - MonitorUsedDeflationThreshold) / 100.0; + size_t delta = (size_t)(ceiling * remainder) + 1; + size_t new_ceiling = (ceiling > SIZE_MAX - delta) + ? SIZE_MAX // Overflow, let's clamp new_ceiling. + : ceiling + delta; + + ObjectSynchronizer::set_in_use_list_ceiling(new_ceiling); + log_info(monitorinflation)("Too many deflations without progress; " + "bumping in_use_list_ceiling from " SIZE_FORMAT + " to " SIZE_FORMAT, old_ceiling, new_ceiling); + _no_progress_cnt = 0; + ceiling = new_ceiling; + + // Check if our monitor usage is still above the threshold: + monitor_usage = (monitors_used * 100LL) / ceiling; + is_above_threshold = int(monitor_usage) > MonitorUsedDeflationThreshold; + } log_info(monitorinflation)("monitors_used=" SIZE_FORMAT ", ceiling=" SIZE_FORMAT ", monitor_usage=" SIZE_FORMAT ", threshold=%d", monitors_used, ceiling, monitor_usage, MonitorUsedDeflationThreshold); - return true; + return is_above_threshold; } return false; diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index f5cb2805c8e..b6e54575519 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -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 @@ -263,7 +263,7 @@ nonstatic_field(Klass, _secondary_supers, Array*) \ nonstatic_field(Klass, _primary_supers[0], Klass*) \ nonstatic_field(Klass, _java_mirror, OopHandle) \ - nonstatic_field(Klass, _modifier_flags, jint) \ + nonstatic_field(Klass, _modifier_flags, u2) \ nonstatic_field(Klass, _super, Klass*) \ volatile_nonstatic_field(Klass, _subklass, Klass*) \ nonstatic_field(Klass, _layout_helper, jint) \ @@ -1017,7 +1017,7 @@ nonstatic_field(vframeArrayElement, _bci, int) \ nonstatic_field(vframeArrayElement, _method, Method*) \ \ - nonstatic_field(AccessFlags, _flags, jint) \ + nonstatic_field(AccessFlags, _flags, u2) \ nonstatic_field(elapsedTimer, _counter, jlong) \ nonstatic_field(elapsedTimer, _active, bool) \ nonstatic_field(InvocationCounter, _counter, unsigned int) \ diff --git a/src/hotspot/share/utilities/accessFlags.cpp b/src/hotspot/share/utilities/accessFlags.cpp index ec68d124488..fc11491174f 100644 --- a/src/hotspot/share/utilities/accessFlags.cpp +++ b/src/hotspot/share/utilities/accessFlags.cpp @@ -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 @@ -47,5 +47,5 @@ void AccessFlags::print_on(outputStream* st) const { #endif // !PRODUCT || INCLUDE_JVMTI void accessFlags_init() { - assert(sizeof(AccessFlags) == sizeof(jint), "just checking size of flags"); + assert(sizeof(AccessFlags) == sizeof(u2), "just checking size of flags"); } diff --git a/src/hotspot/share/utilities/accessFlags.hpp b/src/hotspot/share/utilities/accessFlags.hpp index 74ccbd20ac1..a752c09cb42 100644 --- a/src/hotspot/share/utilities/accessFlags.hpp +++ b/src/hotspot/share/utilities/accessFlags.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 @@ -30,28 +30,19 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" -// AccessFlags is an abstraction over Java access flags. +// AccessFlags is an abstraction over Java ACC flags. +// See generated file classfile_constants.h for shared JVM_ACC_XXX access flags class outputStream; -enum { - // See jvm.h for shared JVM_ACC_XXX access flags - - // flags actually put in .class file - JVM_ACC_WRITTEN_FLAGS = 0x00007FFF, - - // Do not add new ACC flags here. -}; - - class AccessFlags { friend class VMStructs; private: - jint _flags; // TODO: move 4 access flags above to Klass and change to u2 + u2 _flags; public: AccessFlags() : _flags(0) {} - explicit AccessFlags(jint flags) : _flags(flags) {} + explicit AccessFlags(u2 flags) : _flags(flags) {} // Java access flags bool is_public () const { return (_flags & JVM_ACC_PUBLIC ) != 0; } @@ -70,15 +61,10 @@ class AccessFlags { // Attribute flags bool is_synthetic () const { return (_flags & JVM_ACC_SYNTHETIC ) != 0; } - // get .class file flags - jint get_flags () const { return (_flags & JVM_ACC_WRITTEN_FLAGS); } + // get as integral value + u2 as_unsigned_short() const { return _flags; } - // Initialization - void set_field_flags(jint flags) { - assert((flags & JVM_RECOGNIZED_FIELD_MODIFIERS) == flags, "only recognized flags"); - _flags = (flags & JVM_RECOGNIZED_FIELD_MODIFIERS); - } - void set_flags(jint flags) { _flags = (flags & JVM_ACC_WRITTEN_FLAGS); } + void set_flags(u2 flags) { _flags = flags; } private: friend class Klass; @@ -90,11 +76,22 @@ class AccessFlags { void set_is_synthetic() { _flags |= JVM_ACC_SYNTHETIC; } public: - // Conversion - jshort as_short() const { return (jshort)_flags; } - jint as_int() const { return _flags; } + inline friend AccessFlags accessFlags_from(u2 flags); - inline friend AccessFlags accessFlags_from(jint flags); + u2 as_method_flags() const { + assert((_flags & JVM_RECOGNIZED_METHOD_MODIFIERS) == _flags, "only recognized flags"); + return _flags; + } + + u2 as_field_flags() const { + assert((_flags & JVM_RECOGNIZED_FIELD_MODIFIERS) == _flags, "only recognized flags"); + return _flags; + } + + u2 as_class_flags() const { + assert((_flags & JVM_RECOGNIZED_CLASS_MODIFIERS) == _flags, "only recognized flags"); + return _flags; + } // Printing/debugging #if INCLUDE_JVMTI @@ -104,7 +101,7 @@ class AccessFlags { #endif }; -inline AccessFlags accessFlags_from(jint flags) { +inline AccessFlags accessFlags_from(u2 flags) { AccessFlags af; af._flags = flags; return af; diff --git a/src/java.base/share/classes/com/sun/crypto/provider/HKDFKeyDerivation.java b/src/java.base/share/classes/com/sun/crypto/provider/HKDFKeyDerivation.java index a9988bbc115..9b4cf557598 100644 --- a/src/java.base/share/classes/com/sun/crypto/provider/HKDFKeyDerivation.java +++ b/src/java.base/share/classes/com/sun/crypto/provider/HKDFKeyDerivation.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 @@ -180,8 +180,8 @@ protected byte[] engineDeriveData(AlgorithmParameterSpec derivationSpec) } else if (derivationSpec instanceof HKDFParameterSpec.Expand anExpand) { // set this value in the "if" if ((pseudoRandomKey = anExpand.prk().getEncoded()) == null) { - throw new AssertionError( - "PRK is required for HKDFParameterSpec.Expand"); + throw new InvalidAlgorithmParameterException( + "Cannot retrieve PRK for HKDFParameterSpec.Expand"); } // set this value in the "if" if ((info = anExpand.info()) == null) { @@ -411,4 +411,4 @@ public HKDFSHA512(KDFParameters kdfParameters) } } -} \ No newline at end of file +} diff --git a/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java b/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java index e1518ab6a02..260fc982dab 100644 --- a/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java +++ b/src/java.base/share/classes/java/lang/classfile/constantpool/ConstantPoolBuilder.java @@ -400,7 +400,7 @@ default MethodHandleEntry methodHandleEntry(DirectMethodHandleDesc descriptor) { * * @param refKind the reference kind of the method handle * @param reference the {@code MemberRefEntry} - * @see MethodHandleInfo##refKinds Reference kinds + * @see MethodHandleInfo##refkinds Reference kinds * @see MethodHandleEntry#kind() MethodHandleEntry::kind * @see MethodHandleEntry#reference() MethodHandleEntry::reference */ diff --git a/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java b/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java index e51e158c93c..9ccaf92b8d6 100644 --- a/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java +++ b/src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java @@ -145,12 +145,17 @@ private NativeMemorySegmentImpl reinterpretInternal(Class callerClass, long n Reflection.ensureNativeAccess(callerClass, MemorySegment.class, "reinterpret", false); Utils.checkNonNegativeArgument(newSize, "newSize"); if (!isNative()) throw new UnsupportedOperationException("Not a native segment"); - Runnable action = cleanup != null ? - () -> cleanup.accept(SegmentFactories.makeNativeSegmentUnchecked(address(), newSize)) : - null; + Runnable action = cleanupAction(address(), newSize, cleanup); return SegmentFactories.makeNativeSegmentUnchecked(address(), newSize, scope, readOnly, action); } + // Using a static helper method ensures there is no unintended lambda capturing of `this` + private static Runnable cleanupAction(long address, long newSize, Consumer cleanup) { + return cleanup != null ? + () -> cleanup.accept(SegmentFactories.makeNativeSegmentUnchecked(address, newSize)) : + null; + } + private AbstractMemorySegmentImpl asSliceNoCheck(long offset, long newSize) { return dup(offset, newSize, readOnly, scope); } diff --git a/src/java.base/share/data/tzdata/solar87 b/src/java.base/share/data/tzdata/solar87 deleted file mode 100644 index 0512ca410c1..00000000000 --- a/src/java.base/share/data/tzdata/solar87 +++ /dev/null @@ -1,413 +0,0 @@ -# -# 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. -# -#
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# So much for footnotes about Saudi Arabia.
-# Apparent noon times below are for Riyadh; your mileage will vary.
-# Times were computed using formulas in the U.S. Naval Observatory's
-# Almanac for Computers 1987; the formulas "will give EqT to an accuracy of
-# [plus or minus two] seconds during the current year."
-#
-# Rounding to the nearest five seconds results in fewer than
-# 256 different "time types"--a limit that's faced because time types are
-# stored on disk as unsigned chars.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	sol87	1987	only	-	Jan	1	12:03:20s -0:03:20 -
-Rule	sol87	1987	only	-	Jan	2	12:03:50s -0:03:50 -
-Rule	sol87	1987	only	-	Jan	3	12:04:15s -0:04:15 -
-Rule	sol87	1987	only	-	Jan	4	12:04:45s -0:04:45 -
-Rule	sol87	1987	only	-	Jan	5	12:05:10s -0:05:10 -
-Rule	sol87	1987	only	-	Jan	6	12:05:40s -0:05:40 -
-Rule	sol87	1987	only	-	Jan	7	12:06:05s -0:06:05 -
-Rule	sol87	1987	only	-	Jan	8	12:06:30s -0:06:30 -
-Rule	sol87	1987	only	-	Jan	9	12:06:55s -0:06:55 -
-Rule	sol87	1987	only	-	Jan	10	12:07:20s -0:07:20 -
-Rule	sol87	1987	only	-	Jan	11	12:07:45s -0:07:45 -
-Rule	sol87	1987	only	-	Jan	12	12:08:10s -0:08:10 -
-Rule	sol87	1987	only	-	Jan	13	12:08:30s -0:08:30 -
-Rule	sol87	1987	only	-	Jan	14	12:08:55s -0:08:55 -
-Rule	sol87	1987	only	-	Jan	15	12:09:15s -0:09:15 -
-Rule	sol87	1987	only	-	Jan	16	12:09:35s -0:09:35 -
-Rule	sol87	1987	only	-	Jan	17	12:09:55s -0:09:55 -
-Rule	sol87	1987	only	-	Jan	18	12:10:15s -0:10:15 -
-Rule	sol87	1987	only	-	Jan	19	12:10:35s -0:10:35 -
-Rule	sol87	1987	only	-	Jan	20	12:10:55s -0:10:55 -
-Rule	sol87	1987	only	-	Jan	21	12:11:10s -0:11:10 -
-Rule	sol87	1987	only	-	Jan	22	12:11:30s -0:11:30 -
-Rule	sol87	1987	only	-	Jan	23	12:11:45s -0:11:45 -
-Rule	sol87	1987	only	-	Jan	24	12:12:00s -0:12:00 -
-Rule	sol87	1987	only	-	Jan	25	12:12:15s -0:12:15 -
-Rule	sol87	1987	only	-	Jan	26	12:12:30s -0:12:30 -
-Rule	sol87	1987	only	-	Jan	27	12:12:40s -0:12:40 -
-Rule	sol87	1987	only	-	Jan	28	12:12:55s -0:12:55 -
-Rule	sol87	1987	only	-	Jan	29	12:13:05s -0:13:05 -
-Rule	sol87	1987	only	-	Jan	30	12:13:15s -0:13:15 -
-Rule	sol87	1987	only	-	Jan	31	12:13:25s -0:13:25 -
-Rule	sol87	1987	only	-	Feb	1	12:13:35s -0:13:35 -
-Rule	sol87	1987	only	-	Feb	2	12:13:40s -0:13:40 -
-Rule	sol87	1987	only	-	Feb	3	12:13:50s -0:13:50 -
-Rule	sol87	1987	only	-	Feb	4	12:13:55s -0:13:55 -
-Rule	sol87	1987	only	-	Feb	5	12:14:00s -0:14:00 -
-Rule	sol87	1987	only	-	Feb	6	12:14:05s -0:14:05 -
-Rule	sol87	1987	only	-	Feb	7	12:14:10s -0:14:10 -
-Rule	sol87	1987	only	-	Feb	8	12:14:10s -0:14:10 -
-Rule	sol87	1987	only	-	Feb	9	12:14:15s -0:14:15 -
-Rule	sol87	1987	only	-	Feb	10	12:14:15s -0:14:15 -
-Rule	sol87	1987	only	-	Feb	11	12:14:15s -0:14:15 -
-Rule	sol87	1987	only	-	Feb	12	12:14:15s -0:14:15 -
-Rule	sol87	1987	only	-	Feb	13	12:14:15s -0:14:15 -
-Rule	sol87	1987	only	-	Feb	14	12:14:15s -0:14:15 -
-Rule	sol87	1987	only	-	Feb	15	12:14:10s -0:14:10 -
-Rule	sol87	1987	only	-	Feb	16	12:14:10s -0:14:10 -
-Rule	sol87	1987	only	-	Feb	17	12:14:05s -0:14:05 -
-Rule	sol87	1987	only	-	Feb	18	12:14:00s -0:14:00 -
-Rule	sol87	1987	only	-	Feb	19	12:13:55s -0:13:55 -
-Rule	sol87	1987	only	-	Feb	20	12:13:50s -0:13:50 -
-Rule	sol87	1987	only	-	Feb	21	12:13:45s -0:13:45 -
-Rule	sol87	1987	only	-	Feb	22	12:13:35s -0:13:35 -
-Rule	sol87	1987	only	-	Feb	23	12:13:30s -0:13:30 -
-Rule	sol87	1987	only	-	Feb	24	12:13:20s -0:13:20 -
-Rule	sol87	1987	only	-	Feb	25	12:13:10s -0:13:10 -
-Rule	sol87	1987	only	-	Feb	26	12:13:00s -0:13:00 -
-Rule	sol87	1987	only	-	Feb	27	12:12:50s -0:12:50 -
-Rule	sol87	1987	only	-	Feb	28	12:12:40s -0:12:40 -
-Rule	sol87	1987	only	-	Mar	1	12:12:30s -0:12:30 -
-Rule	sol87	1987	only	-	Mar	2	12:12:20s -0:12:20 -
-Rule	sol87	1987	only	-	Mar	3	12:12:05s -0:12:05 -
-Rule	sol87	1987	only	-	Mar	4	12:11:55s -0:11:55 -
-Rule	sol87	1987	only	-	Mar	5	12:11:40s -0:11:40 -
-Rule	sol87	1987	only	-	Mar	6	12:11:25s -0:11:25 -
-Rule	sol87	1987	only	-	Mar	7	12:11:15s -0:11:15 -
-Rule	sol87	1987	only	-	Mar	8	12:11:00s -0:11:00 -
-Rule	sol87	1987	only	-	Mar	9	12:10:45s -0:10:45 -
-Rule	sol87	1987	only	-	Mar	10	12:10:30s -0:10:30 -
-Rule	sol87	1987	only	-	Mar	11	12:10:15s -0:10:15 -
-Rule	sol87	1987	only	-	Mar	12	12:09:55s -0:09:55 -
-Rule	sol87	1987	only	-	Mar	13	12:09:40s -0:09:40 -
-Rule	sol87	1987	only	-	Mar	14	12:09:25s -0:09:25 -
-Rule	sol87	1987	only	-	Mar	15	12:09:10s -0:09:10 -
-Rule	sol87	1987	only	-	Mar	16	12:08:50s -0:08:50 -
-Rule	sol87	1987	only	-	Mar	17	12:08:35s -0:08:35 -
-Rule	sol87	1987	only	-	Mar	18	12:08:15s -0:08:15 -
-Rule	sol87	1987	only	-	Mar	19	12:08:00s -0:08:00 -
-Rule	sol87	1987	only	-	Mar	20	12:07:40s -0:07:40 -
-Rule	sol87	1987	only	-	Mar	21	12:07:25s -0:07:25 -
-Rule	sol87	1987	only	-	Mar	22	12:07:05s -0:07:05 -
-Rule	sol87	1987	only	-	Mar	23	12:06:50s -0:06:50 -
-Rule	sol87	1987	only	-	Mar	24	12:06:30s -0:06:30 -
-Rule	sol87	1987	only	-	Mar	25	12:06:10s -0:06:10 -
-Rule	sol87	1987	only	-	Mar	26	12:05:55s -0:05:55 -
-Rule	sol87	1987	only	-	Mar	27	12:05:35s -0:05:35 -
-Rule	sol87	1987	only	-	Mar	28	12:05:15s -0:05:15 -
-Rule	sol87	1987	only	-	Mar	29	12:05:00s -0:05:00 -
-Rule	sol87	1987	only	-	Mar	30	12:04:40s -0:04:40 -
-Rule	sol87	1987	only	-	Mar	31	12:04:25s -0:04:25 -
-Rule	sol87	1987	only	-	Apr	1	12:04:05s -0:04:05 -
-Rule	sol87	1987	only	-	Apr	2	12:03:45s -0:03:45 -
-Rule	sol87	1987	only	-	Apr	3	12:03:30s -0:03:30 -
-Rule	sol87	1987	only	-	Apr	4	12:03:10s -0:03:10 -
-Rule	sol87	1987	only	-	Apr	5	12:02:55s -0:02:55 -
-Rule	sol87	1987	only	-	Apr	6	12:02:35s -0:02:35 -
-Rule	sol87	1987	only	-	Apr	7	12:02:20s -0:02:20 -
-Rule	sol87	1987	only	-	Apr	8	12:02:05s -0:02:05 -
-Rule	sol87	1987	only	-	Apr	9	12:01:45s -0:01:45 -
-Rule	sol87	1987	only	-	Apr	10	12:01:30s -0:01:30 -
-Rule	sol87	1987	only	-	Apr	11	12:01:15s -0:01:15 -
-Rule	sol87	1987	only	-	Apr	12	12:00:55s -0:00:55 -
-Rule	sol87	1987	only	-	Apr	13	12:00:40s -0:00:40 -
-Rule	sol87	1987	only	-	Apr	14	12:00:25s -0:00:25 -
-Rule	sol87	1987	only	-	Apr	15	12:00:10s -0:00:10 -
-Rule	sol87	1987	only	-	Apr	16	11:59:55s 0:00:05 -
-Rule	sol87	1987	only	-	Apr	17	11:59:45s 0:00:15 -
-Rule	sol87	1987	only	-	Apr	18	11:59:30s 0:00:30 -
-Rule	sol87	1987	only	-	Apr	19	11:59:15s 0:00:45 -
-Rule	sol87	1987	only	-	Apr	20	11:59:05s 0:00:55 -
-Rule	sol87	1987	only	-	Apr	21	11:58:50s 0:01:10 -
-Rule	sol87	1987	only	-	Apr	22	11:58:40s 0:01:20 -
-Rule	sol87	1987	only	-	Apr	23	11:58:25s 0:01:35 -
-Rule	sol87	1987	only	-	Apr	24	11:58:15s 0:01:45 -
-Rule	sol87	1987	only	-	Apr	25	11:58:05s 0:01:55 -
-Rule	sol87	1987	only	-	Apr	26	11:57:55s 0:02:05 -
-Rule	sol87	1987	only	-	Apr	27	11:57:45s 0:02:15 -
-Rule	sol87	1987	only	-	Apr	28	11:57:35s 0:02:25 -
-Rule	sol87	1987	only	-	Apr	29	11:57:25s 0:02:35 -
-Rule	sol87	1987	only	-	Apr	30	11:57:15s 0:02:45 -
-Rule	sol87	1987	only	-	May	1	11:57:10s 0:02:50 -
-Rule	sol87	1987	only	-	May	2	11:57:00s 0:03:00 -
-Rule	sol87	1987	only	-	May	3	11:56:55s 0:03:05 -
-Rule	sol87	1987	only	-	May	4	11:56:50s 0:03:10 -
-Rule	sol87	1987	only	-	May	5	11:56:45s 0:03:15 -
-Rule	sol87	1987	only	-	May	6	11:56:40s 0:03:20 -
-Rule	sol87	1987	only	-	May	7	11:56:35s 0:03:25 -
-Rule	sol87	1987	only	-	May	8	11:56:30s 0:03:30 -
-Rule	sol87	1987	only	-	May	9	11:56:25s 0:03:35 -
-Rule	sol87	1987	only	-	May	10	11:56:25s 0:03:35 -
-Rule	sol87	1987	only	-	May	11	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	12	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	13	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	14	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	15	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	16	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	17	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	18	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	May	19	11:56:25s 0:03:35 -
-Rule	sol87	1987	only	-	May	20	11:56:25s 0:03:35 -
-Rule	sol87	1987	only	-	May	21	11:56:30s 0:03:30 -
-Rule	sol87	1987	only	-	May	22	11:56:35s 0:03:25 -
-Rule	sol87	1987	only	-	May	23	11:56:40s 0:03:20 -
-Rule	sol87	1987	only	-	May	24	11:56:45s 0:03:15 -
-Rule	sol87	1987	only	-	May	25	11:56:50s 0:03:10 -
-Rule	sol87	1987	only	-	May	26	11:56:55s 0:03:05 -
-Rule	sol87	1987	only	-	May	27	11:57:00s 0:03:00 -
-Rule	sol87	1987	only	-	May	28	11:57:10s 0:02:50 -
-Rule	sol87	1987	only	-	May	29	11:57:15s 0:02:45 -
-Rule	sol87	1987	only	-	May	30	11:57:25s 0:02:35 -
-Rule	sol87	1987	only	-	May	31	11:57:30s 0:02:30 -
-Rule	sol87	1987	only	-	Jun	1	11:57:40s 0:02:20 -
-Rule	sol87	1987	only	-	Jun	2	11:57:50s 0:02:10 -
-Rule	sol87	1987	only	-	Jun	3	11:58:00s 0:02:00 -
-Rule	sol87	1987	only	-	Jun	4	11:58:10s 0:01:50 -
-Rule	sol87	1987	only	-	Jun	5	11:58:20s 0:01:40 -
-Rule	sol87	1987	only	-	Jun	6	11:58:30s 0:01:30 -
-Rule	sol87	1987	only	-	Jun	7	11:58:40s 0:01:20 -
-Rule	sol87	1987	only	-	Jun	8	11:58:50s 0:01:10 -
-Rule	sol87	1987	only	-	Jun	9	11:59:05s 0:00:55 -
-Rule	sol87	1987	only	-	Jun	10	11:59:15s 0:00:45 -
-Rule	sol87	1987	only	-	Jun	11	11:59:30s 0:00:30 -
-Rule	sol87	1987	only	-	Jun	12	11:59:40s 0:00:20 -
-Rule	sol87	1987	only	-	Jun	13	11:59:50s 0:00:10 -
-Rule	sol87	1987	only	-	Jun	14	12:00:05s -0:00:05 -
-Rule	sol87	1987	only	-	Jun	15	12:00:15s -0:00:15 -
-Rule	sol87	1987	only	-	Jun	16	12:00:30s -0:00:30 -
-Rule	sol87	1987	only	-	Jun	17	12:00:45s -0:00:45 -
-Rule	sol87	1987	only	-	Jun	18	12:00:55s -0:00:55 -
-Rule	sol87	1987	only	-	Jun	19	12:01:10s -0:01:10 -
-Rule	sol87	1987	only	-	Jun	20	12:01:20s -0:01:20 -
-Rule	sol87	1987	only	-	Jun	21	12:01:35s -0:01:35 -
-Rule	sol87	1987	only	-	Jun	22	12:01:50s -0:01:50 -
-Rule	sol87	1987	only	-	Jun	23	12:02:00s -0:02:00 -
-Rule	sol87	1987	only	-	Jun	24	12:02:15s -0:02:15 -
-Rule	sol87	1987	only	-	Jun	25	12:02:25s -0:02:25 -
-Rule	sol87	1987	only	-	Jun	26	12:02:40s -0:02:40 -
-Rule	sol87	1987	only	-	Jun	27	12:02:50s -0:02:50 -
-Rule	sol87	1987	only	-	Jun	28	12:03:05s -0:03:05 -
-Rule	sol87	1987	only	-	Jun	29	12:03:15s -0:03:15 -
-Rule	sol87	1987	only	-	Jun	30	12:03:30s -0:03:30 -
-Rule	sol87	1987	only	-	Jul	1	12:03:40s -0:03:40 -
-Rule	sol87	1987	only	-	Jul	2	12:03:50s -0:03:50 -
-Rule	sol87	1987	only	-	Jul	3	12:04:05s -0:04:05 -
-Rule	sol87	1987	only	-	Jul	4	12:04:15s -0:04:15 -
-Rule	sol87	1987	only	-	Jul	5	12:04:25s -0:04:25 -
-Rule	sol87	1987	only	-	Jul	6	12:04:35s -0:04:35 -
-Rule	sol87	1987	only	-	Jul	7	12:04:45s -0:04:45 -
-Rule	sol87	1987	only	-	Jul	8	12:04:55s -0:04:55 -
-Rule	sol87	1987	only	-	Jul	9	12:05:05s -0:05:05 -
-Rule	sol87	1987	only	-	Jul	10	12:05:15s -0:05:15 -
-Rule	sol87	1987	only	-	Jul	11	12:05:20s -0:05:20 -
-Rule	sol87	1987	only	-	Jul	12	12:05:30s -0:05:30 -
-Rule	sol87	1987	only	-	Jul	13	12:05:40s -0:05:40 -
-Rule	sol87	1987	only	-	Jul	14	12:05:45s -0:05:45 -
-Rule	sol87	1987	only	-	Jul	15	12:05:50s -0:05:50 -
-Rule	sol87	1987	only	-	Jul	16	12:06:00s -0:06:00 -
-Rule	sol87	1987	only	-	Jul	17	12:06:05s -0:06:05 -
-Rule	sol87	1987	only	-	Jul	18	12:06:10s -0:06:10 -
-Rule	sol87	1987	only	-	Jul	19	12:06:15s -0:06:15 -
-Rule	sol87	1987	only	-	Jul	20	12:06:15s -0:06:15 -
-Rule	sol87	1987	only	-	Jul	21	12:06:20s -0:06:20 -
-Rule	sol87	1987	only	-	Jul	22	12:06:25s -0:06:25 -
-Rule	sol87	1987	only	-	Jul	23	12:06:25s -0:06:25 -
-Rule	sol87	1987	only	-	Jul	24	12:06:25s -0:06:25 -
-Rule	sol87	1987	only	-	Jul	25	12:06:30s -0:06:30 -
-Rule	sol87	1987	only	-	Jul	26	12:06:30s -0:06:30 -
-Rule	sol87	1987	only	-	Jul	27	12:06:30s -0:06:30 -
-Rule	sol87	1987	only	-	Jul	28	12:06:30s -0:06:30 -
-Rule	sol87	1987	only	-	Jul	29	12:06:25s -0:06:25 -
-Rule	sol87	1987	only	-	Jul	30	12:06:25s -0:06:25 -
-Rule	sol87	1987	only	-	Jul	31	12:06:25s -0:06:25 -
-Rule	sol87	1987	only	-	Aug	1	12:06:20s -0:06:20 -
-Rule	sol87	1987	only	-	Aug	2	12:06:15s -0:06:15 -
-Rule	sol87	1987	only	-	Aug	3	12:06:10s -0:06:10 -
-Rule	sol87	1987	only	-	Aug	4	12:06:05s -0:06:05 -
-Rule	sol87	1987	only	-	Aug	5	12:06:00s -0:06:00 -
-Rule	sol87	1987	only	-	Aug	6	12:05:55s -0:05:55 -
-Rule	sol87	1987	only	-	Aug	7	12:05:50s -0:05:50 -
-Rule	sol87	1987	only	-	Aug	8	12:05:40s -0:05:40 -
-Rule	sol87	1987	only	-	Aug	9	12:05:35s -0:05:35 -
-Rule	sol87	1987	only	-	Aug	10	12:05:25s -0:05:25 -
-Rule	sol87	1987	only	-	Aug	11	12:05:15s -0:05:15 -
-Rule	sol87	1987	only	-	Aug	12	12:05:05s -0:05:05 -
-Rule	sol87	1987	only	-	Aug	13	12:04:55s -0:04:55 -
-Rule	sol87	1987	only	-	Aug	14	12:04:45s -0:04:45 -
-Rule	sol87	1987	only	-	Aug	15	12:04:35s -0:04:35 -
-Rule	sol87	1987	only	-	Aug	16	12:04:25s -0:04:25 -
-Rule	sol87	1987	only	-	Aug	17	12:04:10s -0:04:10 -
-Rule	sol87	1987	only	-	Aug	18	12:04:00s -0:04:00 -
-Rule	sol87	1987	only	-	Aug	19	12:03:45s -0:03:45 -
-Rule	sol87	1987	only	-	Aug	20	12:03:30s -0:03:30 -
-Rule	sol87	1987	only	-	Aug	21	12:03:15s -0:03:15 -
-Rule	sol87	1987	only	-	Aug	22	12:03:00s -0:03:00 -
-Rule	sol87	1987	only	-	Aug	23	12:02:45s -0:02:45 -
-Rule	sol87	1987	only	-	Aug	24	12:02:30s -0:02:30 -
-Rule	sol87	1987	only	-	Aug	25	12:02:15s -0:02:15 -
-Rule	sol87	1987	only	-	Aug	26	12:02:00s -0:02:00 -
-Rule	sol87	1987	only	-	Aug	27	12:01:40s -0:01:40 -
-Rule	sol87	1987	only	-	Aug	28	12:01:25s -0:01:25 -
-Rule	sol87	1987	only	-	Aug	29	12:01:05s -0:01:05 -
-Rule	sol87	1987	only	-	Aug	30	12:00:50s -0:00:50 -
-Rule	sol87	1987	only	-	Aug	31	12:00:30s -0:00:30 -
-Rule	sol87	1987	only	-	Sep	1	12:00:10s -0:00:10 -
-Rule	sol87	1987	only	-	Sep	2	11:59:50s 0:00:10 -
-Rule	sol87	1987	only	-	Sep	3	11:59:35s 0:00:25 -
-Rule	sol87	1987	only	-	Sep	4	11:59:15s 0:00:45 -
-Rule	sol87	1987	only	-	Sep	5	11:58:55s 0:01:05 -
-Rule	sol87	1987	only	-	Sep	6	11:58:35s 0:01:25 -
-Rule	sol87	1987	only	-	Sep	7	11:58:15s 0:01:45 -
-Rule	sol87	1987	only	-	Sep	8	11:57:55s 0:02:05 -
-Rule	sol87	1987	only	-	Sep	9	11:57:30s 0:02:30 -
-Rule	sol87	1987	only	-	Sep	10	11:57:10s 0:02:50 -
-Rule	sol87	1987	only	-	Sep	11	11:56:50s 0:03:10 -
-Rule	sol87	1987	only	-	Sep	12	11:56:30s 0:03:30 -
-Rule	sol87	1987	only	-	Sep	13	11:56:10s 0:03:50 -
-Rule	sol87	1987	only	-	Sep	14	11:55:45s 0:04:15 -
-Rule	sol87	1987	only	-	Sep	15	11:55:25s 0:04:35 -
-Rule	sol87	1987	only	-	Sep	16	11:55:05s 0:04:55 -
-Rule	sol87	1987	only	-	Sep	17	11:54:45s 0:05:15 -
-Rule	sol87	1987	only	-	Sep	18	11:54:20s 0:05:40 -
-Rule	sol87	1987	only	-	Sep	19	11:54:00s 0:06:00 -
-Rule	sol87	1987	only	-	Sep	20	11:53:40s 0:06:20 -
-Rule	sol87	1987	only	-	Sep	21	11:53:15s 0:06:45 -
-Rule	sol87	1987	only	-	Sep	22	11:52:55s 0:07:05 -
-Rule	sol87	1987	only	-	Sep	23	11:52:35s 0:07:25 -
-Rule	sol87	1987	only	-	Sep	24	11:52:15s 0:07:45 -
-Rule	sol87	1987	only	-	Sep	25	11:51:55s 0:08:05 -
-Rule	sol87	1987	only	-	Sep	26	11:51:35s 0:08:25 -
-Rule	sol87	1987	only	-	Sep	27	11:51:10s 0:08:50 -
-Rule	sol87	1987	only	-	Sep	28	11:50:50s 0:09:10 -
-Rule	sol87	1987	only	-	Sep	29	11:50:30s 0:09:30 -
-Rule	sol87	1987	only	-	Sep	30	11:50:10s 0:09:50 -
-Rule	sol87	1987	only	-	Oct	1	11:49:50s 0:10:10 -
-Rule	sol87	1987	only	-	Oct	2	11:49:35s 0:10:25 -
-Rule	sol87	1987	only	-	Oct	3	11:49:15s 0:10:45 -
-Rule	sol87	1987	only	-	Oct	4	11:48:55s 0:11:05 -
-Rule	sol87	1987	only	-	Oct	5	11:48:35s 0:11:25 -
-Rule	sol87	1987	only	-	Oct	6	11:48:20s 0:11:40 -
-Rule	sol87	1987	only	-	Oct	7	11:48:00s 0:12:00 -
-Rule	sol87	1987	only	-	Oct	8	11:47:45s 0:12:15 -
-Rule	sol87	1987	only	-	Oct	9	11:47:25s 0:12:35 -
-Rule	sol87	1987	only	-	Oct	10	11:47:10s 0:12:50 -
-Rule	sol87	1987	only	-	Oct	11	11:46:55s 0:13:05 -
-Rule	sol87	1987	only	-	Oct	12	11:46:40s 0:13:20 -
-Rule	sol87	1987	only	-	Oct	13	11:46:25s 0:13:35 -
-Rule	sol87	1987	only	-	Oct	14	11:46:10s 0:13:50 -
-Rule	sol87	1987	only	-	Oct	15	11:45:55s 0:14:05 -
-Rule	sol87	1987	only	-	Oct	16	11:45:45s 0:14:15 -
-Rule	sol87	1987	only	-	Oct	17	11:45:30s 0:14:30 -
-Rule	sol87	1987	only	-	Oct	18	11:45:20s 0:14:40 -
-Rule	sol87	1987	only	-	Oct	19	11:45:05s 0:14:55 -
-Rule	sol87	1987	only	-	Oct	20	11:44:55s 0:15:05 -
-Rule	sol87	1987	only	-	Oct	21	11:44:45s 0:15:15 -
-Rule	sol87	1987	only	-	Oct	22	11:44:35s 0:15:25 -
-Rule	sol87	1987	only	-	Oct	23	11:44:25s 0:15:35 -
-Rule	sol87	1987	only	-	Oct	24	11:44:20s 0:15:40 -
-Rule	sol87	1987	only	-	Oct	25	11:44:10s 0:15:50 -
-Rule	sol87	1987	only	-	Oct	26	11:44:05s 0:15:55 -
-Rule	sol87	1987	only	-	Oct	27	11:43:55s 0:16:05 -
-Rule	sol87	1987	only	-	Oct	28	11:43:50s 0:16:10 -
-Rule	sol87	1987	only	-	Oct	29	11:43:45s 0:16:15 -
-Rule	sol87	1987	only	-	Oct	30	11:43:45s 0:16:15 -
-Rule	sol87	1987	only	-	Oct	31	11:43:40s 0:16:20 -
-Rule	sol87	1987	only	-	Nov	1	11:43:40s 0:16:20 -
-Rule	sol87	1987	only	-	Nov	2	11:43:35s 0:16:25 -
-Rule	sol87	1987	only	-	Nov	3	11:43:35s 0:16:25 -
-Rule	sol87	1987	only	-	Nov	4	11:43:35s 0:16:25 -
-Rule	sol87	1987	only	-	Nov	5	11:43:35s 0:16:25 -
-Rule	sol87	1987	only	-	Nov	6	11:43:40s 0:16:20 -
-Rule	sol87	1987	only	-	Nov	7	11:43:40s 0:16:20 -
-Rule	sol87	1987	only	-	Nov	8	11:43:45s 0:16:15 -
-Rule	sol87	1987	only	-	Nov	9	11:43:50s 0:16:10 -
-Rule	sol87	1987	only	-	Nov	10	11:43:55s 0:16:05 -
-Rule	sol87	1987	only	-	Nov	11	11:44:00s 0:16:00 -
-Rule	sol87	1987	only	-	Nov	12	11:44:05s 0:15:55 -
-Rule	sol87	1987	only	-	Nov	13	11:44:15s 0:15:45 -
-Rule	sol87	1987	only	-	Nov	14	11:44:20s 0:15:40 -
-Rule	sol87	1987	only	-	Nov	15	11:44:30s 0:15:30 -
-Rule	sol87	1987	only	-	Nov	16	11:44:40s 0:15:20 -
-Rule	sol87	1987	only	-	Nov	17	11:44:50s 0:15:10 -
-Rule	sol87	1987	only	-	Nov	18	11:45:05s 0:14:55 -
-Rule	sol87	1987	only	-	Nov	19	11:45:15s 0:14:45 -
-Rule	sol87	1987	only	-	Nov	20	11:45:30s 0:14:30 -
-Rule	sol87	1987	only	-	Nov	21	11:45:45s 0:14:15 -
-Rule	sol87	1987	only	-	Nov	22	11:46:00s 0:14:00 -
-Rule	sol87	1987	only	-	Nov	23	11:46:15s 0:13:45 -
-Rule	sol87	1987	only	-	Nov	24	11:46:30s 0:13:30 -
-Rule	sol87	1987	only	-	Nov	25	11:46:50s 0:13:10 -
-Rule	sol87	1987	only	-	Nov	26	11:47:10s 0:12:50 -
-Rule	sol87	1987	only	-	Nov	27	11:47:25s 0:12:35 -
-Rule	sol87	1987	only	-	Nov	28	11:47:45s 0:12:15 -
-Rule	sol87	1987	only	-	Nov	29	11:48:05s 0:11:55 -
-Rule	sol87	1987	only	-	Nov	30	11:48:30s 0:11:30 -
-Rule	sol87	1987	only	-	Dec	1	11:48:50s 0:11:10 -
-Rule	sol87	1987	only	-	Dec	2	11:49:10s 0:10:50 -
-Rule	sol87	1987	only	-	Dec	3	11:49:35s 0:10:25 -
-Rule	sol87	1987	only	-	Dec	4	11:50:00s 0:10:00 -
-Rule	sol87	1987	only	-	Dec	5	11:50:25s 0:09:35 -
-Rule	sol87	1987	only	-	Dec	6	11:50:50s 0:09:10 -
-Rule	sol87	1987	only	-	Dec	7	11:51:15s 0:08:45 -
-Rule	sol87	1987	only	-	Dec	8	11:51:40s 0:08:20 -
-Rule	sol87	1987	only	-	Dec	9	11:52:05s 0:07:55 -
-Rule	sol87	1987	only	-	Dec	10	11:52:30s 0:07:30 -
-Rule	sol87	1987	only	-	Dec	11	11:53:00s 0:07:00 -
-Rule	sol87	1987	only	-	Dec	12	11:53:25s 0:06:35 -
-Rule	sol87	1987	only	-	Dec	13	11:53:55s 0:06:05 -
-Rule	sol87	1987	only	-	Dec	14	11:54:25s 0:05:35 -
-Rule	sol87	1987	only	-	Dec	15	11:54:50s 0:05:10 -
-Rule	sol87	1987	only	-	Dec	16	11:55:20s 0:04:40 -
-Rule	sol87	1987	only	-	Dec	17	11:55:50s 0:04:10 -
-Rule	sol87	1987	only	-	Dec	18	11:56:20s 0:03:40 -
-Rule	sol87	1987	only	-	Dec	19	11:56:50s 0:03:10 -
-Rule	sol87	1987	only	-	Dec	20	11:57:20s 0:02:40 -
-Rule	sol87	1987	only	-	Dec	21	11:57:50s 0:02:10 -
-Rule	sol87	1987	only	-	Dec	22	11:58:20s 0:01:40 -
-Rule	sol87	1987	only	-	Dec	23	11:58:50s 0:01:10 -
-Rule	sol87	1987	only	-	Dec	24	11:59:20s 0:00:40 -
-Rule	sol87	1987	only	-	Dec	25	11:59:50s 0:00:10 -
-Rule	sol87	1987	only	-	Dec	26	12:00:20s -0:00:20 -
-Rule	sol87	1987	only	-	Dec	27	12:00:45s -0:00:45 -
-Rule	sol87	1987	only	-	Dec	28	12:01:15s -0:01:15 -
-Rule	sol87	1987	only	-	Dec	29	12:01:45s -0:01:45 -
-Rule	sol87	1987	only	-	Dec	30	12:02:15s -0:02:15 -
-Rule	sol87	1987	only	-	Dec	31	12:02:45s -0:02:45 -
-
-# Riyadh is at about 46 degrees 46 minutes East:  3 hrs, 7 mins, 4 secs
-# Before and after 1987, we'll operate on local mean solar time.
-
-# Zone	NAME		GMTOFF	RULES/SAVE	FORMAT	[UNTIL]
-Zone	Asia/Riyadh87	3:07:04	-		zzz	1987
-			3:07:04	sol87		zzz	1988
-			3:07:04	-		zzz
-# For backward compatibility...
-Link	Asia/Riyadh87	Mideast/Riyadh87
diff --git a/src/java.base/share/data/tzdata/solar88 b/src/java.base/share/data/tzdata/solar88
deleted file mode 100644
index 3314cb1d640..00000000000
--- a/src/java.base/share/data/tzdata/solar88
+++ /dev/null
@@ -1,413 +0,0 @@
-#
-# 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.
-#
-# 
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# Apparent noon times below are for Riyadh; they're a bit off for other places.
-# Times were computed using formulas in the U.S. Naval Observatory's
-# Almanac for Computers 1988; the formulas "will give EqT to an accuracy of
-# [plus or minus two] seconds during the current year."
-#
-# Rounding to the nearest five seconds results in fewer than
-# 256 different "time types"--a limit that's faced because time types are
-# stored on disk as unsigned chars.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	sol88	1988	only	-	Jan	1	12:03:15s -0:03:15 -
-Rule	sol88	1988	only	-	Jan	2	12:03:40s -0:03:40 -
-Rule	sol88	1988	only	-	Jan	3	12:04:10s -0:04:10 -
-Rule	sol88	1988	only	-	Jan	4	12:04:40s -0:04:40 -
-Rule	sol88	1988	only	-	Jan	5	12:05:05s -0:05:05 -
-Rule	sol88	1988	only	-	Jan	6	12:05:30s -0:05:30 -
-Rule	sol88	1988	only	-	Jan	7	12:06:00s -0:06:00 -
-Rule	sol88	1988	only	-	Jan	8	12:06:25s -0:06:25 -
-Rule	sol88	1988	only	-	Jan	9	12:06:50s -0:06:50 -
-Rule	sol88	1988	only	-	Jan	10	12:07:15s -0:07:15 -
-Rule	sol88	1988	only	-	Jan	11	12:07:40s -0:07:40 -
-Rule	sol88	1988	only	-	Jan	12	12:08:05s -0:08:05 -
-Rule	sol88	1988	only	-	Jan	13	12:08:25s -0:08:25 -
-Rule	sol88	1988	only	-	Jan	14	12:08:50s -0:08:50 -
-Rule	sol88	1988	only	-	Jan	15	12:09:10s -0:09:10 -
-Rule	sol88	1988	only	-	Jan	16	12:09:30s -0:09:30 -
-Rule	sol88	1988	only	-	Jan	17	12:09:50s -0:09:50 -
-Rule	sol88	1988	only	-	Jan	18	12:10:10s -0:10:10 -
-Rule	sol88	1988	only	-	Jan	19	12:10:30s -0:10:30 -
-Rule	sol88	1988	only	-	Jan	20	12:10:50s -0:10:50 -
-Rule	sol88	1988	only	-	Jan	21	12:11:05s -0:11:05 -
-Rule	sol88	1988	only	-	Jan	22	12:11:25s -0:11:25 -
-Rule	sol88	1988	only	-	Jan	23	12:11:40s -0:11:40 -
-Rule	sol88	1988	only	-	Jan	24	12:11:55s -0:11:55 -
-Rule	sol88	1988	only	-	Jan	25	12:12:10s -0:12:10 -
-Rule	sol88	1988	only	-	Jan	26	12:12:25s -0:12:25 -
-Rule	sol88	1988	only	-	Jan	27	12:12:40s -0:12:40 -
-Rule	sol88	1988	only	-	Jan	28	12:12:50s -0:12:50 -
-Rule	sol88	1988	only	-	Jan	29	12:13:00s -0:13:00 -
-Rule	sol88	1988	only	-	Jan	30	12:13:10s -0:13:10 -
-Rule	sol88	1988	only	-	Jan	31	12:13:20s -0:13:20 -
-Rule	sol88	1988	only	-	Feb	1	12:13:30s -0:13:30 -
-Rule	sol88	1988	only	-	Feb	2	12:13:40s -0:13:40 -
-Rule	sol88	1988	only	-	Feb	3	12:13:45s -0:13:45 -
-Rule	sol88	1988	only	-	Feb	4	12:13:55s -0:13:55 -
-Rule	sol88	1988	only	-	Feb	5	12:14:00s -0:14:00 -
-Rule	sol88	1988	only	-	Feb	6	12:14:05s -0:14:05 -
-Rule	sol88	1988	only	-	Feb	7	12:14:10s -0:14:10 -
-Rule	sol88	1988	only	-	Feb	8	12:14:10s -0:14:10 -
-Rule	sol88	1988	only	-	Feb	9	12:14:15s -0:14:15 -
-Rule	sol88	1988	only	-	Feb	10	12:14:15s -0:14:15 -
-Rule	sol88	1988	only	-	Feb	11	12:14:15s -0:14:15 -
-Rule	sol88	1988	only	-	Feb	12	12:14:15s -0:14:15 -
-Rule	sol88	1988	only	-	Feb	13	12:14:15s -0:14:15 -
-Rule	sol88	1988	only	-	Feb	14	12:14:15s -0:14:15 -
-Rule	sol88	1988	only	-	Feb	15	12:14:10s -0:14:10 -
-Rule	sol88	1988	only	-	Feb	16	12:14:10s -0:14:10 -
-Rule	sol88	1988	only	-	Feb	17	12:14:05s -0:14:05 -
-Rule	sol88	1988	only	-	Feb	18	12:14:00s -0:14:00 -
-Rule	sol88	1988	only	-	Feb	19	12:13:55s -0:13:55 -
-Rule	sol88	1988	only	-	Feb	20	12:13:50s -0:13:50 -
-Rule	sol88	1988	only	-	Feb	21	12:13:45s -0:13:45 -
-Rule	sol88	1988	only	-	Feb	22	12:13:40s -0:13:40 -
-Rule	sol88	1988	only	-	Feb	23	12:13:30s -0:13:30 -
-Rule	sol88	1988	only	-	Feb	24	12:13:20s -0:13:20 -
-Rule	sol88	1988	only	-	Feb	25	12:13:15s -0:13:15 -
-Rule	sol88	1988	only	-	Feb	26	12:13:05s -0:13:05 -
-Rule	sol88	1988	only	-	Feb	27	12:12:55s -0:12:55 -
-Rule	sol88	1988	only	-	Feb	28	12:12:45s -0:12:45 -
-Rule	sol88	1988	only	-	Feb	29	12:12:30s -0:12:30 -
-Rule	sol88	1988	only	-	Mar	1	12:12:20s -0:12:20 -
-Rule	sol88	1988	only	-	Mar	2	12:12:10s -0:12:10 -
-Rule	sol88	1988	only	-	Mar	3	12:11:55s -0:11:55 -
-Rule	sol88	1988	only	-	Mar	4	12:11:45s -0:11:45 -
-Rule	sol88	1988	only	-	Mar	5	12:11:30s -0:11:30 -
-Rule	sol88	1988	only	-	Mar	6	12:11:15s -0:11:15 -
-Rule	sol88	1988	only	-	Mar	7	12:11:00s -0:11:00 -
-Rule	sol88	1988	only	-	Mar	8	12:10:45s -0:10:45 -
-Rule	sol88	1988	only	-	Mar	9	12:10:30s -0:10:30 -
-Rule	sol88	1988	only	-	Mar	10	12:10:15s -0:10:15 -
-Rule	sol88	1988	only	-	Mar	11	12:10:00s -0:10:00 -
-Rule	sol88	1988	only	-	Mar	12	12:09:45s -0:09:45 -
-Rule	sol88	1988	only	-	Mar	13	12:09:30s -0:09:30 -
-Rule	sol88	1988	only	-	Mar	14	12:09:10s -0:09:10 -
-Rule	sol88	1988	only	-	Mar	15	12:08:55s -0:08:55 -
-Rule	sol88	1988	only	-	Mar	16	12:08:40s -0:08:40 -
-Rule	sol88	1988	only	-	Mar	17	12:08:20s -0:08:20 -
-Rule	sol88	1988	only	-	Mar	18	12:08:05s -0:08:05 -
-Rule	sol88	1988	only	-	Mar	19	12:07:45s -0:07:45 -
-Rule	sol88	1988	only	-	Mar	20	12:07:30s -0:07:30 -
-Rule	sol88	1988	only	-	Mar	21	12:07:10s -0:07:10 -
-Rule	sol88	1988	only	-	Mar	22	12:06:50s -0:06:50 -
-Rule	sol88	1988	only	-	Mar	23	12:06:35s -0:06:35 -
-Rule	sol88	1988	only	-	Mar	24	12:06:15s -0:06:15 -
-Rule	sol88	1988	only	-	Mar	25	12:06:00s -0:06:00 -
-Rule	sol88	1988	only	-	Mar	26	12:05:40s -0:05:40 -
-Rule	sol88	1988	only	-	Mar	27	12:05:20s -0:05:20 -
-Rule	sol88	1988	only	-	Mar	28	12:05:05s -0:05:05 -
-Rule	sol88	1988	only	-	Mar	29	12:04:45s -0:04:45 -
-Rule	sol88	1988	only	-	Mar	30	12:04:25s -0:04:25 -
-Rule	sol88	1988	only	-	Mar	31	12:04:10s -0:04:10 -
-Rule	sol88	1988	only	-	Apr	1	12:03:50s -0:03:50 -
-Rule	sol88	1988	only	-	Apr	2	12:03:35s -0:03:35 -
-Rule	sol88	1988	only	-	Apr	3	12:03:15s -0:03:15 -
-Rule	sol88	1988	only	-	Apr	4	12:03:00s -0:03:00 -
-Rule	sol88	1988	only	-	Apr	5	12:02:40s -0:02:40 -
-Rule	sol88	1988	only	-	Apr	6	12:02:25s -0:02:25 -
-Rule	sol88	1988	only	-	Apr	7	12:02:05s -0:02:05 -
-Rule	sol88	1988	only	-	Apr	8	12:01:50s -0:01:50 -
-Rule	sol88	1988	only	-	Apr	9	12:01:35s -0:01:35 -
-Rule	sol88	1988	only	-	Apr	10	12:01:15s -0:01:15 -
-Rule	sol88	1988	only	-	Apr	11	12:01:00s -0:01:00 -
-Rule	sol88	1988	only	-	Apr	12	12:00:45s -0:00:45 -
-Rule	sol88	1988	only	-	Apr	13	12:00:30s -0:00:30 -
-Rule	sol88	1988	only	-	Apr	14	12:00:15s -0:00:15 -
-Rule	sol88	1988	only	-	Apr	15	12:00:00s 0:00:00 -
-Rule	sol88	1988	only	-	Apr	16	11:59:45s 0:00:15 -
-Rule	sol88	1988	only	-	Apr	17	11:59:30s 0:00:30 -
-Rule	sol88	1988	only	-	Apr	18	11:59:20s 0:00:40 -
-Rule	sol88	1988	only	-	Apr	19	11:59:05s 0:00:55 -
-Rule	sol88	1988	only	-	Apr	20	11:58:55s 0:01:05 -
-Rule	sol88	1988	only	-	Apr	21	11:58:40s 0:01:20 -
-Rule	sol88	1988	only	-	Apr	22	11:58:30s 0:01:30 -
-Rule	sol88	1988	only	-	Apr	23	11:58:15s 0:01:45 -
-Rule	sol88	1988	only	-	Apr	24	11:58:05s 0:01:55 -
-Rule	sol88	1988	only	-	Apr	25	11:57:55s 0:02:05 -
-Rule	sol88	1988	only	-	Apr	26	11:57:45s 0:02:15 -
-Rule	sol88	1988	only	-	Apr	27	11:57:35s 0:02:25 -
-Rule	sol88	1988	only	-	Apr	28	11:57:30s 0:02:30 -
-Rule	sol88	1988	only	-	Apr	29	11:57:20s 0:02:40 -
-Rule	sol88	1988	only	-	Apr	30	11:57:10s 0:02:50 -
-Rule	sol88	1988	only	-	May	1	11:57:05s 0:02:55 -
-Rule	sol88	1988	only	-	May	2	11:56:55s 0:03:05 -
-Rule	sol88	1988	only	-	May	3	11:56:50s 0:03:10 -
-Rule	sol88	1988	only	-	May	4	11:56:45s 0:03:15 -
-Rule	sol88	1988	only	-	May	5	11:56:40s 0:03:20 -
-Rule	sol88	1988	only	-	May	6	11:56:35s 0:03:25 -
-Rule	sol88	1988	only	-	May	7	11:56:30s 0:03:30 -
-Rule	sol88	1988	only	-	May	8	11:56:25s 0:03:35 -
-Rule	sol88	1988	only	-	May	9	11:56:25s 0:03:35 -
-Rule	sol88	1988	only	-	May	10	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	11	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	12	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	13	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	14	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	15	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	16	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	17	11:56:20s 0:03:40 -
-Rule	sol88	1988	only	-	May	18	11:56:25s 0:03:35 -
-Rule	sol88	1988	only	-	May	19	11:56:25s 0:03:35 -
-Rule	sol88	1988	only	-	May	20	11:56:30s 0:03:30 -
-Rule	sol88	1988	only	-	May	21	11:56:35s 0:03:25 -
-Rule	sol88	1988	only	-	May	22	11:56:40s 0:03:20 -
-Rule	sol88	1988	only	-	May	23	11:56:45s 0:03:15 -
-Rule	sol88	1988	only	-	May	24	11:56:50s 0:03:10 -
-Rule	sol88	1988	only	-	May	25	11:56:55s 0:03:05 -
-Rule	sol88	1988	only	-	May	26	11:57:00s 0:03:00 -
-Rule	sol88	1988	only	-	May	27	11:57:05s 0:02:55 -
-Rule	sol88	1988	only	-	May	28	11:57:15s 0:02:45 -
-Rule	sol88	1988	only	-	May	29	11:57:20s 0:02:40 -
-Rule	sol88	1988	only	-	May	30	11:57:30s 0:02:30 -
-Rule	sol88	1988	only	-	May	31	11:57:40s 0:02:20 -
-Rule	sol88	1988	only	-	Jun	1	11:57:50s 0:02:10 -
-Rule	sol88	1988	only	-	Jun	2	11:57:55s 0:02:05 -
-Rule	sol88	1988	only	-	Jun	3	11:58:05s 0:01:55 -
-Rule	sol88	1988	only	-	Jun	4	11:58:15s 0:01:45 -
-Rule	sol88	1988	only	-	Jun	5	11:58:30s 0:01:30 -
-Rule	sol88	1988	only	-	Jun	6	11:58:40s 0:01:20 -
-Rule	sol88	1988	only	-	Jun	7	11:58:50s 0:01:10 -
-Rule	sol88	1988	only	-	Jun	8	11:59:00s 0:01:00 -
-Rule	sol88	1988	only	-	Jun	9	11:59:15s 0:00:45 -
-Rule	sol88	1988	only	-	Jun	10	11:59:25s 0:00:35 -
-Rule	sol88	1988	only	-	Jun	11	11:59:35s 0:00:25 -
-Rule	sol88	1988	only	-	Jun	12	11:59:50s 0:00:10 -
-Rule	sol88	1988	only	-	Jun	13	12:00:00s 0:00:00 -
-Rule	sol88	1988	only	-	Jun	14	12:00:15s -0:00:15 -
-Rule	sol88	1988	only	-	Jun	15	12:00:25s -0:00:25 -
-Rule	sol88	1988	only	-	Jun	16	12:00:40s -0:00:40 -
-Rule	sol88	1988	only	-	Jun	17	12:00:55s -0:00:55 -
-Rule	sol88	1988	only	-	Jun	18	12:01:05s -0:01:05 -
-Rule	sol88	1988	only	-	Jun	19	12:01:20s -0:01:20 -
-Rule	sol88	1988	only	-	Jun	20	12:01:30s -0:01:30 -
-Rule	sol88	1988	only	-	Jun	21	12:01:45s -0:01:45 -
-Rule	sol88	1988	only	-	Jun	22	12:02:00s -0:02:00 -
-Rule	sol88	1988	only	-	Jun	23	12:02:10s -0:02:10 -
-Rule	sol88	1988	only	-	Jun	24	12:02:25s -0:02:25 -
-Rule	sol88	1988	only	-	Jun	25	12:02:35s -0:02:35 -
-Rule	sol88	1988	only	-	Jun	26	12:02:50s -0:02:50 -
-Rule	sol88	1988	only	-	Jun	27	12:03:00s -0:03:00 -
-Rule	sol88	1988	only	-	Jun	28	12:03:15s -0:03:15 -
-Rule	sol88	1988	only	-	Jun	29	12:03:25s -0:03:25 -
-Rule	sol88	1988	only	-	Jun	30	12:03:40s -0:03:40 -
-Rule	sol88	1988	only	-	Jul	1	12:03:50s -0:03:50 -
-Rule	sol88	1988	only	-	Jul	2	12:04:00s -0:04:00 -
-Rule	sol88	1988	only	-	Jul	3	12:04:10s -0:04:10 -
-Rule	sol88	1988	only	-	Jul	4	12:04:25s -0:04:25 -
-Rule	sol88	1988	only	-	Jul	5	12:04:35s -0:04:35 -
-Rule	sol88	1988	only	-	Jul	6	12:04:45s -0:04:45 -
-Rule	sol88	1988	only	-	Jul	7	12:04:55s -0:04:55 -
-Rule	sol88	1988	only	-	Jul	8	12:05:05s -0:05:05 -
-Rule	sol88	1988	only	-	Jul	9	12:05:10s -0:05:10 -
-Rule	sol88	1988	only	-	Jul	10	12:05:20s -0:05:20 -
-Rule	sol88	1988	only	-	Jul	11	12:05:30s -0:05:30 -
-Rule	sol88	1988	only	-	Jul	12	12:05:35s -0:05:35 -
-Rule	sol88	1988	only	-	Jul	13	12:05:45s -0:05:45 -
-Rule	sol88	1988	only	-	Jul	14	12:05:50s -0:05:50 -
-Rule	sol88	1988	only	-	Jul	15	12:05:55s -0:05:55 -
-Rule	sol88	1988	only	-	Jul	16	12:06:00s -0:06:00 -
-Rule	sol88	1988	only	-	Jul	17	12:06:05s -0:06:05 -
-Rule	sol88	1988	only	-	Jul	18	12:06:10s -0:06:10 -
-Rule	sol88	1988	only	-	Jul	19	12:06:15s -0:06:15 -
-Rule	sol88	1988	only	-	Jul	20	12:06:20s -0:06:20 -
-Rule	sol88	1988	only	-	Jul	21	12:06:25s -0:06:25 -
-Rule	sol88	1988	only	-	Jul	22	12:06:25s -0:06:25 -
-Rule	sol88	1988	only	-	Jul	23	12:06:25s -0:06:25 -
-Rule	sol88	1988	only	-	Jul	24	12:06:30s -0:06:30 -
-Rule	sol88	1988	only	-	Jul	25	12:06:30s -0:06:30 -
-Rule	sol88	1988	only	-	Jul	26	12:06:30s -0:06:30 -
-Rule	sol88	1988	only	-	Jul	27	12:06:30s -0:06:30 -
-Rule	sol88	1988	only	-	Jul	28	12:06:30s -0:06:30 -
-Rule	sol88	1988	only	-	Jul	29	12:06:25s -0:06:25 -
-Rule	sol88	1988	only	-	Jul	30	12:06:25s -0:06:25 -
-Rule	sol88	1988	only	-	Jul	31	12:06:20s -0:06:20 -
-Rule	sol88	1988	only	-	Aug	1	12:06:15s -0:06:15 -
-Rule	sol88	1988	only	-	Aug	2	12:06:15s -0:06:15 -
-Rule	sol88	1988	only	-	Aug	3	12:06:10s -0:06:10 -
-Rule	sol88	1988	only	-	Aug	4	12:06:05s -0:06:05 -
-Rule	sol88	1988	only	-	Aug	5	12:05:55s -0:05:55 -
-Rule	sol88	1988	only	-	Aug	6	12:05:50s -0:05:50 -
-Rule	sol88	1988	only	-	Aug	7	12:05:45s -0:05:45 -
-Rule	sol88	1988	only	-	Aug	8	12:05:35s -0:05:35 -
-Rule	sol88	1988	only	-	Aug	9	12:05:25s -0:05:25 -
-Rule	sol88	1988	only	-	Aug	10	12:05:20s -0:05:20 -
-Rule	sol88	1988	only	-	Aug	11	12:05:10s -0:05:10 -
-Rule	sol88	1988	only	-	Aug	12	12:05:00s -0:05:00 -
-Rule	sol88	1988	only	-	Aug	13	12:04:50s -0:04:50 -
-Rule	sol88	1988	only	-	Aug	14	12:04:35s -0:04:35 -
-Rule	sol88	1988	only	-	Aug	15	12:04:25s -0:04:25 -
-Rule	sol88	1988	only	-	Aug	16	12:04:15s -0:04:15 -
-Rule	sol88	1988	only	-	Aug	17	12:04:00s -0:04:00 -
-Rule	sol88	1988	only	-	Aug	18	12:03:50s -0:03:50 -
-Rule	sol88	1988	only	-	Aug	19	12:03:35s -0:03:35 -
-Rule	sol88	1988	only	-	Aug	20	12:03:20s -0:03:20 -
-Rule	sol88	1988	only	-	Aug	21	12:03:05s -0:03:05 -
-Rule	sol88	1988	only	-	Aug	22	12:02:50s -0:02:50 -
-Rule	sol88	1988	only	-	Aug	23	12:02:35s -0:02:35 -
-Rule	sol88	1988	only	-	Aug	24	12:02:20s -0:02:20 -
-Rule	sol88	1988	only	-	Aug	25	12:02:00s -0:02:00 -
-Rule	sol88	1988	only	-	Aug	26	12:01:45s -0:01:45 -
-Rule	sol88	1988	only	-	Aug	27	12:01:30s -0:01:30 -
-Rule	sol88	1988	only	-	Aug	28	12:01:10s -0:01:10 -
-Rule	sol88	1988	only	-	Aug	29	12:00:50s -0:00:50 -
-Rule	sol88	1988	only	-	Aug	30	12:00:35s -0:00:35 -
-Rule	sol88	1988	only	-	Aug	31	12:00:15s -0:00:15 -
-Rule	sol88	1988	only	-	Sep	1	11:59:55s 0:00:05 -
-Rule	sol88	1988	only	-	Sep	2	11:59:35s 0:00:25 -
-Rule	sol88	1988	only	-	Sep	3	11:59:20s 0:00:40 -
-Rule	sol88	1988	only	-	Sep	4	11:59:00s 0:01:00 -
-Rule	sol88	1988	only	-	Sep	5	11:58:40s 0:01:20 -
-Rule	sol88	1988	only	-	Sep	6	11:58:20s 0:01:40 -
-Rule	sol88	1988	only	-	Sep	7	11:58:00s 0:02:00 -
-Rule	sol88	1988	only	-	Sep	8	11:57:35s 0:02:25 -
-Rule	sol88	1988	only	-	Sep	9	11:57:15s 0:02:45 -
-Rule	sol88	1988	only	-	Sep	10	11:56:55s 0:03:05 -
-Rule	sol88	1988	only	-	Sep	11	11:56:35s 0:03:25 -
-Rule	sol88	1988	only	-	Sep	12	11:56:15s 0:03:45 -
-Rule	sol88	1988	only	-	Sep	13	11:55:50s 0:04:10 -
-Rule	sol88	1988	only	-	Sep	14	11:55:30s 0:04:30 -
-Rule	sol88	1988	only	-	Sep	15	11:55:10s 0:04:50 -
-Rule	sol88	1988	only	-	Sep	16	11:54:50s 0:05:10 -
-Rule	sol88	1988	only	-	Sep	17	11:54:25s 0:05:35 -
-Rule	sol88	1988	only	-	Sep	18	11:54:05s 0:05:55 -
-Rule	sol88	1988	only	-	Sep	19	11:53:45s 0:06:15 -
-Rule	sol88	1988	only	-	Sep	20	11:53:25s 0:06:35 -
-Rule	sol88	1988	only	-	Sep	21	11:53:00s 0:07:00 -
-Rule	sol88	1988	only	-	Sep	22	11:52:40s 0:07:20 -
-Rule	sol88	1988	only	-	Sep	23	11:52:20s 0:07:40 -
-Rule	sol88	1988	only	-	Sep	24	11:52:00s 0:08:00 -
-Rule	sol88	1988	only	-	Sep	25	11:51:40s 0:08:20 -
-Rule	sol88	1988	only	-	Sep	26	11:51:15s 0:08:45 -
-Rule	sol88	1988	only	-	Sep	27	11:50:55s 0:09:05 -
-Rule	sol88	1988	only	-	Sep	28	11:50:35s 0:09:25 -
-Rule	sol88	1988	only	-	Sep	29	11:50:15s 0:09:45 -
-Rule	sol88	1988	only	-	Sep	30	11:49:55s 0:10:05 -
-Rule	sol88	1988	only	-	Oct	1	11:49:35s 0:10:25 -
-Rule	sol88	1988	only	-	Oct	2	11:49:20s 0:10:40 -
-Rule	sol88	1988	only	-	Oct	3	11:49:00s 0:11:00 -
-Rule	sol88	1988	only	-	Oct	4	11:48:40s 0:11:20 -
-Rule	sol88	1988	only	-	Oct	5	11:48:25s 0:11:35 -
-Rule	sol88	1988	only	-	Oct	6	11:48:05s 0:11:55 -
-Rule	sol88	1988	only	-	Oct	7	11:47:50s 0:12:10 -
-Rule	sol88	1988	only	-	Oct	8	11:47:30s 0:12:30 -
-Rule	sol88	1988	only	-	Oct	9	11:47:15s 0:12:45 -
-Rule	sol88	1988	only	-	Oct	10	11:47:00s 0:13:00 -
-Rule	sol88	1988	only	-	Oct	11	11:46:45s 0:13:15 -
-Rule	sol88	1988	only	-	Oct	12	11:46:30s 0:13:30 -
-Rule	sol88	1988	only	-	Oct	13	11:46:15s 0:13:45 -
-Rule	sol88	1988	only	-	Oct	14	11:46:00s 0:14:00 -
-Rule	sol88	1988	only	-	Oct	15	11:45:45s 0:14:15 -
-Rule	sol88	1988	only	-	Oct	16	11:45:35s 0:14:25 -
-Rule	sol88	1988	only	-	Oct	17	11:45:20s 0:14:40 -
-Rule	sol88	1988	only	-	Oct	18	11:45:10s 0:14:50 -
-Rule	sol88	1988	only	-	Oct	19	11:45:00s 0:15:00 -
-Rule	sol88	1988	only	-	Oct	20	11:44:45s 0:15:15 -
-Rule	sol88	1988	only	-	Oct	21	11:44:40s 0:15:20 -
-Rule	sol88	1988	only	-	Oct	22	11:44:30s 0:15:30 -
-Rule	sol88	1988	only	-	Oct	23	11:44:20s 0:15:40 -
-Rule	sol88	1988	only	-	Oct	24	11:44:10s 0:15:50 -
-Rule	sol88	1988	only	-	Oct	25	11:44:05s 0:15:55 -
-Rule	sol88	1988	only	-	Oct	26	11:44:00s 0:16:00 -
-Rule	sol88	1988	only	-	Oct	27	11:43:55s 0:16:05 -
-Rule	sol88	1988	only	-	Oct	28	11:43:50s 0:16:10 -
-Rule	sol88	1988	only	-	Oct	29	11:43:45s 0:16:15 -
-Rule	sol88	1988	only	-	Oct	30	11:43:40s 0:16:20 -
-Rule	sol88	1988	only	-	Oct	31	11:43:40s 0:16:20 -
-Rule	sol88	1988	only	-	Nov	1	11:43:35s 0:16:25 -
-Rule	sol88	1988	only	-	Nov	2	11:43:35s 0:16:25 -
-Rule	sol88	1988	only	-	Nov	3	11:43:35s 0:16:25 -
-Rule	sol88	1988	only	-	Nov	4	11:43:35s 0:16:25 -
-Rule	sol88	1988	only	-	Nov	5	11:43:40s 0:16:20 -
-Rule	sol88	1988	only	-	Nov	6	11:43:40s 0:16:20 -
-Rule	sol88	1988	only	-	Nov	7	11:43:45s 0:16:15 -
-Rule	sol88	1988	only	-	Nov	8	11:43:45s 0:16:15 -
-Rule	sol88	1988	only	-	Nov	9	11:43:50s 0:16:10 -
-Rule	sol88	1988	only	-	Nov	10	11:44:00s 0:16:00 -
-Rule	sol88	1988	only	-	Nov	11	11:44:05s 0:15:55 -
-Rule	sol88	1988	only	-	Nov	12	11:44:10s 0:15:50 -
-Rule	sol88	1988	only	-	Nov	13	11:44:20s 0:15:40 -
-Rule	sol88	1988	only	-	Nov	14	11:44:30s 0:15:30 -
-Rule	sol88	1988	only	-	Nov	15	11:44:40s 0:15:20 -
-Rule	sol88	1988	only	-	Nov	16	11:44:50s 0:15:10 -
-Rule	sol88	1988	only	-	Nov	17	11:45:00s 0:15:00 -
-Rule	sol88	1988	only	-	Nov	18	11:45:15s 0:14:45 -
-Rule	sol88	1988	only	-	Nov	19	11:45:25s 0:14:35 -
-Rule	sol88	1988	only	-	Nov	20	11:45:40s 0:14:20 -
-Rule	sol88	1988	only	-	Nov	21	11:45:55s 0:14:05 -
-Rule	sol88	1988	only	-	Nov	22	11:46:10s 0:13:50 -
-Rule	sol88	1988	only	-	Nov	23	11:46:30s 0:13:30 -
-Rule	sol88	1988	only	-	Nov	24	11:46:45s 0:13:15 -
-Rule	sol88	1988	only	-	Nov	25	11:47:05s 0:12:55 -
-Rule	sol88	1988	only	-	Nov	26	11:47:20s 0:12:40 -
-Rule	sol88	1988	only	-	Nov	27	11:47:40s 0:12:20 -
-Rule	sol88	1988	only	-	Nov	28	11:48:00s 0:12:00 -
-Rule	sol88	1988	only	-	Nov	29	11:48:25s 0:11:35 -
-Rule	sol88	1988	only	-	Nov	30	11:48:45s 0:11:15 -
-Rule	sol88	1988	only	-	Dec	1	11:49:05s 0:10:55 -
-Rule	sol88	1988	only	-	Dec	2	11:49:30s 0:10:30 -
-Rule	sol88	1988	only	-	Dec	3	11:49:55s 0:10:05 -
-Rule	sol88	1988	only	-	Dec	4	11:50:15s 0:09:45 -
-Rule	sol88	1988	only	-	Dec	5	11:50:40s 0:09:20 -
-Rule	sol88	1988	only	-	Dec	6	11:51:05s 0:08:55 -
-Rule	sol88	1988	only	-	Dec	7	11:51:35s 0:08:25 -
-Rule	sol88	1988	only	-	Dec	8	11:52:00s 0:08:00 -
-Rule	sol88	1988	only	-	Dec	9	11:52:25s 0:07:35 -
-Rule	sol88	1988	only	-	Dec	10	11:52:55s 0:07:05 -
-Rule	sol88	1988	only	-	Dec	11	11:53:20s 0:06:40 -
-Rule	sol88	1988	only	-	Dec	12	11:53:50s 0:06:10 -
-Rule	sol88	1988	only	-	Dec	13	11:54:15s 0:05:45 -
-Rule	sol88	1988	only	-	Dec	14	11:54:45s 0:05:15 -
-Rule	sol88	1988	only	-	Dec	15	11:55:15s 0:04:45 -
-Rule	sol88	1988	only	-	Dec	16	11:55:45s 0:04:15 -
-Rule	sol88	1988	only	-	Dec	17	11:56:15s 0:03:45 -
-Rule	sol88	1988	only	-	Dec	18	11:56:40s 0:03:20 -
-Rule	sol88	1988	only	-	Dec	19	11:57:10s 0:02:50 -
-Rule	sol88	1988	only	-	Dec	20	11:57:40s 0:02:20 -
-Rule	sol88	1988	only	-	Dec	21	11:58:10s 0:01:50 -
-Rule	sol88	1988	only	-	Dec	22	11:58:40s 0:01:20 -
-Rule	sol88	1988	only	-	Dec	23	11:59:10s 0:00:50 -
-Rule	sol88	1988	only	-	Dec	24	11:59:40s 0:00:20 -
-Rule	sol88	1988	only	-	Dec	25	12:00:10s -0:00:10 -
-Rule	sol88	1988	only	-	Dec	26	12:00:40s -0:00:40 -
-Rule	sol88	1988	only	-	Dec	27	12:01:10s -0:01:10 -
-Rule	sol88	1988	only	-	Dec	28	12:01:40s -0:01:40 -
-Rule	sol88	1988	only	-	Dec	29	12:02:10s -0:02:10 -
-Rule	sol88	1988	only	-	Dec	30	12:02:35s -0:02:35 -
-Rule	sol88	1988	only	-	Dec	31	12:03:05s -0:03:05 -
-
-# Riyadh is at about 46 degrees 46 minutes East:  3 hrs, 7 mins, 4 secs
-# Before and after 1988, we'll operate on local mean solar time.
-
-# Zone	NAME		GMTOFF	RULES/SAVE	FORMAT	[UNTIL]
-Zone	Asia/Riyadh88	3:07:04	-		zzz	1988
-			3:07:04	sol88		zzz	1989
-			3:07:04	-		zzz
-# For backward compatibility...
-Link	Asia/Riyadh88	Mideast/Riyadh88
diff --git a/src/java.base/share/data/tzdata/solar89 b/src/java.base/share/data/tzdata/solar89
deleted file mode 100644
index 3aa88cf0893..00000000000
--- a/src/java.base/share/data/tzdata/solar89
+++ /dev/null
@@ -1,418 +0,0 @@
-#
-# 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.
-#
-# 
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# Apparent noon times below are for Riyadh; they're a bit off for other places.
-# Times were computed using a formula provided by the U. S. Naval Observatory:
-#	eqt = -105.8 * sin(l) + 596.2 * sin(2 * l) + 4.4 * sin(3 * l)
-#		-12.7 * sin(4 * l) - 429.0 * cos(l) - 2.1 * cos (2 * l)
-#		+ 19.3 * cos(3 * l);
-# where l is the "mean longitude of the Sun" given by
-#	l = 279.642 degrees + 0.985647 * d
-# and d is the interval in days from January 0, 0 hours Universal Time
-# (equaling the day of the year plus the fraction of a day from zero hours).
-# The accuracy of the formula is plus or minus three seconds.
-#
-# Rounding to the nearest five seconds results in fewer than
-# 256 different "time types"--a limit that's faced because time types are
-# stored on disk as unsigned chars.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	sol89	1989	only	-	Jan	1	12:03:35s -0:03:35 -
-Rule	sol89	1989	only	-	Jan	2	12:04:05s -0:04:05 -
-Rule	sol89	1989	only	-	Jan	3	12:04:30s -0:04:30 -
-Rule	sol89	1989	only	-	Jan	4	12:05:00s -0:05:00 -
-Rule	sol89	1989	only	-	Jan	5	12:05:25s -0:05:25 -
-Rule	sol89	1989	only	-	Jan	6	12:05:50s -0:05:50 -
-Rule	sol89	1989	only	-	Jan	7	12:06:15s -0:06:15 -
-Rule	sol89	1989	only	-	Jan	8	12:06:45s -0:06:45 -
-Rule	sol89	1989	only	-	Jan	9	12:07:10s -0:07:10 -
-Rule	sol89	1989	only	-	Jan	10	12:07:35s -0:07:35 -
-Rule	sol89	1989	only	-	Jan	11	12:07:55s -0:07:55 -
-Rule	sol89	1989	only	-	Jan	12	12:08:20s -0:08:20 -
-Rule	sol89	1989	only	-	Jan	13	12:08:45s -0:08:45 -
-Rule	sol89	1989	only	-	Jan	14	12:09:05s -0:09:05 -
-Rule	sol89	1989	only	-	Jan	15	12:09:25s -0:09:25 -
-Rule	sol89	1989	only	-	Jan	16	12:09:45s -0:09:45 -
-Rule	sol89	1989	only	-	Jan	17	12:10:05s -0:10:05 -
-Rule	sol89	1989	only	-	Jan	18	12:10:25s -0:10:25 -
-Rule	sol89	1989	only	-	Jan	19	12:10:45s -0:10:45 -
-Rule	sol89	1989	only	-	Jan	20	12:11:05s -0:11:05 -
-Rule	sol89	1989	only	-	Jan	21	12:11:20s -0:11:20 -
-Rule	sol89	1989	only	-	Jan	22	12:11:35s -0:11:35 -
-Rule	sol89	1989	only	-	Jan	23	12:11:55s -0:11:55 -
-Rule	sol89	1989	only	-	Jan	24	12:12:10s -0:12:10 -
-Rule	sol89	1989	only	-	Jan	25	12:12:20s -0:12:20 -
-Rule	sol89	1989	only	-	Jan	26	12:12:35s -0:12:35 -
-Rule	sol89	1989	only	-	Jan	27	12:12:50s -0:12:50 -
-Rule	sol89	1989	only	-	Jan	28	12:13:00s -0:13:00 -
-Rule	sol89	1989	only	-	Jan	29	12:13:10s -0:13:10 -
-Rule	sol89	1989	only	-	Jan	30	12:13:20s -0:13:20 -
-Rule	sol89	1989	only	-	Jan	31	12:13:30s -0:13:30 -
-Rule	sol89	1989	only	-	Feb	1	12:13:40s -0:13:40 -
-Rule	sol89	1989	only	-	Feb	2	12:13:45s -0:13:45 -
-Rule	sol89	1989	only	-	Feb	3	12:13:55s -0:13:55 -
-Rule	sol89	1989	only	-	Feb	4	12:14:00s -0:14:00 -
-Rule	sol89	1989	only	-	Feb	5	12:14:05s -0:14:05 -
-Rule	sol89	1989	only	-	Feb	6	12:14:10s -0:14:10 -
-Rule	sol89	1989	only	-	Feb	7	12:14:10s -0:14:10 -
-Rule	sol89	1989	only	-	Feb	8	12:14:15s -0:14:15 -
-Rule	sol89	1989	only	-	Feb	9	12:14:15s -0:14:15 -
-Rule	sol89	1989	only	-	Feb	10	12:14:20s -0:14:20 -
-Rule	sol89	1989	only	-	Feb	11	12:14:20s -0:14:20 -
-Rule	sol89	1989	only	-	Feb	12	12:14:20s -0:14:20 -
-Rule	sol89	1989	only	-	Feb	13	12:14:15s -0:14:15 -
-Rule	sol89	1989	only	-	Feb	14	12:14:15s -0:14:15 -
-Rule	sol89	1989	only	-	Feb	15	12:14:10s -0:14:10 -
-Rule	sol89	1989	only	-	Feb	16	12:14:10s -0:14:10 -
-Rule	sol89	1989	only	-	Feb	17	12:14:05s -0:14:05 -
-Rule	sol89	1989	only	-	Feb	18	12:14:00s -0:14:00 -
-Rule	sol89	1989	only	-	Feb	19	12:13:55s -0:13:55 -
-Rule	sol89	1989	only	-	Feb	20	12:13:50s -0:13:50 -
-Rule	sol89	1989	only	-	Feb	21	12:13:40s -0:13:40 -
-Rule	sol89	1989	only	-	Feb	22	12:13:35s -0:13:35 -
-Rule	sol89	1989	only	-	Feb	23	12:13:25s -0:13:25 -
-Rule	sol89	1989	only	-	Feb	24	12:13:15s -0:13:15 -
-Rule	sol89	1989	only	-	Feb	25	12:13:05s -0:13:05 -
-Rule	sol89	1989	only	-	Feb	26	12:12:55s -0:12:55 -
-Rule	sol89	1989	only	-	Feb	27	12:12:45s -0:12:45 -
-Rule	sol89	1989	only	-	Feb	28	12:12:35s -0:12:35 -
-Rule	sol89	1989	only	-	Mar	1	12:12:25s -0:12:25 -
-Rule	sol89	1989	only	-	Mar	2	12:12:10s -0:12:10 -
-Rule	sol89	1989	only	-	Mar	3	12:12:00s -0:12:00 -
-Rule	sol89	1989	only	-	Mar	4	12:11:45s -0:11:45 -
-Rule	sol89	1989	only	-	Mar	5	12:11:35s -0:11:35 -
-Rule	sol89	1989	only	-	Mar	6	12:11:20s -0:11:20 -
-Rule	sol89	1989	only	-	Mar	7	12:11:05s -0:11:05 -
-Rule	sol89	1989	only	-	Mar	8	12:10:50s -0:10:50 -
-Rule	sol89	1989	only	-	Mar	9	12:10:35s -0:10:35 -
-Rule	sol89	1989	only	-	Mar	10	12:10:20s -0:10:20 -
-Rule	sol89	1989	only	-	Mar	11	12:10:05s -0:10:05 -
-Rule	sol89	1989	only	-	Mar	12	12:09:50s -0:09:50 -
-Rule	sol89	1989	only	-	Mar	13	12:09:30s -0:09:30 -
-Rule	sol89	1989	only	-	Mar	14	12:09:15s -0:09:15 -
-Rule	sol89	1989	only	-	Mar	15	12:09:00s -0:09:00 -
-Rule	sol89	1989	only	-	Mar	16	12:08:40s -0:08:40 -
-Rule	sol89	1989	only	-	Mar	17	12:08:25s -0:08:25 -
-Rule	sol89	1989	only	-	Mar	18	12:08:05s -0:08:05 -
-Rule	sol89	1989	only	-	Mar	19	12:07:50s -0:07:50 -
-Rule	sol89	1989	only	-	Mar	20	12:07:30s -0:07:30 -
-Rule	sol89	1989	only	-	Mar	21	12:07:15s -0:07:15 -
-Rule	sol89	1989	only	-	Mar	22	12:06:55s -0:06:55 -
-Rule	sol89	1989	only	-	Mar	23	12:06:35s -0:06:35 -
-Rule	sol89	1989	only	-	Mar	24	12:06:20s -0:06:20 -
-Rule	sol89	1989	only	-	Mar	25	12:06:00s -0:06:00 -
-Rule	sol89	1989	only	-	Mar	26	12:05:40s -0:05:40 -
-Rule	sol89	1989	only	-	Mar	27	12:05:25s -0:05:25 -
-Rule	sol89	1989	only	-	Mar	28	12:05:05s -0:05:05 -
-Rule	sol89	1989	only	-	Mar	29	12:04:50s -0:04:50 -
-Rule	sol89	1989	only	-	Mar	30	12:04:30s -0:04:30 -
-Rule	sol89	1989	only	-	Mar	31	12:04:10s -0:04:10 -
-Rule	sol89	1989	only	-	Apr	1	12:03:55s -0:03:55 -
-Rule	sol89	1989	only	-	Apr	2	12:03:35s -0:03:35 -
-Rule	sol89	1989	only	-	Apr	3	12:03:20s -0:03:20 -
-Rule	sol89	1989	only	-	Apr	4	12:03:00s -0:03:00 -
-Rule	sol89	1989	only	-	Apr	5	12:02:45s -0:02:45 -
-Rule	sol89	1989	only	-	Apr	6	12:02:25s -0:02:25 -
-Rule	sol89	1989	only	-	Apr	7	12:02:10s -0:02:10 -
-Rule	sol89	1989	only	-	Apr	8	12:01:50s -0:01:50 -
-Rule	sol89	1989	only	-	Apr	9	12:01:35s -0:01:35 -
-Rule	sol89	1989	only	-	Apr	10	12:01:20s -0:01:20 -
-Rule	sol89	1989	only	-	Apr	11	12:01:05s -0:01:05 -
-Rule	sol89	1989	only	-	Apr	12	12:00:50s -0:00:50 -
-Rule	sol89	1989	only	-	Apr	13	12:00:35s -0:00:35 -
-Rule	sol89	1989	only	-	Apr	14	12:00:20s -0:00:20 -
-Rule	sol89	1989	only	-	Apr	15	12:00:05s -0:00:05 -
-Rule	sol89	1989	only	-	Apr	16	11:59:50s 0:00:10 -
-Rule	sol89	1989	only	-	Apr	17	11:59:35s 0:00:25 -
-Rule	sol89	1989	only	-	Apr	18	11:59:20s 0:00:40 -
-Rule	sol89	1989	only	-	Apr	19	11:59:10s 0:00:50 -
-Rule	sol89	1989	only	-	Apr	20	11:58:55s 0:01:05 -
-Rule	sol89	1989	only	-	Apr	21	11:58:45s 0:01:15 -
-Rule	sol89	1989	only	-	Apr	22	11:58:30s 0:01:30 -
-Rule	sol89	1989	only	-	Apr	23	11:58:20s 0:01:40 -
-Rule	sol89	1989	only	-	Apr	24	11:58:10s 0:01:50 -
-Rule	sol89	1989	only	-	Apr	25	11:58:00s 0:02:00 -
-Rule	sol89	1989	only	-	Apr	26	11:57:50s 0:02:10 -
-Rule	sol89	1989	only	-	Apr	27	11:57:40s 0:02:20 -
-Rule	sol89	1989	only	-	Apr	28	11:57:30s 0:02:30 -
-Rule	sol89	1989	only	-	Apr	29	11:57:20s 0:02:40 -
-Rule	sol89	1989	only	-	Apr	30	11:57:15s 0:02:45 -
-Rule	sol89	1989	only	-	May	1	11:57:05s 0:02:55 -
-Rule	sol89	1989	only	-	May	2	11:57:00s 0:03:00 -
-Rule	sol89	1989	only	-	May	3	11:56:50s 0:03:10 -
-Rule	sol89	1989	only	-	May	4	11:56:45s 0:03:15 -
-Rule	sol89	1989	only	-	May	5	11:56:40s 0:03:20 -
-Rule	sol89	1989	only	-	May	6	11:56:35s 0:03:25 -
-Rule	sol89	1989	only	-	May	7	11:56:30s 0:03:30 -
-Rule	sol89	1989	only	-	May	8	11:56:30s 0:03:30 -
-Rule	sol89	1989	only	-	May	9	11:56:25s 0:03:35 -
-Rule	sol89	1989	only	-	May	10	11:56:25s 0:03:35 -
-Rule	sol89	1989	only	-	May	11	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	May	12	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	May	13	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	May	14	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	May	15	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	May	16	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	May	17	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	May	18	11:56:25s 0:03:35 -
-Rule	sol89	1989	only	-	May	19	11:56:25s 0:03:35 -
-Rule	sol89	1989	only	-	May	20	11:56:30s 0:03:30 -
-Rule	sol89	1989	only	-	May	21	11:56:35s 0:03:25 -
-Rule	sol89	1989	only	-	May	22	11:56:35s 0:03:25 -
-Rule	sol89	1989	only	-	May	23	11:56:40s 0:03:20 -
-Rule	sol89	1989	only	-	May	24	11:56:45s 0:03:15 -
-Rule	sol89	1989	only	-	May	25	11:56:55s 0:03:05 -
-Rule	sol89	1989	only	-	May	26	11:57:00s 0:03:00 -
-Rule	sol89	1989	only	-	May	27	11:57:05s 0:02:55 -
-Rule	sol89	1989	only	-	May	28	11:57:15s 0:02:45 -
-Rule	sol89	1989	only	-	May	29	11:57:20s 0:02:40 -
-Rule	sol89	1989	only	-	May	30	11:57:30s 0:02:30 -
-Rule	sol89	1989	only	-	May	31	11:57:35s 0:02:25 -
-Rule	sol89	1989	only	-	Jun	1	11:57:45s 0:02:15 -
-Rule	sol89	1989	only	-	Jun	2	11:57:55s 0:02:05 -
-Rule	sol89	1989	only	-	Jun	3	11:58:05s 0:01:55 -
-Rule	sol89	1989	only	-	Jun	4	11:58:15s 0:01:45 -
-Rule	sol89	1989	only	-	Jun	5	11:58:25s 0:01:35 -
-Rule	sol89	1989	only	-	Jun	6	11:58:35s 0:01:25 -
-Rule	sol89	1989	only	-	Jun	7	11:58:45s 0:01:15 -
-Rule	sol89	1989	only	-	Jun	8	11:59:00s 0:01:00 -
-Rule	sol89	1989	only	-	Jun	9	11:59:10s 0:00:50 -
-Rule	sol89	1989	only	-	Jun	10	11:59:20s 0:00:40 -
-Rule	sol89	1989	only	-	Jun	11	11:59:35s 0:00:25 -
-Rule	sol89	1989	only	-	Jun	12	11:59:45s 0:00:15 -
-Rule	sol89	1989	only	-	Jun	13	12:00:00s 0:00:00 -
-Rule	sol89	1989	only	-	Jun	14	12:00:10s -0:00:10 -
-Rule	sol89	1989	only	-	Jun	15	12:00:25s -0:00:25 -
-Rule	sol89	1989	only	-	Jun	16	12:00:35s -0:00:35 -
-Rule	sol89	1989	only	-	Jun	17	12:00:50s -0:00:50 -
-Rule	sol89	1989	only	-	Jun	18	12:01:05s -0:01:05 -
-Rule	sol89	1989	only	-	Jun	19	12:01:15s -0:01:15 -
-Rule	sol89	1989	only	-	Jun	20	12:01:30s -0:01:30 -
-Rule	sol89	1989	only	-	Jun	21	12:01:40s -0:01:40 -
-Rule	sol89	1989	only	-	Jun	22	12:01:55s -0:01:55 -
-Rule	sol89	1989	only	-	Jun	23	12:02:10s -0:02:10 -
-Rule	sol89	1989	only	-	Jun	24	12:02:20s -0:02:20 -
-Rule	sol89	1989	only	-	Jun	25	12:02:35s -0:02:35 -
-Rule	sol89	1989	only	-	Jun	26	12:02:45s -0:02:45 -
-Rule	sol89	1989	only	-	Jun	27	12:03:00s -0:03:00 -
-Rule	sol89	1989	only	-	Jun	28	12:03:10s -0:03:10 -
-Rule	sol89	1989	only	-	Jun	29	12:03:25s -0:03:25 -
-Rule	sol89	1989	only	-	Jun	30	12:03:35s -0:03:35 -
-Rule	sol89	1989	only	-	Jul	1	12:03:45s -0:03:45 -
-Rule	sol89	1989	only	-	Jul	2	12:04:00s -0:04:00 -
-Rule	sol89	1989	only	-	Jul	3	12:04:10s -0:04:10 -
-Rule	sol89	1989	only	-	Jul	4	12:04:20s -0:04:20 -
-Rule	sol89	1989	only	-	Jul	5	12:04:30s -0:04:30 -
-Rule	sol89	1989	only	-	Jul	6	12:04:40s -0:04:40 -
-Rule	sol89	1989	only	-	Jul	7	12:04:50s -0:04:50 -
-Rule	sol89	1989	only	-	Jul	8	12:05:00s -0:05:00 -
-Rule	sol89	1989	only	-	Jul	9	12:05:10s -0:05:10 -
-Rule	sol89	1989	only	-	Jul	10	12:05:20s -0:05:20 -
-Rule	sol89	1989	only	-	Jul	11	12:05:25s -0:05:25 -
-Rule	sol89	1989	only	-	Jul	12	12:05:35s -0:05:35 -
-Rule	sol89	1989	only	-	Jul	13	12:05:40s -0:05:40 -
-Rule	sol89	1989	only	-	Jul	14	12:05:50s -0:05:50 -
-Rule	sol89	1989	only	-	Jul	15	12:05:55s -0:05:55 -
-Rule	sol89	1989	only	-	Jul	16	12:06:00s -0:06:00 -
-Rule	sol89	1989	only	-	Jul	17	12:06:05s -0:06:05 -
-Rule	sol89	1989	only	-	Jul	18	12:06:10s -0:06:10 -
-Rule	sol89	1989	only	-	Jul	19	12:06:15s -0:06:15 -
-Rule	sol89	1989	only	-	Jul	20	12:06:20s -0:06:20 -
-Rule	sol89	1989	only	-	Jul	21	12:06:20s -0:06:20 -
-Rule	sol89	1989	only	-	Jul	22	12:06:25s -0:06:25 -
-Rule	sol89	1989	only	-	Jul	23	12:06:25s -0:06:25 -
-Rule	sol89	1989	only	-	Jul	24	12:06:30s -0:06:30 -
-Rule	sol89	1989	only	-	Jul	25	12:06:30s -0:06:30 -
-Rule	sol89	1989	only	-	Jul	26	12:06:30s -0:06:30 -
-Rule	sol89	1989	only	-	Jul	27	12:06:30s -0:06:30 -
-Rule	sol89	1989	only	-	Jul	28	12:06:30s -0:06:30 -
-Rule	sol89	1989	only	-	Jul	29	12:06:25s -0:06:25 -
-Rule	sol89	1989	only	-	Jul	30	12:06:25s -0:06:25 -
-Rule	sol89	1989	only	-	Jul	31	12:06:20s -0:06:20 -
-Rule	sol89	1989	only	-	Aug	1	12:06:20s -0:06:20 -
-Rule	sol89	1989	only	-	Aug	2	12:06:15s -0:06:15 -
-Rule	sol89	1989	only	-	Aug	3	12:06:10s -0:06:10 -
-Rule	sol89	1989	only	-	Aug	4	12:06:05s -0:06:05 -
-Rule	sol89	1989	only	-	Aug	5	12:06:00s -0:06:00 -
-Rule	sol89	1989	only	-	Aug	6	12:05:50s -0:05:50 -
-Rule	sol89	1989	only	-	Aug	7	12:05:45s -0:05:45 -
-Rule	sol89	1989	only	-	Aug	8	12:05:35s -0:05:35 -
-Rule	sol89	1989	only	-	Aug	9	12:05:30s -0:05:30 -
-Rule	sol89	1989	only	-	Aug	10	12:05:20s -0:05:20 -
-Rule	sol89	1989	only	-	Aug	11	12:05:10s -0:05:10 -
-Rule	sol89	1989	only	-	Aug	12	12:05:00s -0:05:00 -
-Rule	sol89	1989	only	-	Aug	13	12:04:50s -0:04:50 -
-Rule	sol89	1989	only	-	Aug	14	12:04:40s -0:04:40 -
-Rule	sol89	1989	only	-	Aug	15	12:04:30s -0:04:30 -
-Rule	sol89	1989	only	-	Aug	16	12:04:15s -0:04:15 -
-Rule	sol89	1989	only	-	Aug	17	12:04:05s -0:04:05 -
-Rule	sol89	1989	only	-	Aug	18	12:03:50s -0:03:50 -
-Rule	sol89	1989	only	-	Aug	19	12:03:35s -0:03:35 -
-Rule	sol89	1989	only	-	Aug	20	12:03:25s -0:03:25 -
-Rule	sol89	1989	only	-	Aug	21	12:03:10s -0:03:10 -
-Rule	sol89	1989	only	-	Aug	22	12:02:55s -0:02:55 -
-Rule	sol89	1989	only	-	Aug	23	12:02:40s -0:02:40 -
-Rule	sol89	1989	only	-	Aug	24	12:02:20s -0:02:20 -
-Rule	sol89	1989	only	-	Aug	25	12:02:05s -0:02:05 -
-Rule	sol89	1989	only	-	Aug	26	12:01:50s -0:01:50 -
-Rule	sol89	1989	only	-	Aug	27	12:01:30s -0:01:30 -
-Rule	sol89	1989	only	-	Aug	28	12:01:15s -0:01:15 -
-Rule	sol89	1989	only	-	Aug	29	12:00:55s -0:00:55 -
-Rule	sol89	1989	only	-	Aug	30	12:00:40s -0:00:40 -
-Rule	sol89	1989	only	-	Aug	31	12:00:20s -0:00:20 -
-Rule	sol89	1989	only	-	Sep	1	12:00:00s 0:00:00 -
-Rule	sol89	1989	only	-	Sep	2	11:59:45s 0:00:15 -
-Rule	sol89	1989	only	-	Sep	3	11:59:25s 0:00:35 -
-Rule	sol89	1989	only	-	Sep	4	11:59:05s 0:00:55 -
-Rule	sol89	1989	only	-	Sep	5	11:58:45s 0:01:15 -
-Rule	sol89	1989	only	-	Sep	6	11:58:25s 0:01:35 -
-Rule	sol89	1989	only	-	Sep	7	11:58:05s 0:01:55 -
-Rule	sol89	1989	only	-	Sep	8	11:57:45s 0:02:15 -
-Rule	sol89	1989	only	-	Sep	9	11:57:20s 0:02:40 -
-Rule	sol89	1989	only	-	Sep	10	11:57:00s 0:03:00 -
-Rule	sol89	1989	only	-	Sep	11	11:56:40s 0:03:20 -
-Rule	sol89	1989	only	-	Sep	12	11:56:20s 0:03:40 -
-Rule	sol89	1989	only	-	Sep	13	11:56:00s 0:04:00 -
-Rule	sol89	1989	only	-	Sep	14	11:55:35s 0:04:25 -
-Rule	sol89	1989	only	-	Sep	15	11:55:15s 0:04:45 -
-Rule	sol89	1989	only	-	Sep	16	11:54:55s 0:05:05 -
-Rule	sol89	1989	only	-	Sep	17	11:54:35s 0:05:25 -
-Rule	sol89	1989	only	-	Sep	18	11:54:10s 0:05:50 -
-Rule	sol89	1989	only	-	Sep	19	11:53:50s 0:06:10 -
-Rule	sol89	1989	only	-	Sep	20	11:53:30s 0:06:30 -
-Rule	sol89	1989	only	-	Sep	21	11:53:10s 0:06:50 -
-Rule	sol89	1989	only	-	Sep	22	11:52:45s 0:07:15 -
-Rule	sol89	1989	only	-	Sep	23	11:52:25s 0:07:35 -
-Rule	sol89	1989	only	-	Sep	24	11:52:05s 0:07:55 -
-Rule	sol89	1989	only	-	Sep	25	11:51:45s 0:08:15 -
-Rule	sol89	1989	only	-	Sep	26	11:51:25s 0:08:35 -
-Rule	sol89	1989	only	-	Sep	27	11:51:05s 0:08:55 -
-Rule	sol89	1989	only	-	Sep	28	11:50:40s 0:09:20 -
-Rule	sol89	1989	only	-	Sep	29	11:50:20s 0:09:40 -
-Rule	sol89	1989	only	-	Sep	30	11:50:00s 0:10:00 -
-Rule	sol89	1989	only	-	Oct	1	11:49:45s 0:10:15 -
-Rule	sol89	1989	only	-	Oct	2	11:49:25s 0:10:35 -
-Rule	sol89	1989	only	-	Oct	3	11:49:05s 0:10:55 -
-Rule	sol89	1989	only	-	Oct	4	11:48:45s 0:11:15 -
-Rule	sol89	1989	only	-	Oct	5	11:48:30s 0:11:30 -
-Rule	sol89	1989	only	-	Oct	6	11:48:10s 0:11:50 -
-Rule	sol89	1989	only	-	Oct	7	11:47:50s 0:12:10 -
-Rule	sol89	1989	only	-	Oct	8	11:47:35s 0:12:25 -
-Rule	sol89	1989	only	-	Oct	9	11:47:20s 0:12:40 -
-Rule	sol89	1989	only	-	Oct	10	11:47:00s 0:13:00 -
-Rule	sol89	1989	only	-	Oct	11	11:46:45s 0:13:15 -
-Rule	sol89	1989	only	-	Oct	12	11:46:30s 0:13:30 -
-Rule	sol89	1989	only	-	Oct	13	11:46:15s 0:13:45 -
-Rule	sol89	1989	only	-	Oct	14	11:46:00s 0:14:00 -
-Rule	sol89	1989	only	-	Oct	15	11:45:50s 0:14:10 -
-Rule	sol89	1989	only	-	Oct	16	11:45:35s 0:14:25 -
-Rule	sol89	1989	only	-	Oct	17	11:45:20s 0:14:40 -
-Rule	sol89	1989	only	-	Oct	18	11:45:10s 0:14:50 -
-Rule	sol89	1989	only	-	Oct	19	11:45:00s 0:15:00 -
-Rule	sol89	1989	only	-	Oct	20	11:44:50s 0:15:10 -
-Rule	sol89	1989	only	-	Oct	21	11:44:40s 0:15:20 -
-Rule	sol89	1989	only	-	Oct	22	11:44:30s 0:15:30 -
-Rule	sol89	1989	only	-	Oct	23	11:44:20s 0:15:40 -
-Rule	sol89	1989	only	-	Oct	24	11:44:10s 0:15:50 -
-Rule	sol89	1989	only	-	Oct	25	11:44:05s 0:15:55 -
-Rule	sol89	1989	only	-	Oct	26	11:44:00s 0:16:00 -
-Rule	sol89	1989	only	-	Oct	27	11:43:50s 0:16:10 -
-Rule	sol89	1989	only	-	Oct	28	11:43:45s 0:16:15 -
-Rule	sol89	1989	only	-	Oct	29	11:43:40s 0:16:20 -
-Rule	sol89	1989	only	-	Oct	30	11:43:40s 0:16:20 -
-Rule	sol89	1989	only	-	Oct	31	11:43:35s 0:16:25 -
-Rule	sol89	1989	only	-	Nov	1	11:43:35s 0:16:25 -
-Rule	sol89	1989	only	-	Nov	2	11:43:35s 0:16:25 -
-Rule	sol89	1989	only	-	Nov	3	11:43:30s 0:16:30 -
-Rule	sol89	1989	only	-	Nov	4	11:43:35s 0:16:25 -
-Rule	sol89	1989	only	-	Nov	5	11:43:35s 0:16:25 -
-Rule	sol89	1989	only	-	Nov	6	11:43:35s 0:16:25 -
-Rule	sol89	1989	only	-	Nov	7	11:43:40s 0:16:20 -
-Rule	sol89	1989	only	-	Nov	8	11:43:45s 0:16:15 -
-Rule	sol89	1989	only	-	Nov	9	11:43:50s 0:16:10 -
-Rule	sol89	1989	only	-	Nov	10	11:43:55s 0:16:05 -
-Rule	sol89	1989	only	-	Nov	11	11:44:00s 0:16:00 -
-Rule	sol89	1989	only	-	Nov	12	11:44:05s 0:15:55 -
-Rule	sol89	1989	only	-	Nov	13	11:44:15s 0:15:45 -
-Rule	sol89	1989	only	-	Nov	14	11:44:25s 0:15:35 -
-Rule	sol89	1989	only	-	Nov	15	11:44:35s 0:15:25 -
-Rule	sol89	1989	only	-	Nov	16	11:44:45s 0:15:15 -
-Rule	sol89	1989	only	-	Nov	17	11:44:55s 0:15:05 -
-Rule	sol89	1989	only	-	Nov	18	11:45:10s 0:14:50 -
-Rule	sol89	1989	only	-	Nov	19	11:45:20s 0:14:40 -
-Rule	sol89	1989	only	-	Nov	20	11:45:35s 0:14:25 -
-Rule	sol89	1989	only	-	Nov	21	11:45:50s 0:14:10 -
-Rule	sol89	1989	only	-	Nov	22	11:46:05s 0:13:55 -
-Rule	sol89	1989	only	-	Nov	23	11:46:25s 0:13:35 -
-Rule	sol89	1989	only	-	Nov	24	11:46:40s 0:13:20 -
-Rule	sol89	1989	only	-	Nov	25	11:47:00s 0:13:00 -
-Rule	sol89	1989	only	-	Nov	26	11:47:20s 0:12:40 -
-Rule	sol89	1989	only	-	Nov	27	11:47:35s 0:12:25 -
-Rule	sol89	1989	only	-	Nov	28	11:47:55s 0:12:05 -
-Rule	sol89	1989	only	-	Nov	29	11:48:20s 0:11:40 -
-Rule	sol89	1989	only	-	Nov	30	11:48:40s 0:11:20 -
-Rule	sol89	1989	only	-	Dec	1	11:49:00s 0:11:00 -
-Rule	sol89	1989	only	-	Dec	2	11:49:25s 0:10:35 -
-Rule	sol89	1989	only	-	Dec	3	11:49:50s 0:10:10 -
-Rule	sol89	1989	only	-	Dec	4	11:50:15s 0:09:45 -
-Rule	sol89	1989	only	-	Dec	5	11:50:35s 0:09:25 -
-Rule	sol89	1989	only	-	Dec	6	11:51:00s 0:09:00 -
-Rule	sol89	1989	only	-	Dec	7	11:51:30s 0:08:30 -
-Rule	sol89	1989	only	-	Dec	8	11:51:55s 0:08:05 -
-Rule	sol89	1989	only	-	Dec	9	11:52:20s 0:07:40 -
-Rule	sol89	1989	only	-	Dec	10	11:52:50s 0:07:10 -
-Rule	sol89	1989	only	-	Dec	11	11:53:15s 0:06:45 -
-Rule	sol89	1989	only	-	Dec	12	11:53:45s 0:06:15 -
-Rule	sol89	1989	only	-	Dec	13	11:54:10s 0:05:50 -
-Rule	sol89	1989	only	-	Dec	14	11:54:40s 0:05:20 -
-Rule	sol89	1989	only	-	Dec	15	11:55:10s 0:04:50 -
-Rule	sol89	1989	only	-	Dec	16	11:55:40s 0:04:20 -
-Rule	sol89	1989	only	-	Dec	17	11:56:05s 0:03:55 -
-Rule	sol89	1989	only	-	Dec	18	11:56:35s 0:03:25 -
-Rule	sol89	1989	only	-	Dec	19	11:57:05s 0:02:55 -
-Rule	sol89	1989	only	-	Dec	20	11:57:35s 0:02:25 -
-Rule	sol89	1989	only	-	Dec	21	11:58:05s 0:01:55 -
-Rule	sol89	1989	only	-	Dec	22	11:58:35s 0:01:25 -
-Rule	sol89	1989	only	-	Dec	23	11:59:05s 0:00:55 -
-Rule	sol89	1989	only	-	Dec	24	11:59:35s 0:00:25 -
-Rule	sol89	1989	only	-	Dec	25	12:00:05s -0:00:05 -
-Rule	sol89	1989	only	-	Dec	26	12:00:35s -0:00:35 -
-Rule	sol89	1989	only	-	Dec	27	12:01:05s -0:01:05 -
-Rule	sol89	1989	only	-	Dec	28	12:01:35s -0:01:35 -
-Rule	sol89	1989	only	-	Dec	29	12:02:00s -0:02:00 -
-Rule	sol89	1989	only	-	Dec	30	12:02:30s -0:02:30 -
-Rule	sol89	1989	only	-	Dec	31	12:03:00s -0:03:00 -
-
-# Riyadh is at about 46 degrees 46 minutes East:  3 hrs, 7 mins, 4 secs
-# Before and after 1989, we'll operate on local mean solar time.
-
-# Zone	NAME		GMTOFF	RULES/SAVE	FORMAT	[UNTIL]
-Zone	Asia/Riyadh89	3:07:04	-		zzz	1989
-			3:07:04	sol89		zzz	1990
-			3:07:04	-		zzz
-# For backward compatibility...
-Link	Asia/Riyadh89	Mideast/Riyadh89
diff --git a/src/java.base/share/data/tzdata/zone.tab b/src/java.base/share/data/tzdata/zone.tab
deleted file mode 100644
index b90ab4e4b25..00000000000
--- a/src/java.base/share/data/tzdata/zone.tab
+++ /dev/null
@@ -1,470 +0,0 @@
-#
-# 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.
-#
-# tzdb timezone descriptions (deprecated version)
-#
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-#
-# From Paul Eggert (2021-09-20):
-# This file is intended as a backward-compatibility aid for older programs.
-# New programs should use zone1970.tab.  This file is like zone1970.tab (see
-# zone1970.tab's comments), but with the following additional restrictions:
-#
-# 1.  This file contains only ASCII characters.
-# 2.  The first data column contains exactly one country code.
-#
-# Because of (2), each row stands for an area that is the intersection
-# of a region identified by a country code and of a timezone where civil
-# clocks have agreed since 1970; this is a narrower definition than
-# that of zone1970.tab.
-#
-# Unlike zone1970.tab, a row's third column can be a Link from
-# 'backward' instead of a Zone.
-#
-# This table is intended as an aid for users, to help them select timezones
-# appropriate for their practical needs.  It is not intended to take or
-# endorse any position on legal or territorial claims.
-#
-#country-
-#code	coordinates	TZ			comments
-AD	+4230+00131	Europe/Andorra
-AE	+2518+05518	Asia/Dubai
-AF	+3431+06912	Asia/Kabul
-AG	+1703-06148	America/Antigua
-AI	+1812-06304	America/Anguilla
-AL	+4120+01950	Europe/Tirane
-AM	+4011+04430	Asia/Yerevan
-AO	-0848+01314	Africa/Luanda
-AQ	-7750+16636	Antarctica/McMurdo	New Zealand time - McMurdo, South Pole
-AQ	-6617+11031	Antarctica/Casey	Casey
-AQ	-6835+07758	Antarctica/Davis	Davis
-AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville
-AQ	-6736+06253	Antarctica/Mawson	Mawson
-AQ	-6448-06406	Antarctica/Palmer	Palmer
-AQ	-6734-06808	Antarctica/Rothera	Rothera
-AQ	-690022+0393524	Antarctica/Syowa	Syowa
-AQ	-720041+0023206	Antarctica/Troll	Troll
-AQ	-7824+10654	Antarctica/Vostok	Vostok
-AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
-AR	-3124-06411	America/Argentina/Cordoba	Argentina (most areas: CB, CC, CN, ER, FM, MN, SE, SF)
-AR	-2447-06525	America/Argentina/Salta	Salta (SA, LP, NQ, RN)
-AR	-2411-06518	America/Argentina/Jujuy	Jujuy (JY)
-AR	-2649-06513	America/Argentina/Tucuman	Tucuman (TM)
-AR	-2828-06547	America/Argentina/Catamarca	Catamarca (CT), Chubut (CH)
-AR	-2926-06651	America/Argentina/La_Rioja	La Rioja (LR)
-AR	-3132-06831	America/Argentina/San_Juan	San Juan (SJ)
-AR	-3253-06849	America/Argentina/Mendoza	Mendoza (MZ)
-AR	-3319-06621	America/Argentina/San_Luis	San Luis (SL)
-AR	-5138-06913	America/Argentina/Rio_Gallegos	Santa Cruz (SC)
-AR	-5448-06818	America/Argentina/Ushuaia	Tierra del Fuego (TF)
-AS	-1416-17042	Pacific/Pago_Pago
-AT	+4813+01620	Europe/Vienna
-AU	-3133+15905	Australia/Lord_Howe	Lord Howe Island
-AU	-5430+15857	Antarctica/Macquarie	Macquarie Island
-AU	-4253+14719	Australia/Hobart	Tasmania
-AU	-3749+14458	Australia/Melbourne	Victoria
-AU	-3352+15113	Australia/Sydney	New South Wales (most areas)
-AU	-3157+14127	Australia/Broken_Hill	New South Wales (Yancowinna)
-AU	-2728+15302	Australia/Brisbane	Queensland (most areas)
-AU	-2016+14900	Australia/Lindeman	Queensland (Whitsunday Islands)
-AU	-3455+13835	Australia/Adelaide	South Australia
-AU	-1228+13050	Australia/Darwin	Northern Territory
-AU	-3157+11551	Australia/Perth	Western Australia (most areas)
-AU	-3143+12852	Australia/Eucla	Western Australia (Eucla)
-AW	+1230-06958	America/Aruba
-AX	+6006+01957	Europe/Mariehamn
-AZ	+4023+04951	Asia/Baku
-BA	+4352+01825	Europe/Sarajevo
-BB	+1306-05937	America/Barbados
-BD	+2343+09025	Asia/Dhaka
-BE	+5050+00420	Europe/Brussels
-BF	+1222-00131	Africa/Ouagadougou
-BG	+4241+02319	Europe/Sofia
-BH	+2623+05035	Asia/Bahrain
-BI	-0323+02922	Africa/Bujumbura
-BJ	+0629+00237	Africa/Porto-Novo
-BL	+1753-06251	America/St_Barthelemy
-BM	+3217-06446	Atlantic/Bermuda
-BN	+0456+11455	Asia/Brunei
-BO	-1630-06809	America/La_Paz
-BQ	+120903-0681636	America/Kralendijk
-BR	-0351-03225	America/Noronha	Atlantic islands
-BR	-0127-04829	America/Belem	Para (east), Amapa
-BR	-0343-03830	America/Fortaleza	Brazil (northeast: MA, PI, CE, RN, PB)
-BR	-0803-03454	America/Recife	Pernambuco
-BR	-0712-04812	America/Araguaina	Tocantins
-BR	-0940-03543	America/Maceio	Alagoas, Sergipe
-BR	-1259-03831	America/Bahia	Bahia
-BR	-2332-04637	America/Sao_Paulo	Brazil (southeast: GO, DF, MG, ES, RJ, SP, PR, SC, RS)
-BR	-2027-05437	America/Campo_Grande	Mato Grosso do Sul
-BR	-1535-05605	America/Cuiaba	Mato Grosso
-BR	-0226-05452	America/Santarem	Para (west)
-BR	-0846-06354	America/Porto_Velho	Rondonia
-BR	+0249-06040	America/Boa_Vista	Roraima
-BR	-0308-06001	America/Manaus	Amazonas (east)
-BR	-0640-06952	America/Eirunepe	Amazonas (west)
-BR	-0958-06748	America/Rio_Branco	Acre
-BS	+2505-07721	America/Nassau
-BT	+2728+08939	Asia/Thimphu
-BW	-2439+02555	Africa/Gaborone
-BY	+5354+02734	Europe/Minsk
-BZ	+1730-08812	America/Belize
-CA	+4734-05243	America/St_Johns	Newfoundland, Labrador (SE)
-CA	+4439-06336	America/Halifax	Atlantic - NS (most areas), PE
-CA	+4612-05957	America/Glace_Bay	Atlantic - NS (Cape Breton)
-CA	+4606-06447	America/Moncton	Atlantic - New Brunswick
-CA	+5320-06025	America/Goose_Bay	Atlantic - Labrador (most areas)
-CA	+5125-05707	America/Blanc-Sablon	AST - QC (Lower North Shore)
-CA	+4339-07923	America/Toronto	Eastern - ON & QC (most areas)
-CA	+6344-06828	America/Iqaluit	Eastern - NU (most areas)
-CA	+484531-0913718	America/Atikokan	EST - ON (Atikokan), NU (Coral H)
-CA	+4953-09709	America/Winnipeg	Central - ON (west), Manitoba
-CA	+744144-0944945	America/Resolute	Central - NU (Resolute)
-CA	+624900-0920459	America/Rankin_Inlet	Central - NU (central)
-CA	+5024-10439	America/Regina	CST - SK (most areas)
-CA	+5017-10750	America/Swift_Current	CST - SK (midwest)
-CA	+5333-11328	America/Edmonton	Mountain - AB, BC(E), NT(E), SK(W)
-CA	+690650-1050310	America/Cambridge_Bay	Mountain - NU (west)
-CA	+682059-1334300	America/Inuvik	Mountain - NT (west)
-CA	+4906-11631	America/Creston	MST - BC (Creston)
-CA	+5546-12014	America/Dawson_Creek	MST - BC (Dawson Cr, Ft St John)
-CA	+5848-12242	America/Fort_Nelson	MST - BC (Ft Nelson)
-CA	+6043-13503	America/Whitehorse	MST - Yukon (east)
-CA	+6404-13925	America/Dawson	MST - Yukon (west)
-CA	+4916-12307	America/Vancouver	Pacific - BC (most areas)
-CC	-1210+09655	Indian/Cocos
-CD	-0418+01518	Africa/Kinshasa	Dem. Rep. of Congo (west)
-CD	-1140+02728	Africa/Lubumbashi	Dem. Rep. of Congo (east)
-CF	+0422+01835	Africa/Bangui
-CG	-0416+01517	Africa/Brazzaville
-CH	+4723+00832	Europe/Zurich
-CI	+0519-00402	Africa/Abidjan
-CK	-2114-15946	Pacific/Rarotonga
-CL	-3327-07040	America/Santiago	most of Chile
-CL	-5309-07055	America/Punta_Arenas	Region of Magallanes
-CL	-2709-10926	Pacific/Easter	Easter Island
-CM	+0403+00942	Africa/Douala
-CN	+3114+12128	Asia/Shanghai	Beijing Time
-CN	+4348+08735	Asia/Urumqi	Xinjiang Time
-CO	+0436-07405	America/Bogota
-CR	+0956-08405	America/Costa_Rica
-CU	+2308-08222	America/Havana
-CV	+1455-02331	Atlantic/Cape_Verde
-CW	+1211-06900	America/Curacao
-CX	-1025+10543	Indian/Christmas
-CY	+3510+03322	Asia/Nicosia	most of Cyprus
-CY	+3507+03357	Asia/Famagusta	Northern Cyprus
-CZ	+5005+01426	Europe/Prague
-DE	+5230+01322	Europe/Berlin	most of Germany
-DE	+4742+00841	Europe/Busingen	Busingen
-DJ	+1136+04309	Africa/Djibouti
-DK	+5540+01235	Europe/Copenhagen
-DM	+1518-06124	America/Dominica
-DO	+1828-06954	America/Santo_Domingo
-DZ	+3647+00303	Africa/Algiers
-EC	-0210-07950	America/Guayaquil	Ecuador (mainland)
-EC	-0054-08936	Pacific/Galapagos	Galapagos Islands
-EE	+5925+02445	Europe/Tallinn
-EG	+3003+03115	Africa/Cairo
-EH	+2709-01312	Africa/El_Aaiun
-ER	+1520+03853	Africa/Asmara
-ES	+4024-00341	Europe/Madrid	Spain (mainland)
-ES	+3553-00519	Africa/Ceuta	Ceuta, Melilla
-ES	+2806-01524	Atlantic/Canary	Canary Islands
-ET	+0902+03842	Africa/Addis_Ababa
-FI	+6010+02458	Europe/Helsinki
-FJ	-1808+17825	Pacific/Fiji
-FK	-5142-05751	Atlantic/Stanley
-FM	+0725+15147	Pacific/Chuuk	Chuuk/Truk, Yap
-FM	+0658+15813	Pacific/Pohnpei	Pohnpei/Ponape
-FM	+0519+16259	Pacific/Kosrae	Kosrae
-FO	+6201-00646	Atlantic/Faroe
-FR	+4852+00220	Europe/Paris
-GA	+0023+00927	Africa/Libreville
-GB	+513030-0000731	Europe/London
-GD	+1203-06145	America/Grenada
-GE	+4143+04449	Asia/Tbilisi
-GF	+0456-05220	America/Cayenne
-GG	+492717-0023210	Europe/Guernsey
-GH	+0533-00013	Africa/Accra
-GI	+3608-00521	Europe/Gibraltar
-GL	+6411-05144	America/Nuuk	most of Greenland
-GL	+7646-01840	America/Danmarkshavn	National Park (east coast)
-GL	+7029-02158	America/Scoresbysund	Scoresbysund/Ittoqqortoormiit
-GL	+7634-06847	America/Thule	Thule/Pituffik
-GM	+1328-01639	Africa/Banjul
-GN	+0931-01343	Africa/Conakry
-GP	+1614-06132	America/Guadeloupe
-GQ	+0345+00847	Africa/Malabo
-GR	+3758+02343	Europe/Athens
-GS	-5416-03632	Atlantic/South_Georgia
-GT	+1438-09031	America/Guatemala
-GU	+1328+14445	Pacific/Guam
-GW	+1151-01535	Africa/Bissau
-GY	+0648-05810	America/Guyana
-HK	+2217+11409	Asia/Hong_Kong
-HN	+1406-08713	America/Tegucigalpa
-HR	+4548+01558	Europe/Zagreb
-HT	+1832-07220	America/Port-au-Prince
-HU	+4730+01905	Europe/Budapest
-ID	-0610+10648	Asia/Jakarta	Java, Sumatra
-ID	-0002+10920	Asia/Pontianak	Borneo (west, central)
-ID	-0507+11924	Asia/Makassar	Borneo (east, south), Sulawesi/Celebes, Bali, Nusa Tengarra, Timor (west)
-ID	-0232+14042	Asia/Jayapura	New Guinea (West Papua / Irian Jaya), Malukus/Moluccas
-IE	+5320-00615	Europe/Dublin
-IL	+314650+0351326	Asia/Jerusalem
-IM	+5409-00428	Europe/Isle_of_Man
-IN	+2232+08822	Asia/Kolkata
-IO	-0720+07225	Indian/Chagos
-IQ	+3321+04425	Asia/Baghdad
-IR	+3540+05126	Asia/Tehran
-IS	+6409-02151	Atlantic/Reykjavik
-IT	+4154+01229	Europe/Rome
-JE	+491101-0020624	Europe/Jersey
-JM	+175805-0764736	America/Jamaica
-JO	+3157+03556	Asia/Amman
-JP	+353916+1394441	Asia/Tokyo
-KE	-0117+03649	Africa/Nairobi
-KG	+4254+07436	Asia/Bishkek
-KH	+1133+10455	Asia/Phnom_Penh
-KI	+0125+17300	Pacific/Tarawa	Gilbert Islands
-KI	-0247-17143	Pacific/Kanton	Phoenix Islands
-KI	+0152-15720	Pacific/Kiritimati	Line Islands
-KM	-1141+04316	Indian/Comoro
-KN	+1718-06243	America/St_Kitts
-KP	+3901+12545	Asia/Pyongyang
-KR	+3733+12658	Asia/Seoul
-KW	+2920+04759	Asia/Kuwait
-KY	+1918-08123	America/Cayman
-KZ	+4315+07657	Asia/Almaty	most of Kazakhstan
-KZ	+4448+06528	Asia/Qyzylorda	Qyzylorda/Kyzylorda/Kzyl-Orda
-KZ	+5312+06337	Asia/Qostanay	Qostanay/Kostanay/Kustanay
-KZ	+5017+05710	Asia/Aqtobe	Aqtobe/Aktobe
-KZ	+4431+05016	Asia/Aqtau	Mangghystau/Mankistau
-KZ	+4707+05156	Asia/Atyrau	Atyrau/Atirau/Gur'yev
-KZ	+5113+05121	Asia/Oral	West Kazakhstan
-LA	+1758+10236	Asia/Vientiane
-LB	+3353+03530	Asia/Beirut
-LC	+1401-06100	America/St_Lucia
-LI	+4709+00931	Europe/Vaduz
-LK	+0656+07951	Asia/Colombo
-LR	+0618-01047	Africa/Monrovia
-LS	-2928+02730	Africa/Maseru
-LT	+5441+02519	Europe/Vilnius
-LU	+4936+00609	Europe/Luxembourg
-LV	+5657+02406	Europe/Riga
-LY	+3254+01311	Africa/Tripoli
-MA	+3339-00735	Africa/Casablanca
-MC	+4342+00723	Europe/Monaco
-MD	+4700+02850	Europe/Chisinau
-ME	+4226+01916	Europe/Podgorica
-MF	+1804-06305	America/Marigot
-MG	-1855+04731	Indian/Antananarivo
-MH	+0709+17112	Pacific/Majuro	most of Marshall Islands
-MH	+0905+16720	Pacific/Kwajalein	Kwajalein
-MK	+4159+02126	Europe/Skopje
-ML	+1239-00800	Africa/Bamako
-MM	+1647+09610	Asia/Yangon
-MN	+4755+10653	Asia/Ulaanbaatar	most of Mongolia
-MN	+4801+09139	Asia/Hovd	Bayan-Olgii, Hovd, Uvs
-MO	+221150+1133230	Asia/Macau
-MP	+1512+14545	Pacific/Saipan
-MQ	+1436-06105	America/Martinique
-MR	+1806-01557	Africa/Nouakchott
-MS	+1643-06213	America/Montserrat
-MT	+3554+01431	Europe/Malta
-MU	-2010+05730	Indian/Mauritius
-MV	+0410+07330	Indian/Maldives
-MW	-1547+03500	Africa/Blantyre
-MX	+1924-09909	America/Mexico_City	Central Mexico
-MX	+2105-08646	America/Cancun	Quintana Roo
-MX	+2058-08937	America/Merida	Campeche, Yucatan
-MX	+2540-10019	America/Monterrey	Durango; Coahuila, Nuevo Leon, Tamaulipas (most areas)
-MX	+2550-09730	America/Matamoros	Coahuila, Nuevo Leon, Tamaulipas (US border)
-MX	+2838-10605	America/Chihuahua	Chihuahua (most areas)
-MX	+3144-10629	America/Ciudad_Juarez	Chihuahua (US border - west)
-MX	+2934-10425	America/Ojinaga	Chihuahua (US border - east)
-MX	+2313-10625	America/Mazatlan	Baja California Sur, Nayarit (most areas), Sinaloa
-MX	+2048-10515	America/Bahia_Banderas	Bahia de Banderas
-MX	+2904-11058	America/Hermosillo	Sonora
-MX	+3232-11701	America/Tijuana	Baja California
-MY	+0310+10142	Asia/Kuala_Lumpur	Malaysia (peninsula)
-MY	+0133+11020	Asia/Kuching	Sabah, Sarawak
-MZ	-2558+03235	Africa/Maputo
-NA	-2234+01706	Africa/Windhoek
-NC	-2216+16627	Pacific/Noumea
-NE	+1331+00207	Africa/Niamey
-NF	-2903+16758	Pacific/Norfolk
-NG	+0627+00324	Africa/Lagos
-NI	+1209-08617	America/Managua
-NL	+5222+00454	Europe/Amsterdam
-NO	+5955+01045	Europe/Oslo
-NP	+2743+08519	Asia/Kathmandu
-NR	-0031+16655	Pacific/Nauru
-NU	-1901-16955	Pacific/Niue
-NZ	-3652+17446	Pacific/Auckland	most of New Zealand
-NZ	-4357-17633	Pacific/Chatham	Chatham Islands
-OM	+2336+05835	Asia/Muscat
-PA	+0858-07932	America/Panama
-PE	-1203-07703	America/Lima
-PF	-1732-14934	Pacific/Tahiti	Society Islands
-PF	-0900-13930	Pacific/Marquesas	Marquesas Islands
-PF	-2308-13457	Pacific/Gambier	Gambier Islands
-PG	-0930+14710	Pacific/Port_Moresby	most of Papua New Guinea
-PG	-0613+15534	Pacific/Bougainville	Bougainville
-PH	+1435+12100	Asia/Manila
-PK	+2452+06703	Asia/Karachi
-PL	+5215+02100	Europe/Warsaw
-PM	+4703-05620	America/Miquelon
-PN	-2504-13005	Pacific/Pitcairn
-PR	+182806-0660622	America/Puerto_Rico
-PS	+3130+03428	Asia/Gaza	Gaza Strip
-PS	+313200+0350542	Asia/Hebron	West Bank
-PT	+3843-00908	Europe/Lisbon	Portugal (mainland)
-PT	+3238-01654	Atlantic/Madeira	Madeira Islands
-PT	+3744-02540	Atlantic/Azores	Azores
-PW	+0720+13429	Pacific/Palau
-PY	-2516-05740	America/Asuncion
-QA	+2517+05132	Asia/Qatar
-RE	-2052+05528	Indian/Reunion
-RO	+4426+02606	Europe/Bucharest
-RS	+4450+02030	Europe/Belgrade
-RU	+5443+02030	Europe/Kaliningrad	MSK-01 - Kaliningrad
-RU	+554521+0373704	Europe/Moscow	MSK+00 - Moscow area
-# The obsolescent zone.tab format cannot represent Europe/Simferopol well.
-# Put it in RU section and list as UA.  See "territorial claims" above.
-# Programs should use zone1970.tab instead; see above.
-UA	+4457+03406	Europe/Simferopol	Crimea
-RU	+5836+04939	Europe/Kirov	MSK+00 - Kirov
-RU	+4844+04425	Europe/Volgograd	MSK+00 - Volgograd
-RU	+4621+04803	Europe/Astrakhan	MSK+01 - Astrakhan
-RU	+5134+04602	Europe/Saratov	MSK+01 - Saratov
-RU	+5420+04824	Europe/Ulyanovsk	MSK+01 - Ulyanovsk
-RU	+5312+05009	Europe/Samara	MSK+01 - Samara, Udmurtia
-RU	+5651+06036	Asia/Yekaterinburg	MSK+02 - Urals
-RU	+5500+07324	Asia/Omsk	MSK+03 - Omsk
-RU	+5502+08255	Asia/Novosibirsk	MSK+04 - Novosibirsk
-RU	+5322+08345	Asia/Barnaul	MSK+04 - Altai
-RU	+5630+08458	Asia/Tomsk	MSK+04 - Tomsk
-RU	+5345+08707	Asia/Novokuznetsk	MSK+04 - Kemerovo
-RU	+5601+09250	Asia/Krasnoyarsk	MSK+04 - Krasnoyarsk area
-RU	+5216+10420	Asia/Irkutsk	MSK+05 - Irkutsk, Buryatia
-RU	+5203+11328	Asia/Chita	MSK+06 - Zabaykalsky
-RU	+6200+12940	Asia/Yakutsk	MSK+06 - Lena River
-RU	+623923+1353314	Asia/Khandyga	MSK+06 - Tomponsky, Ust-Maysky
-RU	+4310+13156	Asia/Vladivostok	MSK+07 - Amur River
-RU	+643337+1431336	Asia/Ust-Nera	MSK+07 - Oymyakonsky
-RU	+5934+15048	Asia/Magadan	MSK+08 - Magadan
-RU	+4658+14242	Asia/Sakhalin	MSK+08 - Sakhalin Island
-RU	+6728+15343	Asia/Srednekolymsk	MSK+08 - Sakha (E), N Kuril Is
-RU	+5301+15839	Asia/Kamchatka	MSK+09 - Kamchatka
-RU	+6445+17729	Asia/Anadyr	MSK+09 - Bering Sea
-RW	-0157+03004	Africa/Kigali
-SA	+2438+04643	Asia/Riyadh
-SB	-0932+16012	Pacific/Guadalcanal
-SC	-0440+05528	Indian/Mahe
-SD	+1536+03232	Africa/Khartoum
-SE	+5920+01803	Europe/Stockholm
-SG	+0117+10351	Asia/Singapore
-SH	-1555-00542	Atlantic/St_Helena
-SI	+4603+01431	Europe/Ljubljana
-SJ	+7800+01600	Arctic/Longyearbyen
-SK	+4809+01707	Europe/Bratislava
-SL	+0830-01315	Africa/Freetown
-SM	+4355+01228	Europe/San_Marino
-SN	+1440-01726	Africa/Dakar
-SO	+0204+04522	Africa/Mogadishu
-SR	+0550-05510	America/Paramaribo
-SS	+0451+03137	Africa/Juba
-ST	+0020+00644	Africa/Sao_Tome
-SV	+1342-08912	America/El_Salvador
-SX	+180305-0630250	America/Lower_Princes
-SY	+3330+03618	Asia/Damascus
-SZ	-2618+03106	Africa/Mbabane
-TC	+2128-07108	America/Grand_Turk
-TD	+1207+01503	Africa/Ndjamena
-TF	-492110+0701303	Indian/Kerguelen
-TG	+0608+00113	Africa/Lome
-TH	+1345+10031	Asia/Bangkok
-TJ	+3835+06848	Asia/Dushanbe
-TK	-0922-17114	Pacific/Fakaofo
-TL	-0833+12535	Asia/Dili
-TM	+3757+05823	Asia/Ashgabat
-TN	+3648+01011	Africa/Tunis
-TO	-210800-1751200	Pacific/Tongatapu
-TR	+4101+02858	Europe/Istanbul
-TT	+1039-06131	America/Port_of_Spain
-TV	-0831+17913	Pacific/Funafuti
-TW	+2503+12130	Asia/Taipei
-TZ	-0648+03917	Africa/Dar_es_Salaam
-UA	+5026+03031	Europe/Kyiv	most of Ukraine
-UG	+0019+03225	Africa/Kampala
-UM	+2813-17722	Pacific/Midway	Midway Islands
-UM	+1917+16637	Pacific/Wake	Wake Island
-US	+404251-0740023	America/New_York	Eastern (most areas)
-US	+421953-0830245	America/Detroit	Eastern - MI (most areas)
-US	+381515-0854534	America/Kentucky/Louisville	Eastern - KY (Louisville area)
-US	+364947-0845057	America/Kentucky/Monticello	Eastern - KY (Wayne)
-US	+394606-0860929	America/Indiana/Indianapolis	Eastern - IN (most areas)
-US	+384038-0873143	America/Indiana/Vincennes	Eastern - IN (Da, Du, K, Mn)
-US	+410305-0863611	America/Indiana/Winamac	Eastern - IN (Pulaski)
-US	+382232-0862041	America/Indiana/Marengo	Eastern - IN (Crawford)
-US	+382931-0871643	America/Indiana/Petersburg	Eastern - IN (Pike)
-US	+384452-0850402	America/Indiana/Vevay	Eastern - IN (Switzerland)
-US	+415100-0873900	America/Chicago	Central (most areas)
-US	+375711-0864541	America/Indiana/Tell_City	Central - IN (Perry)
-US	+411745-0863730	America/Indiana/Knox	Central - IN (Starke)
-US	+450628-0873651	America/Menominee	Central - MI (Wisconsin border)
-US	+470659-1011757	America/North_Dakota/Center	Central - ND (Oliver)
-US	+465042-1012439	America/North_Dakota/New_Salem	Central - ND (Morton rural)
-US	+471551-1014640	America/North_Dakota/Beulah	Central - ND (Mercer)
-US	+394421-1045903	America/Denver	Mountain (most areas)
-US	+433649-1161209	America/Boise	Mountain - ID (south), OR (east)
-US	+332654-1120424	America/Phoenix	MST - AZ (except Navajo)
-US	+340308-1181434	America/Los_Angeles	Pacific
-US	+611305-1495401	America/Anchorage	Alaska (most areas)
-US	+581807-1342511	America/Juneau	Alaska - Juneau area
-US	+571035-1351807	America/Sitka	Alaska - Sitka area
-US	+550737-1313435	America/Metlakatla	Alaska - Annette Island
-US	+593249-1394338	America/Yakutat	Alaska - Yakutat
-US	+643004-1652423	America/Nome	Alaska (west)
-US	+515248-1763929	America/Adak	Alaska - western Aleutians
-US	+211825-1575130	Pacific/Honolulu	Hawaii
-UY	-345433-0561245	America/Montevideo
-UZ	+3940+06648	Asia/Samarkand	Uzbekistan (west)
-UZ	+4120+06918	Asia/Tashkent	Uzbekistan (east)
-VA	+415408+0122711	Europe/Vatican
-VC	+1309-06114	America/St_Vincent
-VE	+1030-06656	America/Caracas
-VG	+1827-06437	America/Tortola
-VI	+1821-06456	America/St_Thomas
-VN	+1045+10640	Asia/Ho_Chi_Minh
-VU	-1740+16825	Pacific/Efate
-WF	-1318-17610	Pacific/Wallis
-WS	-1350-17144	Pacific/Apia
-YE	+1245+04512	Asia/Aden
-YT	-1247+04514	Indian/Mayotte
-ZA	-2615+02800	Africa/Johannesburg
-ZM	-1525+02817	Africa/Lusaka
-ZW	-1750+03103	Africa/Harare
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp
index e1dd68a8b50..e59644521ab 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Button.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -242,7 +242,7 @@ AwtButton::OwnerDrawItem(UINT /*ctrlId*/, DRAWITEMSTRUCT& drawInfo)
         RECT focusRect;
         VERIFY(::CopyRect(&focusRect, &rect));
         VERIFY(::InflateRect(&focusRect,-inf,-inf));
-        if(::DrawFocusRect(hDC, &focusRect) == 0)
+        if (!::IsRectEmpty(&focusRect) && (::DrawFocusRect(hDC, &focusRect) == 0))
             VERIFY(::GetLastError() == 0);
     }
 
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp
index d038783d5f0..b37207fa2eb 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -290,13 +290,13 @@ AwtCheckbox::OwnerDrawItem(UINT /*ctrlId*/, DRAWITEMSTRUCT& drawInfo)
     if ((drawInfo.itemState & ODS_FOCUS) &&
         ((drawInfo.itemAction & ODA_FOCUS)||
          (drawInfo.itemAction &ODA_DRAWENTIRE))) {
-        if(::DrawFocusRect(hDC, &focusRect) == 0)
+        if (!::IsRectEmpty(&focusRect) && (::DrawFocusRect(hDC, &focusRect) == 0))
             VERIFY(::GetLastError() == 0);
     }
     /*  erase focus rect */
     else if (!(drawInfo.itemState & ODS_FOCUS) &&
              (drawInfo.itemAction & ODA_FOCUS)) {
-        if(::DrawFocusRect(hDC, &focusRect) == 0)
+        if (!::IsRectEmpty(&focusRect) && (::DrawFocusRect(hDC, &focusRect) == 0))
             VERIFY(::GetLastError() == 0);
     }
 
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
index c49c2265ca3..b67c5dfcf8d 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -4465,7 +4465,7 @@ void AwtComponent::DrawListItem(JNIEnv *env, DRAWITEMSTRUCT &drawInfo)
     if ((drawInfo.itemState & ODS_FOCUS)  &&
         (drawInfo.itemAction & (ODA_FOCUS | ODA_DRAWENTIRE))) {
       if (!unfocusableChoice){
-          if(::DrawFocusRect(hDC, &rect) == 0)
+          if (!::IsRectEmpty(&rect) && (::DrawFocusRect(hDC, &rect) == 0))
               VERIFY(::GetLastError() == 0);
       }
     }
diff --git a/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java b/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
index 1f5b5b215fa..021a13fceac 100644
--- a/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
+++ b/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
@@ -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
@@ -3904,6 +3904,8 @@ private int controlCode(KeyStroke keyStroke) {
             return 0;
         int code = keyStroke.getKeyCode();
         switch (code) {
+            case KeyEvent.VK_TAB:
+            case KeyEvent.VK_SPACE:
             case KeyEvent.VK_BACK_SPACE:
             case KeyEvent.VK_DELETE:
             case KeyEvent.VK_DOWN:
@@ -3946,15 +3948,10 @@ private char getKeyChar(KeyStroke keyStroke) {
             debugString("[INFO]:   Shortcut is control character: " + Integer.toHexString(keyCode));
             return (char)keyCode;
         }
-        String keyText = KeyEvent.getKeyText(keyStroke.getKeyCode());
-        debugString("[INFO]:   Shortcut is: " + keyText);
-        if (keyText != null || keyText.length() > 0) {
-            CharSequence seq = keyText.subSequence(0, 1);
-            if (seq != null || seq.length() > 0) {
-                return seq.charAt(0);
-            }
-        }
-        return 0;
+
+        keyCode = keyStroke.getKeyCode();
+        debugString("[INFO]:   Shortcut is: " + Integer.toHexString(keyCode));
+        return (char)keyCode;
     }
 
     /*
diff --git a/src/jdk.accessibility/windows/native/include/bridge/AccessBridgePackages.h b/src/jdk.accessibility/windows/native/include/bridge/AccessBridgePackages.h
index 27c31be09a8..232cab4b21b 100644
--- a/src/jdk.accessibility/windows/native/include/bridge/AccessBridgePackages.h
+++ b/src/jdk.accessibility/windows/native/include/bridge/AccessBridgePackages.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, 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
@@ -1108,6 +1108,8 @@ typedef long ABHWND64;
 #define ACCESSIBLE_CONTROLCODE_KEYSTROKE        512  // Control code key pressed, character contains control code.
 
 // The supported control code keys are:
+#define ACCESSIBLE_VK_TAB           9
+#define ACCESSIBLE_VK_SPACE         32
 #define ACCESSIBLE_VK_BACK_SPACE    8
 #define ACCESSIBLE_VK_DELETE        127
 #define ACCESSIBLE_VK_DOWN          40
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.java
index 2f310effc87..66ebd6551a4 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.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
@@ -75,9 +75,4 @@ public void printOn(PrintStream tty) {
     if (isStrict      ()) tty.print("strict "      );
     if (isSynthetic   ()) tty.print("synthetic "   );
   }
-
-  // get flags written to .class files
-  public int getStandardFlags() {
-    return (int) (flags & JVM_ACC_WRITTEN_FLAGS);
-  }
 }
diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
index 25f40ec443f..7f9a6b4b49d 100644
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.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
@@ -98,16 +98,7 @@ public interface ClassConstants
     public static final long JVM_ACC_ENUM         = 0x4000; /* field is declared as element of enum */
 
 
-    // from accessFlags.hpp - hotspot internal flags
-
-    // flags actually put in .class file
-    public static final long JVM_ACC_WRITTEN_FLAGS = 0x00007FFF;
-
-    // flags accepted by set_field_flags
-    public static final long JVM_ACC_FIELD_FLAGS = 0x00008000 | JVM_ACC_WRITTEN_FLAGS;
-
     // from jvm.h
-
     public static final long JVM_RECOGNIZED_CLASS_MODIFIERS   = (JVM_ACC_PUBLIC |
                                                                  JVM_ACC_FINAL |
                                                                  JVM_ACC_SUPER |
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/FieldBuilder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/FieldBuilder.java
index c6916bc52ef..df6fb9f2a9a 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/FieldBuilder.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/FieldBuilder.java
@@ -353,9 +353,10 @@ record WildcardElement(String name, String label, ValueDescriptor field) {
                 var subFields = we.field().getFields().reversed();
                 if (!subFields.isEmpty() && !KNOWN_TYPES.contains(we.field().getTypeName())) {
                     for (ValueDescriptor subField : subFields) {
-                        String n = we.name + "." + subField.getName();
-                        String l = we.label + " : " + makeLabel(subField, false);
-                        if (stack.size() < 2) { // Limit depth to 2
+                        // Limit depth to 2
+                        if (!we.name.contains(".")) {
+                            String n = we.name + "." + subField.getName();
+                            String l = we.label + " : " + makeLabel(subField, false);
                             stack.push(new WildcardElement(n, l, subField));
                         }
                     }
@@ -369,7 +370,6 @@ record WildcardElement(String name, String label, ValueDescriptor field) {
             FieldBuilder fb = new FieldBuilder(eventTypes, type, we.name());
             Field field = fb.build().getFirst();
             field.label = we.label;
-            field.index = result.size();
             field.visible = true;
             field.sourceFields.add(field);
             result.add(field);
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/Function.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/Function.java
index 29d55e95673..0c9ca96ee20 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/Function.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/Function.java
@@ -89,7 +89,7 @@ public static Function create(Field field) {
             return createPercentile(field, 0.99);
         }
         if (aggregator == Aggregator.P999) {
-            return createPercentile(field, 0.9999);
+            return createPercentile(field, 0.999);
         }
         if (aggregator == Aggregator.MAXIMUM) {
             return new Maximum();
@@ -175,9 +175,9 @@ public void add(Object value) {
         @Override
         public Object result() {
             if (count != 0) {
-                long s = seconds / count;
-                long n = nanos / count;
-                return Duration.ofSeconds(s, n);
+                double total = 1_000_000_000.0 * seconds + nanos;
+                double average = total / count;
+                return Duration.ofNanos(Math.round(average));
             } else {
                 return null;
             }
@@ -578,7 +578,7 @@ public Object result() {
             double doubleIndex = (size + 1) * percentile;
             int valueIndex = (int) doubleIndex - 1;
             int valueNextIndex = (int) doubleIndex;
-            double fraction = doubleIndex - valueIndex;
+            double fraction = doubleIndex - (int) doubleIndex;
 
             if (valueIndex < 0) {
                 return numbers.getFirst();
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java
index 4d947eea9a5..1b68a038a17 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/query/QueryResolver.java
@@ -98,11 +98,19 @@ public List resolve() throws QueryException {
         resolveGroupBy();
         resolveOrderBy();
         resolveWhere();
+        applyIndex();
         applyColumn();
         applyFormat();
         return resultFields;
     }
 
+    private void applyIndex() {
+        int index = 0;
+        for (Field field : resultFields) {
+            field.index = index++;
+        }
+    }
+
     private void resolveWhere() throws QuerySyntaxException {
         for (Condition condition : where) {
             List fields = new ArrayList<>();
@@ -238,7 +246,6 @@ private Field addField(String name, List types) throws QueryExcept
             }
         }
         for (Field field: fields) {
-            field.index = resultFields.size();
             primary.sourceFields.add(field);
             // Convert to String if field data types mismatch
             if (mixedTypes) {
diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/JimageDiffGenerator.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/JimageDiffGenerator.java
index 3ef42fb9aa0..60014e2bbd7 100644
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/JimageDiffGenerator.java
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/JimageDiffGenerator.java
@@ -24,6 +24,9 @@
  */
 package jdk.tools.jlink.internal.runtimelink;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UncheckedIOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -49,6 +52,7 @@ public class JimageDiffGenerator {
     public interface ImageResource extends AutoCloseable {
         public List getEntries();
         public byte[] getResourceBytes(String name);
+        public InputStream getResource(String name);
     }
 
     /**
@@ -71,7 +75,6 @@ public List generateDiff(ImageResource base, ImageResource image)
             resources.addAll(image.getEntries());
             baseResources = base.getEntries();
             for (String item: baseResources) {
-                byte[] baseBytes = base.getResourceBytes(item);
                 // First check that every item in the base image exist in
                 // the optimized image as well. If it does not, it's a removed
                 // item in the optimized image.
@@ -82,19 +85,18 @@ public List generateDiff(ImageResource base, ImageResource image)
                     ResourceDiff.Builder builder = new ResourceDiff.Builder();
                     ResourceDiff diff = builder.setKind(ResourceDiff.Kind.REMOVED)
                            .setName(item)
-                           .setResourceBytes(baseBytes)
+                           .setResourceBytes(base.getResourceBytes(item))
                            .build();
                     diffs.add(diff);
                     continue;
                 }
                 // Verify resource bytes are equal if present in both images
-                boolean contentEquals = Arrays.equals(baseBytes, image.getResourceBytes(item));
-                if (!contentEquals) {
+                if (!compareStreams(base.getResource(item), image.getResource(item))) {
                     // keep track of original bytes (non-optimized)
                     ResourceDiff.Builder builder = new ResourceDiff.Builder();
                     ResourceDiff diff = builder.setKind(ResourceDiff.Kind.MODIFIED)
                         .setName(item)
-                        .setResourceBytes(baseBytes)
+                        .setResourceBytes(base.getResourceBytes(item))
                         .build();
                     diffs.add(diff);
                 }
@@ -112,4 +114,51 @@ public List generateDiff(ImageResource base, ImageResource image)
         return diffs;
     }
 
+    /**
+     * Compare the contents of the two input streams (byte-by-byte).
+     *
+     * @param is1 The first input stream
+     * @param is2 The second input stream
+     * @return {@code true} iff the two streams contain the same number of
+     *         bytes and each byte of the streams are equal. {@code false}
+     *         otherwise.
+     */
+    private boolean compareStreams(InputStream is1, InputStream is2) {
+        byte[] buf1 = new byte[1024];
+        byte[] buf2 = new byte[1024];
+        int bytesRead1, bytesRead2 = 0;
+        try {
+            try (is1; is2) {
+                while ((bytesRead1 = is1.read(buf1)) != -1 &&
+                       (bytesRead2 = is2.read(buf2)) != -1) {
+                    if (bytesRead1 != bytesRead2) {
+                        return false;
+                    }
+                    if (bytesRead1 == buf1.length) {
+                        if (!Arrays.equals(buf1, buf2)) {
+                            return false;
+                        }
+                    } else {
+                        for (int i = 0; i < bytesRead1; i++) {
+                            if (buf1[i] != buf2[i]) {
+                                return false;
+                            }
+                        }
+                    }
+                }
+                // ensure we read both to the end
+                if (bytesRead1 == -1) {
+                    bytesRead2 = is2.read(buf2);
+                    if (bytesRead2 != -1) {
+                        return false;
+                    }
+                    return true;
+                }
+            }
+        } catch (IOException e) {
+            throw new UncheckedIOException("IO exception when comparing bytes", e);
+        }
+        return false;
+    }
+
 }
diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/ResourcePoolReader.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/ResourcePoolReader.java
index 910fe57b75a..c4c16579906 100644
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/ResourcePoolReader.java
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/runtimelink/ResourcePoolReader.java
@@ -25,6 +25,7 @@
 
 package jdk.tools.jlink.internal.runtimelink;
 
+import java.io.InputStream;
 import java.util.List;
 import java.util.Objects;
 
@@ -56,4 +57,9 @@ public byte[] getResourceBytes(String name) {
         return pool.findEntry(name).orElseThrow().contentBytes();
     }
 
+    @Override
+    public InputStream getResource(String name) {
+        return pool.findEntry(name).orElseThrow().content();
+    }
+
 }
diff --git a/test/hotspot/jtreg/ProblemList-Virtual.txt b/test/hotspot/jtreg/ProblemList-Virtual.txt
index b5bb2c72779..23d21cd0338 100644
--- a/test/hotspot/jtreg/ProblemList-Virtual.txt
+++ b/test/hotspot/jtreg/ProblemList-Virtual.txt
@@ -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
@@ -85,7 +85,7 @@ vmTestbase/nsk/jdi/ExceptionEvent/catchLocation/location002/TestDescription.java
 # the debuggee, which can lead to I/O poller threads exiting. Because
 # of this no vthreads can complete their reads, and the test times out as a result.
 
-vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 8285417 generic-all
+vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 8347137 generic-all
 
 ###
 # Fails because resume of a virtual thread is not enough to allow the virtual thread
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001.java
index b147757f9e0..1009f2d3538 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001.java
@@ -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
@@ -62,7 +62,7 @@ public static int run(String args[], PrintStream out) {
                 makeThread();
             }
 
-            System.out.println("Can't reproduce OOME due to a limit on iterations/execution time. Test was useless."
+            System.out.println("Test resexhausted001: Can't reproduce OOME due to a limit on iterations/execution time. Test was useless."
                     + " threadCount=" + threadCount.get());
             throw new SkippedException("Test did not get an OutOfMemory error");
 
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted002.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted002.java
index 46832df7dc3..c1a6e111c9f 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted002.java
@@ -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
@@ -55,7 +55,7 @@ public static int run(String args[], PrintStream out) {
                 ++count;
             }
 
-            System.out.println("Can't reproduce OOME due to a limit on iterations/execution time. Test was useless.");
+            System.out.println("Test resexhausted002: Can't reproduce OOME due to a limit on iterations/execution time. Test was useless.");
             throw new SkippedException("Test did not get an OutOfMemory error");
 
         } catch (OutOfMemoryError e) {
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003.java
index f336c1bf3d5..8cc997fa4ab 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003.java
@@ -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
@@ -115,7 +115,7 @@ public static int run(String args[], PrintStream out) {
                 ++count;
             }
 
-            System.out.println("Can't reproduce OOME due to a limit on iterations/execution time. Test was useless.");
+            System.out.println("Test resexhausted003: Can't reproduce OOME due to a limit on iterations/execution time. Test was useless.");
             throw new SkippedException("Test did not get an OutOfMemory error");
 
         } catch (OutOfMemoryError e) {
diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java
index b6ef5ab8487..26cdf4473cf 100644
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java
@@ -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.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,10 +39,7 @@
  *          /test/lib
  * @run main/othervm/native
  *      -agentlib:resexhausted=-waittime=5
- *      -Xms64m
- *      -Xmx64m
- *      -XX:MaxMetaspaceSize=9m
- *      -XX:-UseGCOverheadLimit
+ *      -XX:MaxMetaspaceSize=20m
  *      nsk.jvmti.ResourceExhausted.resexhausted003
  */
 
diff --git a/test/jdk/com/sun/crypto/provider/KDF/HKDFDelayedPRK.java b/test/jdk/com/sun/crypto/provider/KDF/HKDFDelayedPRK.java
new file mode 100644
index 00000000000..50157723416
--- /dev/null
+++ b/test/jdk/com/sun/crypto/provider/KDF/HKDFDelayedPRK.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8347289
+ * @summary make sure DPS works when non-extractable PRK is provided
+ * @library /test/lib /test/jdk/security/unsignedjce
+ * @build java.base/javax.crypto.ProviderVerifier
+ * @enablePreview
+ * @run main/othervm HKDFDelayedPRK
+ */
+
+import jdk.test.lib.Asserts;
+
+import javax.crypto.KDF;
+import javax.crypto.KDFParameters;
+import javax.crypto.KDFSpi;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.HKDFParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.Provider;
+import java.security.Security;
+import java.security.spec.AlgorithmParameterSpec;
+
+public class HKDFDelayedPRK {
+    public static void main(String[] args) throws Exception {
+        // This is a fake non-extractable key
+        var prk = new SecretKey() {
+            @Override
+            public String getAlgorithm() {
+                return "PRK";
+            }
+
+            @Override
+            public String getFormat() {
+                return null;
+            }
+
+            @Override
+            public byte[] getEncoded() {
+                return null;
+            }
+        };
+
+        Security.addProvider(new ProviderImpl());
+        var kdf = KDF.getInstance("HKDF-SHA256");
+        kdf.deriveData(HKDFParameterSpec.expandOnly(prk, null, 32));
+
+        // Confirms our own omnipotent impl is selected
+        Asserts.assertEquals("P", kdf.getProviderName());
+    }
+
+    public static class ProviderImpl extends Provider {
+        public ProviderImpl() {
+            super("P", "1", "info");
+            put("KDF.HKDF-SHA256", KDFImpl.class.getName());
+        }
+    }
+
+    // This HKDF impl accepts everything
+    public static class KDFImpl extends KDFSpi {
+
+        public KDFImpl(KDFParameters params) throws InvalidAlgorithmParameterException {
+            super(params);
+        }
+
+        @Override
+        protected KDFParameters engineGetParameters() {
+            return null;
+        }
+
+        @Override
+        protected SecretKey engineDeriveKey(String alg, AlgorithmParameterSpec dummy) {
+            return new SecretKeySpec(new byte[32], alg);
+        }
+
+        @Override
+        protected byte[] engineDeriveData(AlgorithmParameterSpec dummy) {
+            return new byte[32];
+        }
+    }
+}
diff --git a/test/jdk/java/nio/file/Files/probeContentType/Basic.java b/test/jdk/java/nio/file/Files/probeContentType/Basic.java
index 8add9e76104..aee1b19a01d 100644
--- a/test/jdk/java/nio/file/Files/probeContentType/Basic.java
+++ b/test/jdk/java/nio/file/Files/probeContentType/Basic.java
@@ -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
@@ -40,6 +40,7 @@
 
 import jdk.internal.util.OperatingSystem;
 import jdk.internal.util.OSVersion;
+import jdk.internal.util.StaticProperty;
 
 /**
  * Uses Files.probeContentType to probe html file, custom file type, and minimal
@@ -83,7 +84,7 @@ private static int checkContentTypes(String expected, String actual) {
         if (!expected.equals(actual)) {
             if (!OperatingSystem.isWindows()) {
                 Path userMimeTypes =
-                    Path.of(System.getProperty("user.home"), ".mime.types");
+                    Path.of(StaticProperty.userHome(), ".mime.types");
                 checkMimeTypesFile(userMimeTypes);
 
                 Path etcMimeTypes = Path.of("/etc/mime.types");
@@ -188,9 +189,10 @@ public static void main(String[] args) throws IOException {
         exTypes.add(new ExType("xlsx", List.of("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")));
         exTypes.add(new ExType("wasm", List.of("application/wasm")));
 
-        // extensions with content type that differs on Windows 11+
+        // extensions with content type that differs on Windows 11+ and
+        // Windows Server 2025
         if (OperatingSystem.isWindows() &&
-            (System.getProperty("os.name").endsWith("11") ||
+            (StaticProperty.osName().matches("^.*[11|2025]$") ||
                 new OSVersion(10, 0).compareTo(OSVersion.current()) > 0)) {
             System.out.println("Windows 11+ detected: using different types");
             exTypes.add(new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip", "application/x-compressed")));
diff --git a/test/jdk/java/util/TimeZone/tools/share/Makefile b/test/jdk/java/util/TimeZone/tools/share/Makefile
index 69c4838efe0..47734b96c55 100644
--- a/test/jdk/java/util/TimeZone/tools/share/Makefile
+++ b/test/jdk/java/util/TimeZone/tools/share/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008, 2022, 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
@@ -33,8 +33,7 @@
 TZDATA = ../../../../../../../src/java.base/share/data/tzdata
 TZDATA_VER = `grep '^tzdata' $(TZDATA)/VERSION`
 TZNAME = africa antarctica asia australasia europe northamerica \
-	solar87 solar88 solar89 southamerica \
-	backward
+	southamerica backward
 TZFILES = $(addprefix $(TZDATA)/, $(TZNAME))
 ALIASLIST = aliases.txt
 DISPLAYNAMES = displaynames.txt
diff --git a/test/jdk/javax/accessibility/TestJMenuItemShortcutAccessibility.java b/test/jdk/javax/accessibility/TestJMenuItemShortcutAccessibility.java
new file mode 100644
index 00000000000..acd7ec3c64a
--- /dev/null
+++ b/test/jdk/javax/accessibility/TestJMenuItemShortcutAccessibility.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
+ * 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.
+ *
+ * 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.
+ */
+
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.KeyStroke;
+
+/*
+ * @test
+ * @bug 8339728
+ * @summary Tests that JAWS announce the shortcuts for JMenuItems.
+ * @requires os.family == "windows"
+ * @library /java/awt/regtesthelpers
+ * @build PassFailJFrame
+ * @run main/manual TestJMenuItemShortcutAccessibility
+ */
+
+public class TestJMenuItemShortcutAccessibility {
+    public static void main(String[] args) throws Exception {
+        String INSTRUCTIONS = """
+                1. Start the JAWS application
+                2. Press Alt + M to open application Menu
+                3. Navigate the Menu Items by using UP / DOWN arrow key
+                4. Press Pass if you are able to hear correct JAWS announcements
+                   (JAWS should read full shortcut text and not only the 1st
+                   character of shortcut text for each menu item) else Fail
+                """;
+
+        PassFailJFrame.builder()
+                .title("TestJMenuItemShortcutAccessibility Instruction")
+                .instructions(INSTRUCTIONS)
+                .columns(35)
+                .testUI(TestJMenuItemShortcutAccessibility::createUI)
+                .build()
+                .awaitAndCheck();
+    }
+
+    private static JFrame createUI() {
+        JFrame frame = new JFrame("A Frame with Menu");
+
+        JMenuBar menuBar = new JMenuBar();
+        JMenu menu = new JMenu("Menu with shortcuts");
+        menu.setMnemonic(KeyEvent.VK_M);
+        menuBar.add(menu);
+
+        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_F,
+                InputEvent.CTRL_DOWN_MASK);
+        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_2,
+                InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke3 = KeyStroke.getKeyStroke(KeyEvent.VK_F1,
+                InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke4 = KeyStroke.getKeyStroke(KeyEvent.VK_COMMA,
+                InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke5 = KeyStroke.getKeyStroke(KeyEvent.VK_PERIOD,
+                InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK);
+        KeyStroke keyStroke6 = KeyStroke.getKeyStroke(KeyEvent.VK_TAB,
+                InputEvent.CTRL_DOWN_MASK);
+        KeyStroke keyStroke7 = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
+                InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
+
+        JMenuItem menuItem1 = new JMenuItem("First Menu Item");
+        menuItem1.setAccelerator(keyStroke1);
+        JMenuItem menuItem2 = new JMenuItem("Second Menu Item");
+        menuItem2.setAccelerator(keyStroke2);
+        JMenuItem menuItem3 = new JMenuItem("Third Menu Item");
+        menuItem3.setAccelerator(keyStroke3);
+        JMenuItem menuItem4 = new JMenuItem("Fourth Menu Item");
+        menuItem4.setAccelerator(keyStroke4);
+        JMenuItem menuItem5 = new JMenuItem("Fifth Menu Item");
+        menuItem5.setAccelerator(keyStroke5);
+        JMenuItem menuItem6 = new JMenuItem("Sixth Menu Item");
+        menuItem6.setAccelerator(keyStroke6);
+        JMenuItem menuItem7 = new JMenuItem("Seventh Menu Item");
+        menuItem7.setAccelerator(keyStroke7);
+
+        menu.add(menuItem1);
+        menu.add(menuItem2);
+        menu.add(menuItem3);
+        menu.add(menuItem4);
+        menu.add(menuItem5);
+        menu.add(menuItem6);
+        menu.add(menuItem7);
+
+        frame.setJMenuBar(menuBar);
+        frame.setSize(300, 200);
+        return frame;
+    }
+}
diff --git a/test/jdk/sun/util/calendar/zi/BackEnd.java b/test/jdk/sun/util/calendar/zi/BackEnd.java
deleted file mode 100644
index 10d71ff7210..00000000000
--- a/test/jdk/sun/util/calendar/zi/BackEnd.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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.
- */
-
-/**
- * BackEnd is an abstract base class for a back-end of compiling
- * Olson's zoneinfo database and generating Java zoneinfo database.
- *
- * @since 1.4
- */
-abstract class BackEnd {
-
-    /**
-     * Receives each zone's TimeZone information which was created by
-     * {@link Zoneinfo#parse} in class Zoneinfo,
-     * and processes it.
-     *
-     * @param tz Timezone object for each zone
-     * @return 0 if no error occurred, otherwise 1.
-     */
-    abstract int processZoneinfo(Timezone tz);
-
-    /**
-     * Receives whole information which is generated by JavaZic's front-end
-     * in the form of Mapping object and generates all Java zone information
-     * files.
-     *
-     * @param m Mappings object which is generated by
-     *          {@link Main#compile() Main.compile()}.
-     * @return 0 if no error occurred, otherwise 1.
-     */
-    abstract int generateSrc(Mappings m);
-
-    /**
-     * Decides which backend class should be used and returns its instance.
-     * @return an instance of backend class
-     */
-    static BackEnd getBackEnd() {
-        if (Zoneinfo.isYearForTimeZoneDataSpecified) {
-            return new Simple();
-        } else if (Main.outputDoc) {
-            return new GenDoc();
-        } else {
-            return new Gen();
-        }
-    }
-}
diff --git a/test/jdk/sun/util/calendar/zi/Beyond2037.java b/test/jdk/sun/util/calendar/zi/Beyond2037.java
deleted file mode 100644
index af6f16067a8..00000000000
--- a/test/jdk/sun/util/calendar/zi/Beyond2037.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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.
- */
-
-/*
- * @test
- * @bug 8073446 8262110
- * @summary Tests DST related beyond the year 2037
- * @run testng Beyond2037
- */
-
-import java.text.SimpleDateFormat;
-import java.util.TimeZone;
-
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-import static org.testng.Assert.assertEquals;
-
-@Test
-public class Beyond2037 {
-
-    @DataProvider
-    Object[][] dstTransition() {
-        return new Object[][] {
-            {"2037/03/08 01:59:59:999", "2037/03/08 01:59:59:999"},
-            {"2037/03/08 02:00:00:000", "2037/03/08 03:00:00:000"},
-            {"2038/03/14 01:59:59:999", "2038/03/14 01:59:59:999"},
-            {"2038/03/14 02:00:00:000", "2038/03/14 03:00:00:000"},
-            {"2099/03/08 01:59:59:999", "2099/03/08 01:59:59:999"},
-            {"2099/03/08 02:00:00:000", "2099/03/08 03:00:00:000"},
-            {"2100/03/14 01:59:59:999", "2100/03/14 01:59:59:999"},
-            {"2100/03/14 02:00:00:000", "2100/03/14 03:00:00:000"},
-            {"8000/03/12 01:59:59:999", "8000/03/12 01:59:59:999"},
-            {"8000/03/12 02:00:00:000", "8000/03/12 03:00:00:000"},
-        };
-    }
-
-    @Test(dataProvider="dstTransition")
-    public void testDstTransition(String source, String expected) throws Exception {
-        var timeZone = TimeZone.getTimeZone("America/New_York");
-        var sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss:SSS" );
-        sdf.setTimeZone(timeZone);
-        assertEquals(sdf.format(sdf.parse(source)), expected);
-    }
-
-    @Test
-    public void testGetOffset() throws Exception {
-        var timeZone = TimeZone.getTimeZone("PST8PDT");
-        var df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        df.setTimeZone(timeZone);
-        var tMilli = df.parse("7681-03-09 03:20:49").getTime();
-        assertEquals(timeZone.getOffset(tMilli), -25200000);
-    }
-}
diff --git a/test/jdk/sun/util/calendar/zi/Checksum.java b/test/jdk/sun/util/calendar/zi/Checksum.java
deleted file mode 100644
index 93a1c827903..00000000000
--- a/test/jdk/sun/util/calendar/zi/Checksum.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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.
- */
-
-import java.util.zip.CRC32;
-
-/**
- * Checksum provides methods for calculating a CRC32 value for a
- * transitions table.
- *
- * @since 1.4
- */
-public class Checksum extends CRC32
-{
-    /**
-     * Updates the CRC32 value from each byte of the given int
-     * value. The bytes are used in the big endian order.
-     * @param val the int value
-     */
-    public void update(int val) {
-        byte[] b = new byte[4];
-        b[0] = (byte)((val >>> 24) & 0xff);
-        b[1] = (byte)((val >>> 16) & 0xff);
-        b[2] = (byte)((val >>> 8) & 0xff);
-        b[3] = (byte)(val & 0xff);
-        update(b);
-    }
-
-    /**
-     * Updates the CRC32 value from each byte of the given long
-     * value. The bytes are used in the big endian order.
-     * @param val the long value
-     */
-    void update(long val) {
-        byte[] b = new byte[8];
-        b[0] = (byte)((val >>> 56) & 0xff);
-        b[1] = (byte)((val >>> 48) & 0xff);
-        b[2] = (byte)((val >>> 40) & 0xff);
-        b[3] = (byte)((val >>> 32) & 0xff);
-        b[4] = (byte)((val >>> 24) & 0xff);
-        b[5] = (byte)((val >>> 16) & 0xff);
-        b[6] = (byte)((val >>> 8) & 0xff);
-        b[7] = (byte)(val & 0xff);
-        update(b);
-    }
-}
diff --git a/test/jdk/sun/util/calendar/zi/DayOfWeek.java b/test/jdk/sun/util/calendar/zi/DayOfWeek.java
deleted file mode 100644
index ed820a83c39..00000000000
--- a/test/jdk/sun/util/calendar/zi/DayOfWeek.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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.
- */
-
-/**
- * Day of week enum.
- *
- * @since 1.6
- */
-
-enum DayOfWeek {
-    SUNDAY("Sun"),
-    MONDAY("Mon"),
-    TUESDAY("Tue"),
-    WEDNESDAY("Wed"),
-    THURSDAY("Thu"),
-    FRIDAY("Fri"),
-    SATURDAY("Sat");
-
-    private final String abbr;
-
-    private DayOfWeek(String abbr) {
-        this.abbr = abbr;
-    }
-
-    String getAbbr() {
-        return abbr;
-    }
-
-    int value() {
-        return ordinal() + 1;
-    }
-}
diff --git a/test/jdk/sun/util/calendar/zi/Gen.java b/test/jdk/sun/util/calendar/zi/Gen.java
deleted file mode 100644
index 4cdabc55321..00000000000
--- a/test/jdk/sun/util/calendar/zi/Gen.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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.
- */
-
-import  java.io.IOException;
-import  java.io.File;
-import  java.io.FileOutputStream;
-import  java.io.DataOutputStream;
-import  java.io.RandomAccessFile;
-import  java.util.List;
-import  java.util.Map;
-import  java.util.Set;
-
-/**
- * Gen is one of back-end classes of javazic, and generates
- * ZoneInfoMappings and zone-specific file for each zone.
- */
-class Gen extends BackEnd {
-
-    /**
-     * Generates datafile in binary TLV format for each time zone.
-     * Regarding contents of output files, see {@link ZoneInfoFile}.
-     *
-     * @param Timezone
-     * @return 0 if no errors, or 1 if error occurred.
-     */
-    int processZoneinfo(Timezone tz) {
-        try {
-            int size;
-            String outputDir = Main.getOutputDir();
-            String zonefile = ZoneInfoFile.getFileName(tz.getName());
-
-            /* If outputDir doesn't end with file-separator, adds it. */
-            if (!outputDir.endsWith(File.separator)) {
-                outputDir += File.separatorChar;
-            }
-
-            /* If zonefile includes file-separator, it's treated as part of
-             * pathname. And make directory if necessary.
-             */
-            int index = zonefile.lastIndexOf(File.separatorChar);
-            if (index != -1) {
-                outputDir += zonefile.substring(0, index+1);
-            }
-            File outD = new File(outputDir);
-            outD.mkdirs();
-
-            FileOutputStream fos =
-                new FileOutputStream(outputDir + zonefile.substring(index+1));
-            DataOutputStream dos = new DataOutputStream(fos);
-
-            /* Output Label */
-            dos.write(ZoneInfoFile.JAVAZI_LABEL, 0,
-                      ZoneInfoFile.JAVAZI_LABEL.length);
-
-            /* Output Version of ZoneInfoFile */
-            dos.writeByte(ZoneInfoFile.JAVAZI_VERSION);
-
-            List transitions = tz.getTransitions();
-            if (transitions != null) {
-                List dstOffsets = tz.getDstOffsets();
-                List offsets = tz.getOffsets();
-
-                if ((dstOffsets == null && offsets != null) ||
-                    (dstOffsets != null && offsets == null)) {
-                    Main.panic("Data not exist. (dstOffsets or offsets)");
-                    return 1;
-                }
-
-                /* Output Transition records */
-                dos.writeByte(ZoneInfoFile.TAG_Transition);
-                size = transitions.size();
-                dos.writeShort((size * 8) & 0xFFFF);
-                int dstoffset;
-                for (int i = 0; i < size; i++) {
-                    /* if DST offset is 0, this means DST isn't used.
-                     * (NOT: offset's index is 0.)
-                     */
-                    if ((dstoffset = dstOffsets.get(i).intValue()) == -1) {
-                        dstoffset = 0;
-                    }
-
-                    dos.writeLong((transitions.get(i).longValue() << 12)
-                                  | (dstoffset << 4)
-                                  | offsets.get(i).intValue());
-
-                }
-
-                /* Output data for GMTOffset */
-                List gmtoffset = tz.getGmtOffsets();
-                dos.writeByte(ZoneInfoFile.TAG_Offset);
-                size = gmtoffset.size();
-                dos.writeShort((size * 4) & 0xFFFF);
-                for (int i = 0; i < size; i++) {
-                    dos.writeInt(gmtoffset.get(i));
-                }
-            }
-
-            /* Output data for SimpleTimeZone */
-            List stz = tz.getLastRules();
-            if (stz != null) {
-                RuleRec[] rr = new RuleRec[2];
-                boolean wall = true;
-
-                rr[0] = stz.get(0);
-                rr[1] = stz.get(1);
-
-                dos.writeByte(ZoneInfoFile.TAG_SimpleTimeZone);
-                wall = rr[0].getTime().isWall() && rr[1].getTime().isWall();
-                if (wall) {
-                    dos.writeShort(32);
-                } else {
-                    dos.writeShort(40);
-                }
-
-                for (int i = 0; i < 2; i++) {
-                    dos.writeInt(rr[i].getMonthNum() - 1); // 0-based month number
-                    dos.writeInt(rr[i].getDay().getDayForSimpleTimeZone());
-                    dos.writeInt(rr[i].getDay().getDayOfWeekForSimpleTimeZoneInt());
-                    dos.writeInt((int)rr[i].getTime().getTime());
-                    if (!wall) {
-                        dos.writeInt((rr[i].getTime().getType() & 0xFF) - 1);
-                    }
-                }
-            }
-
-            /* Output RawOffset */
-            dos.writeByte(ZoneInfoFile.TAG_RawOffset);
-            dos.writeShort(4);
-            dos.writeInt(tz.getRawOffset());
-
-            /* Output willGMTOffsetChange flag */
-            if (tz.willGMTOffsetChange()) {
-                dos.writeByte(ZoneInfoFile.TAG_GMTOffsetWillChange);
-                dos.writeShort(1);
-                dos.writeByte(1);
-            }
-
-            /* Output LastDSTSaving */
-            dos.writeByte(ZoneInfoFile.TAG_LastDSTSaving);
-            dos.writeShort(2);
-            dos.writeShort(tz.getLastDSTSaving()/1000);
-
-            /* Output checksum */
-            dos.writeByte(ZoneInfoFile.TAG_CRC32);
-            dos.writeShort(4);
-            dos.writeInt(tz.getCRC32());
-
-            fos.close();
-            dos.close();
-        } catch(IOException e) {
-            Main.panic("IO error: "+e.getMessage());
-            return 1;
-        }
-
-        return 0;
-    }
-
-    /**
-     * Generates ZoneInfoMappings in binary TLV format for each zone.
-     * Regarding contents of output files, see {@link ZoneInfoFile}.
-     *
-     * @param Mappings
-     * @return 0 if no errors, or 1 if error occurred.
-     */
-    int generateSrc(Mappings map) {
-        try {
-            int index;
-            int block_size;
-            int roi_size;
-            long fp;
-            String outputDir = Main.getOutputDir();
-
-            /* If outputDir doesn't end with file-separator, adds it. */
-            if (!outputDir.endsWith(File.separator)) {
-                outputDir += File.separatorChar;
-            }
-
-            File outD = new File(outputDir);
-            outD.mkdirs();
-
-            /* Open ZoneInfoMapping file to write. */
-            RandomAccessFile raf =
-                new RandomAccessFile(outputDir + ZoneInfoFile.JAVAZM_FILE_NAME, "rw");
-
-            /* Whether rawOffsetIndex list exists or not. */
-            List roi = map.getRawOffsetsIndex();
-            if (roi == null) {
-                Main.panic("Data not exist. (rawOffsetsIndex)");
-                return 1;
-            }
-            roi_size = roi.size();
-
-            /* Whether rawOffsetIndexTable list exists or not. */
-            List> roit = map.getRawOffsetsIndexTable();
-            if (roit == null || roit.size() != roi_size) {
-                Main.panic("Data not exist. (rawOffsetsIndexTable) Otherwise, Invalid size");
-                return 1;
-            }
-
-            /* Output Label */
-            raf.write(ZoneInfoFile.JAVAZM_LABEL, 0,
-                      ZoneInfoFile.JAVAZM_LABEL.length);
-
-            /* Output Version */
-            raf.writeByte(ZoneInfoFile.JAVAZM_VERSION);
-
-            index = ZoneInfoFile.JAVAZM_LABEL.length + 2;
-
-            /* Output Version of Olson's tzdata */
-            byte[] b = Main.getVersionName().getBytes("UTF-8");
-            raf.writeByte(ZoneInfoFile.TAG_TZDataVersion);
-            raf.writeShort((b.length+1) & 0xFFFF);
-            raf.write(b);
-            raf.writeByte(0x00);
-            index += b.length + 4;
-
-            /* Output ID list. */
-            raf.writeByte(ZoneInfoFile.TAG_ZoneIDs);
-            block_size = 2;
-            raf.writeShort(block_size & 0xFFFF);
-            short nID = 0;
-            raf.writeShort(nID & 0xFFFF);
-            for (int i = 0; i < roi_size; i++) {
-                for (String key : roit.get(i)) {
-                    byte size = (byte)key.getBytes("UTF-8").length;
-                    raf.writeByte(size & 0xFF);
-                    raf.write(key.getBytes("UTF-8"), 0, size);
-                    block_size += 1 + size;
-                    nID++;
-                }
-            }
-            fp = raf.getFilePointer();
-            raf.seek(index);
-            raf.writeShort((block_size) & 0xFFFF);
-            raf.writeShort(nID & 0xFFFF);
-            raf.seek(fp);
-
-            /* Output sorted rawOffset list. */
-            raf.writeByte(ZoneInfoFile.TAG_RawOffsets);
-            index += 3 + block_size;
-            block_size = roi_size * 4;
-            raf.writeShort(block_size & 0xFFFF);
-            for (int i = 0; i < roi_size; i++) {
-                raf.writeInt(Integer.parseInt(roi.get(i).toString()));
-            }
-
-            /* Output sorted rawOffsetIndex list. */
-            raf.writeByte(ZoneInfoFile.TAG_RawOffsetIndices);
-            index += 3 + block_size;
-            block_size = 0;
-            raf.writeShort(block_size & 0xFFFF);
-            int num;
-            for (int i = 0; i < roi_size; i++) {
-                num = roit.get(i).size();
-                block_size += num;
-                for (int j = 0; j < num; j++) {
-                    raf.writeByte(i);
-                }
-            }
-            fp = raf.getFilePointer();
-            raf.seek(index);
-            raf.writeShort((block_size) & 0xFFFF);
-            raf.seek(fp);
-
-            /* Whether alias list exists or not. */
-            Map a = map.getAliases();
-            if (a == null) {
-                Main.panic("Data not exist. (aliases)");
-                return 0;
-            }
-
-            /* Output ID list. */
-            raf.writeByte(ZoneInfoFile.TAG_ZoneAliases);
-            index += 3 + block_size;
-            block_size = 2;
-            raf.writeShort(block_size & 0xFFFF);
-            raf.writeShort(a.size() & 0xFFFF);
-            for (String key : a.keySet()) {
-                String alias = a.get(key);
-                byte key_size = (byte)key.length();
-                byte alias_size = (byte)alias.length();
-                raf.writeByte(key_size & 0xFF);
-                raf.write(key.getBytes("UTF-8"), 0, key_size);
-                raf.writeByte(alias_size & 0xFF);
-                raf.write(alias.getBytes("UTF-8"), 0, alias_size);
-                block_size += 2 + key_size + alias_size;
-            }
-            fp = raf.getFilePointer();
-            raf.seek(index);
-            raf.writeShort((block_size) & 0xFFFF);
-            raf.seek(fp);
-
-            /* Output the exclude list if it exists. */
-            List excludedZones = map.getExcludeList();
-            if (excludedZones != null) {
-                raf.writeByte(ZoneInfoFile.TAG_ExcludedZones);
-                index += 3 + block_size;
-                block_size = 2;
-                raf.writeShort(block_size & 0xFFFF);  // place holder
-                raf.writeShort(excludedZones.size()); // the number of excluded zones
-                for (String name : excludedZones) {
-                    byte size = (byte) name.length();
-                    raf.writeByte(size);                 // byte length
-                    raf.write(name.getBytes("UTF-8"), 0, size); // zone name
-                    block_size += 1 + size;
-                }
-                fp = raf.getFilePointer();
-                raf.seek(index);
-                raf.writeShort(block_size & 0xFFFF);
-                raf.seek(fp);
-            }
-
-            /* Close ZoneInfoMapping file. */
-            raf.close();
-        } catch(IOException e) {
-            Main.panic("IO error: "+e.getMessage());
-            return 1;
-        }
-
-        return 0;
-    }
-}
diff --git a/test/jdk/sun/util/calendar/zi/GenDoc.java b/test/jdk/sun/util/calendar/zi/GenDoc.java
deleted file mode 100644
index e9e6ebc0cd8..00000000000
--- a/test/jdk/sun/util/calendar/zi/GenDoc.java
+++ /dev/null
@@ -1,776 +0,0 @@
-/*
- * Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
- * 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.
- *
- * 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.
- */
-
-import  java.io.BufferedReader;
-import  java.io.BufferedWriter;
-import  java.io.File;
-import  java.io.FileReader;
-import  java.io.FileWriter;
-import  java.io.IOException;
-import  java.util.Date;
-import  java.util.HashMap;
-import  java.util.List;
-import  java.util.Map;
-import  java.util.Set;
-import  java.util.SortedMap;
-import  java.util.StringTokenizer;
-import  java.util.TreeMap;
-import  java.util.TreeSet;
-
-/**
- * GenDoc is one of back-end classes of javazic, and generates
- * index.html and other html files which prints the detailed time zone
- * information for each zone.
- */
-class GenDoc extends BackEnd {
-
-    private static final String docDir = "doc";
-
-    private static final String header1 =
-        "\n" +
-        "\n\n\n\n" +
-        "Java Platform, Standard Edition - TimeZone information based on ";
-    private static final String header3 =
-        "-->\n<TITLE>\n" +
-        "Java Platform, Standard Edition  TimeZone - ";
-    private static final String header4 =
-        "\n" +
-        "\n\n";
-
-    private static final String body1 =
-        "\n";
-    private static final String body2 =
-        "\n";
-
-    private static final String footer =
-        "\n";
-
-
-    // list of time zone name and zonefile name/real time zone name
-    //   e.g.
-    //      key (String)       : value (String)
-    //      "America/Denver"   : "America/Denver.html" (real time zone)
-    //      "America/Shiprock" : "America/Denver"      (alias)
-    TreeMap timezoneList = new TreeMap();
-
-    // list of time zone's display name and time zone name
-    //   e.g.
-    //      key (String)                : value (String)
-    //      "Tokyo, Asia"               : "Asia/Tokyo"
-    //      "Marengo, Indiana, America" : "America/Indiana/Marengo"
-    //          (aliases included)
-    TreeMap displayNameList = new TreeMap();
-
-    // list of top level regions
-    //   e.g.
-    //      key (String) : value (String)
-    //      "America"    : "America.html"
-    //          (including entries in America/Indiana/, America/Kentucky/, ...)
-    TreeMap regionList = new TreeMap();
-
-    // mapping list from zone name to latitude & longitude
-    //   This list is generated from zone.tab.
-    //   e.g.
-    //      key (String) : value (LatitudeAndLongitude object)
-    //      "Asia/Tokyo" : latitude=35.3916, longitude=13.9444
-    //          (aliases not included)
-    HashMap mapList = null;
-
-    // SortedMap of zone IDs sorted by their GMT offsets. If zone's GMT
-    // offset will change in the future, its last known offset is
-    // used.
-    SortedMap> zonesByOffset = new TreeMap>();
-
-    /**
-     * Generates HTML document for each zone.
-     * @param Timezone
-     * @return 0 if no errors, or 1 if error occurred.
-     */
-    int processZoneinfo(Timezone tz) {
-        try {
-            int size;
-            int index;
-            String outputDir = Main.getOutputDir();
-            String zonename = tz.getName();
-            String zonefile = ZoneInfoFile.getFileName(zonename) + ".html";
-            List stz = tz.getLastRules();
-            timezoneList.put(zonename, zonefile);
-            displayNameList.put(transform(zonename), zonename);
-
-            // Populate zonesByOffset. (Zones that will change their
-            // GMT offsets are also added to zonesByOffset here.)
-            int lastKnownOffset = tz.getRawOffset();
-            Set set = zonesByOffset.get(lastKnownOffset);
-            if (set == null) {
-                set = new TreeSet();
-                zonesByOffset.put(lastKnownOffset, set);
-            }
-            set.add(zonename);
-
-            /* If outputDir doesn't end with file-separator, adds it. */
-            if (!outputDir.endsWith(File.separator)) {
-                outputDir += File.separatorChar;
-            }
-            outputDir += docDir + File.separatorChar;
-
-            index = zonename.indexOf('/');
-            if (index != -1) {
-                regionList.put(zonename.substring(0, index),
-                               zonename.substring(0, index) + ".html");
-            }
-
-            /* If zonefile includes file-separator, it's treated as part of
-             * pathname. And make directory if necessary.
-             */
-            index = zonefile.lastIndexOf('/');
-            if (index != -1) {
-                zonefile.replace('/', File.separatorChar);
-                outputDir += zonefile.substring(0, index+1);
-            }
-            File outD = new File(outputDir);
-            outD.mkdirs();
-
-            /* If mapfile is available, add a link to the appropriate map */
-            if (mapList == null && Main.getMapFile() != null) {
-                mapList = new HashMap();
-                FileReader fr = new FileReader(Main.getMapFile());
-                BufferedReader in = new BufferedReader(fr);
-                String line;
-                while ((line = in.readLine()) != null) {
-                    // skip blank and comment lines
-                    if (line.length() == 0 || line.charAt(0) == '#') {
-                        continue;
-                    }
-                    StringTokenizer tokens = new StringTokenizer(line);
-                    String token = tokens.nextToken();  /* We don't use the first token. */
-                    token = tokens.nextToken();
-                    LatitudeAndLongitude location = new LatitudeAndLongitude(token);
-                    token = tokens.nextToken();
-                    mapList.put(token, location);
-                }
-                in.close();
-            }
-
-            /* Open zoneinfo file to write. */
-            FileWriter fw = new FileWriter(outputDir + zonefile.substring(index+1));
-            BufferedWriter out = new BufferedWriter(fw);
-
-            out.write(header1 + new Date() + header3 + zonename + header4);
-            out.write(body1 + "" + zonename + "");
-            LatitudeAndLongitude location = (mapList != null ? mapList.get(zonename) : null);
-            if (location != null) {
-                int deg, min, sec;
-
-                deg = location.getLatDeg();
-                min = location.getLatMin();
-                sec = location.getLatSec();
-                if (deg < 0) {
-                    min = -min;
-                    sec = -sec;
-                } else if (min < 0) {
-                    sec = -sec;
-                }
-                out.write("   " +
-                          "[map]");
-            }
-            out.write("\n

\n"); - - List zone = tz.getZones(); - List rule = tz.getRules(); - if (rule != null && zone != null) { - out.write("\n" + - "\n" + - "\n" + - "\n" + - "\n

" + - "Rules
" + - "
Zone
\n"); - } - - /* Output Rule records. */ - if (rule != null) { - size = rule.size(); - out.write("

\n" + - "Rules\n" + - "\n" + - "\n" + - "" + - "" + - "\n\n"); - for (int i = 0; i < size; i++) { - out.write("\n"); - StringTokenizer st = new StringTokenizer(rule.get(i).getLine()); - String s; - if (st.hasMoreTokens()) { /* RULE - truncated */ - st.nextToken(); - } - if (st.hasMoreTokens()) { /* NAME */ - out.write(""); - } - if (st.hasMoreTokens()) { /* FROM */ - out.write(""); - } - if (st.hasMoreTokens()) { /* TO */ - s = st.nextToken(); - if (s.equals("min") || s.equals("max")) { - out.write(""); - } else { - out.write(""); - } - } - if (st.hasMoreTokens()) { /* TYPE */ - out.write(""); - } - if (st.hasMoreTokens()) { /* IN */ - out.write(""); - } - if (st.hasMoreTokens()) { /* ON */ - out.write(""); - } - if (st.hasMoreTokens()) { /* AT */ - out.write(""); - } - if (st.hasMoreTokens()) { /* SAVE */ - out.write(""); - } - if (st.hasMoreTokens()) { /* LETTER/S */ - out.write(""); - } - if (st.hasMoreTokens()) { /* NOTES */ - s = st.nextToken(); - while (st.hasMoreTokens()) { - s += " " + st.nextToken(); - } - index = s.indexOf('#'); - out.write("\n"); - } else { - out.write("\n"); - } - out.write("\n"); - } - out.write("
NAMEFROMTOTYPEINONATSAVELETTER/SNOTES
" + st.nextToken() + "" + st.nextToken() + "" + s + "" + s + "" + st.nextToken() + "" + st.nextToken() + "" + st.nextToken() + "" + st.nextToken() + "" + st.nextToken() + "" + st.nextToken() + "" + s.substring(index+1) + " 
\n

 

\n"); - } - - /* Output Zone records. */ - if (zone != null) { - size = zone.size(); - out.write("

\n" + - "Zone\n" + - "\n" + - "\n" + - "" + - "\n\n"); - for (int i = 0; i < size; i++) { - out.write("\n"); - StringTokenizer st = new StringTokenizer(zone.get(i).getLine()); - String s = st.nextToken(); - if (s.equals("Zone")) { /* NAME */ - s = st.nextToken(); - s = st.nextToken(); - } - out.write(""); /* GMTOFFSET */ - if (st.hasMoreTokens()) { /* RULES */ - out.write(""); - } - if (st.hasMoreTokens()) { /* FORMAT */ - s = st.nextToken(); - index = s.indexOf('#'); - if (index != -1) { - if (index != 0) { - out.write(""); /* FORMAT */ - s = s.substring(index+1); - } else { - out.write(""); /* FORMAT */ - } - while (st.hasMoreTokens()) { - s += " " + st.nextToken(); - } - out.write(""); /* UNTIL */ - out.write("\n\n"); /* NOTES */ - continue; - } else { - out.write(""); /* FORMAT */ - } - } - - if (st.hasMoreTokens()) { /* UNTIL */ - s = st.nextToken(); - while (st.hasMoreTokens()) { - s += " " + st.nextToken(); - } - index = s.indexOf('#'); - if (index != -1) { - if (index != 0) { - out.write(""); /* UNTIL */ - } else { - out.write(""); /* UNTIL */ - } - out.write("\n"); /* NOTES */ - } else { - out.write(""); /* UNTIL */ - out.write("\n"); /* NOTES */ - } - } else { - out.write(""); /* UNTIL */ - out.write("\n"); /* NOTES */ - } - out.write("\n"); - } - out.write("
GMTOFFRULESFORMATUNTILNOTES
" + s + "" + st.nextToken() + "" + s.substring(0, index-1) + - "  " + s + "
" + s + "" + s.substring(0, index-1) + - " " + s.substring(index+1) + - "" + s + "   
\n"); - } - out.write(body2 + footer); - - out.close(); - fw.close(); - } catch(IOException e) { - Main.panic("IO error: "+e.getMessage()); - return 1; - } - - return 0; - } - - /** - * Generates index.html and other top-level frame files. - * @param Mappings - * @return 0 if no errors, or 1 if error occurred. - */ - int generateSrc(Mappings map) { - try { - int len; - Object o[]; - String outputDir = Main.getOutputDir(); - FileWriter fw1, fw2; - BufferedWriter out1, out2; - - /* Whether alias list exists or not. */ - Map a = map.getAliases(); - if (a == null) { - Main.panic("Data not exist. (aliases)"); - return 1; - } - - timezoneList.putAll(a); - - /* If outputDir doesn't end with file-separator, adds it. */ - if (!outputDir.endsWith(File.separator)) { - outputDir += File.separatorChar; - } - outputDir += docDir + File.separatorChar; - - File outD = new File(outputDir); - outD.mkdirs(); - - /* Creates index.html */ - fw1 = new FileWriter(outputDir + "index.html", false); - out1 = new BufferedWriter(fw1); - - out1.write(header1 + new Date() + header2 + Main.getVersionName() + - header4 + - "\n" + - "\n" + - "\n" + - "\n" + - "" + - "\n" + - "\n" + - "\n" + - "<H2>\nFrame Alert\n</H2>\n\n" + - "<P>\n\n" + - "This document is designed to be viewed using the frames feature. If you see this\n" + - "message, you are using a non-frame-capable web client.\n" + - "<BR>\n" + - "Link to<A HREF=\"overview-summary.html\">Non-frame version.</A>\n" + - "\n" + footer); - - out1.close(); - fw1.close(); - - - /* Creates overview-frame.html */ - fw1 = new FileWriter(outputDir + "overview-frame.html", false); - out1 = new BufferedWriter(fw1); - - out1.write(header1 + new Date() + header2 + Main.getVersionName() + - header4 + body1 + - "\n\n" + - "\n" + - "\n
\n" + - "JavaTM Platform
Standard Ed.
\n\n" + - "\n\n\n
" + - "

\n\nAll Time Zones Sorted By:\n
\n" + - "  GMT offsets\n
\n" + - "  Zone names\n
" + - "  City names\n" + - "

\n\nContinents and Oceans\n
\n"); - - for (String regionKey : regionList.keySet()) { - out1.write("  " + regionKey + - "
\n"); - - fw2 = new FileWriter(outputDir + regionList.get(regionKey), - false); - out2 = new BufferedWriter(fw2); - - out2.write(header1 + new Date() + header3 + regionKey + - header4 + body1 + "" + - regionKey + "\n
\n\n\n\n\n
"); - - boolean found = false; - for (String timezoneKey : timezoneList.keySet()) { - int regionIndex = timezoneKey.indexOf('/'); - if (regionIndex == -1 || - !regionKey.equals(timezoneKey.substring(0, regionIndex))) { - if (found) { - break; - } else { - continue; - } - } - - found = true; - if (a.containsKey(timezoneKey)) { - Object realName = a.get(timezoneKey); - while (a.containsKey(realName)) { - realName = a.get(realName); - } - out2.write(timezoneKey + - " (alias for " + "" + - realName + ")"); - } else { - out2.write("" + timezoneKey + - ""); - } - out2.write("
\n"); - } - out2.write("
\n" + body2 + footer); - - out2.close(); - fw2.close(); - } - out1.write("

\n" + body2 + footer); - - out1.close(); - fw1.close(); - - - /* Creates allTimeZone-frame1.html (Sorted by GMT offsets) */ - fw1 = new FileWriter(outputDir + "allTimeZone-frame1.html", false); - out1 = new BufferedWriter(fw1); - - out1.write(header1 + new Date() + header2 + Main.getVersionName() + - header4 + body1 + - "Sorted by GMT offsets\n" + - "
\n\n" + "\n" + - "\n\n\n\n\n"); - } - } - out1.write("\n\n
\n"); - - List roi = map.getRawOffsetsIndex(); - List> roit = map.getRawOffsetsIndexTable(); - - int index = 0; - for (Integer offset : zonesByOffset.keySet()) { - int off = roi.get(index); - Set perRO = zonesByOffset.get(offset); - if (offset == off) { - // Merge aliases into zonesByOffset - perRO.addAll(roit.get(index)); - } - index++; - - for (String timezoneKey : perRO) { - out1.write("
(" + - Time.toGMTFormat(offset.toString()) + - ")"); - - if (a.containsKey(timezoneKey)) { - Object realName = a.get(timezoneKey); - while (a.containsKey(realName)) { - realName = a.get(realName); - } - out1.write(timezoneKey + - " (alias for " + "" + realName + - ")"); - } else { - out1.write("" + timezoneKey + - ""); - } - out1.write("
\n" + body2 + footer); - - out1.close(); - fw1.close(); - - - /* Creates allTimeZone-frame2.html (Sorted by zone names) */ - fw1 = new FileWriter(outputDir + "allTimeZone-frame2.html", false); - out1 = new BufferedWriter(fw1); - - out1.write(header1 + new Date() + header2 + Main.getVersionName() + - header4 + body1 + - "Sorted by zone names\n" + - "
\n\n" + "\n" + - "\n\n\n
\n"); - o = timezoneList.keySet().toArray(); - len = timezoneList.size(); - for (int i = 0; i < len; i++) { - Object timezoneKey = o[i]; - if (a.containsKey(timezoneKey)) { - Object realName = a.get(timezoneKey); - while (a.containsKey(realName)) { - realName = a.get(realName); - } - out1.write(timezoneKey + - " (alias for " + - "" + realName + - ")"); - } else { - out1.write("" + timezoneKey + - ""); - } - out1.write("
\n"); - } - out1.write("
\n" + body2 + footer); - - out1.close(); - fw1.close(); - - /* Creates allTimeZone-frame3.html (Sorted by city names) */ - fw1 = new FileWriter(outputDir + "allTimeZone-frame3.html", false); - out1 = new BufferedWriter(fw1); - - out1.write(header1 + new Date() + header2 + Main.getVersionName() + - header4 + body1 + - "Sorted by city names\n" + - "
\n\n" + "\n" + - "\n\n\n
\n"); - - Set aliasSet = a.keySet(); - len = aliasSet.size(); - String aliasNames[] = aliasSet.toArray(new String[0]); - for (int i = 0; i < len; i++) { - displayNameList.put(transform(aliasNames[i]), - aliasNames[i]); - } - - o = displayNameList.keySet().toArray(); - len = displayNameList.size(); - for (int i = 0; i < len; i++) { - Object displayName = o[i]; - Object timezoneKey = displayNameList.get(o[i]); - if (a.containsKey(timezoneKey)) { - Object realName = a.get(timezoneKey); - while (a.containsKey(realName)) { - realName = a.get(realName); - } - out1.write(displayName + - " (alias for " + - "" + realName + - ")"); - } else { - out1.write("" + displayName + - ""); - } - out1.write("
\n"); - } - - out1.write("
\n" + body2 + footer); - - out1.close(); - fw1.close(); - - /* Creates overview-summary.html */ - fw1 = new FileWriter(outputDir + "overview-summary.html", false); - out1 = new BufferedWriter(fw1); - - out1.write(header1 + new Date() + header2 + Main.getVersionName() + - header4 + body1 + - "

This is the list of time zones generated from " + - Main.getVersionName() + " for Java Platform, " + - "Standard Edition. The source code can be obtained " + - "from ftp site " + - "ftp://elsie.nci.nih.gov/pub/. A total of " + - len + - " time zones and aliases are supported " + - "in this edition. For the " + - "format of rules and zones, refer to the zic " + - "(zoneinfo compiler) man page on " + - "Solaris or Linux.

\n" + - "

Note that the time zone data is not " + - "a public interface of the Java Platform. No " + - "applications should rely on the time zone data of " + - "this document. Time zone names and data " + - "may change without any prior notice.

\n" + - body2 + footer); - - out1.close(); - fw1.close(); - } catch(IOException e) { - Main.panic("IO error: "+e.getMessage()); - return 1; - } - - return 0; - } - - String transform(String s) { - int index = s.lastIndexOf("/"); - - /* If the string doesn't include any delimiter, return */ - if (index == -1) { - return s; - } - - int lastIndex = index; - String str = s.substring(index+1); - do { - index = s.substring(0, lastIndex).lastIndexOf('/'); - str += ", " + s.substring(index+1, lastIndex); - lastIndex = index; - } while (index > -1); - - return str; - } - - static class LatitudeAndLongitude { - - private int latDeg, latMin, latSec, longDeg, longMin, longSec; - - LatitudeAndLongitude(String s) { - try { - // First of all, check the string has the correct format: - // either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS - - if (!s.startsWith("+") && !s.startsWith("-")) { - Main.warning("Wrong latitude&longitude data: " + s); - return; - } - int index; - if (((index = s.lastIndexOf("+")) <= 0) && - ((index = s.lastIndexOf("-")) <= 0)) { - Main.warning("Wrong latitude&longitude data: " + s); - return; - } - - if (index == 5) { - latDeg = Integer.parseInt(s.substring(1, 3)); - latMin = Integer.parseInt(s.substring(3, 5)); - latSec = 0; - } else if (index == 7) { - latDeg = Integer.parseInt(s.substring(1, 3)); - latMin = Integer.parseInt(s.substring(3, 5)); - latSec = Integer.parseInt(s.substring(5, 7)); - } else { - Main.warning("Wrong latitude&longitude data: " + s); - return; - } - if (s.startsWith("-")){ - latDeg = -latDeg; - latMin = -latMin; - latSec = -latSec; - } - - int len = s.length(); - if (index == 5 && len == 11) { - longDeg = Integer.parseInt(s.substring(index+1, index+4)); - longMin = Integer.parseInt(s.substring(index+4, index+6)); - longSec = 0; - } else if (index == 7 && len == 15) { - longDeg = Integer.parseInt(s.substring(index+1, index+4)); - longMin = Integer.parseInt(s.substring(index+4, index+6)); - longSec = Integer.parseInt(s.substring(index+6, index+8)); - } else { - Main.warning("Wrong latitude&longitude data: " + s); - return; - } - if (s.charAt(index) == '-'){ - longDeg = -longDeg; - longMin = -longMin; - longSec = -longSec; - } - } catch(Exception e) { - Main.warning("LatitudeAndLongitude() Parse error: " + s); - } - } - - int getLatDeg() { - return latDeg; - } - - int getLatMin() { - return latMin; - } - - int getLatSec() { - return latSec; - } - - int getLongDeg() { - return longDeg; - } - - int getLongMin() { - return longMin; - } - - int getLongSec() { - return longSec; - } - } -} diff --git a/test/jdk/sun/util/calendar/zi/Main.java b/test/jdk/sun/util/calendar/zi/Main.java deleted file mode 100644 index 8078d7e2425..00000000000 --- a/test/jdk/sun/util/calendar/zi/Main.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.util.ArrayList; -import java.util.List; - -/** - * Main class for the javazic time zone data compiler. - * - * @since 1.4 - */ -public class Main { - - private static boolean verbose = false; - static boolean outputDoc = false; - - private List ziFiles = new ArrayList(); - private static String zoneNamesFile = null; - private static String versionName = "unknown"; - private static String outputDir = "zoneinfo"; - private static String mapFile = null; - - /** - * Parses the specified arguments and sets up the variables. - * @param argv the arguments - */ - void processArgs(String[] argv) { - for (int i = 0; i < argv.length; i++) { - String arg = argv[i]; - if (arg.startsWith("-h")) { - usage(); - System.exit(0); - } else if (arg.equals("-d")) { - outputDir = argv[++i]; - } else if (arg.equals("-v")) { - verbose = true; - } else if (arg.equals("-V")) { - versionName = argv[++i]; - } else if (arg.equals("-doc")) { - outputDoc = true; - } else if (arg.equals("-map")) { - outputDoc = true; - mapFile = argv[++i]; - } else if (arg.equals("-f")) { - zoneNamesFile = argv[++i]; - } else if (arg.equals("-S")) { - try { - Zoneinfo.setYear(Integer.parseInt(argv[++i])); - } catch (Exception e) { - error("invalid year: " + argv[i]); - usage(); - System.exit(1); - } - } else { - boolean isStartYear = arg.equals("-s"); - if (isStartYear || arg.equals("-e")) { - try { - int year = Integer.parseInt(argv[++i]); - if (isStartYear) { - Zoneinfo.setStartYear(year); - } else { - Zoneinfo.setEndYear(year); - } - } catch (Exception e) { - error("invalid year: " + argv[i]); - usage(); - System.exit(1); - } - } else { - // the rest of args are zoneinfo source files - while (i < argv.length) { - ziFiles.add(argv[i++]); - } - } - } - } - } - - /** - * Parses zoneinfo source files - */ - int compile() { - int nFiles = ziFiles.size(); - int status = 0; - Mappings maps = new Mappings(); - BackEnd backend = BackEnd.getBackEnd(); - - for (int i = 0; i < nFiles; i++) { - Zoneinfo frontend = Zoneinfo.parse(ziFiles.get(i)); - - for (String key : frontend.getZones().keySet()) { - info(key); - - Timezone tz = frontend.phase2(key); - status |= backend.processZoneinfo(tz); - } - - maps.add(frontend); - } - - // special code for dealing with the conflicting name "MET" - Zone.addMET(); - - maps.resolve(); - - status |= backend.generateSrc(maps); - - return status; - } - - public static void main(String[] argv) { - Main zic = new Main(); - - /* - * Parse args - */ - zic.processArgs(argv); - - /* - * Read target zone names - */ - if (zoneNamesFile != null) { - Zone.readZoneNames(zoneNamesFile); - } - - zic.compile(); - } - - void usage() { - System.err.println("Usage: javazic [options] file...\n"+ - " -f namefile file containing zone names\n"+ - " to be generated (ie, generating subset)\n"+ - " -d dir output directory\n"+ - " -v verbose\n"+ - " -V datavers specifies the tzdata version string\n"+ - " (eg, \"tzdata2000g\")"+ - " -S year output only SimleTimeZone data of that year\n"+ - " -s year start year (default: 1900)\n"+ - " -e year end year (default: 2037)\n"+ - " -doc generates HTML documents\n"+ - " -map mapfile generates HTML documents with map information\n"+ - " file... zoneinfo source file(s)"); - } - - /** - * @return the output directory path name - */ - static String getOutputDir() { - return outputDir; - } - - /** - * @return the map file's path and name - */ - static String getMapFile() { - return mapFile; - } - - /** - * Returns the time zone data version string specified by the -V - * option. If it is not specified, "unknown" is returned. - * @return the time zone data version string - */ - static String getVersionName() { - return versionName; - } - - /** - * Prints out the specified fatal error message and calls {@link - * java.lang.System#exit System.exit(1)}. - * @param msg the fatal error message - */ - static void panic(String msg) { - printMessage("fatal error", msg); - System.exit(1); - } - - /** - * Prints out the specified error message. - * @param msg the error message - */ - static void error(String msg) { - printMessage("error", msg); - } - - /** - * Prints out the specified warning message. - * @param msg the warning message - */ - static void warning(String msg) { - printMessage("warning", msg); - } - - /** - * Prints out the informative message. - * @param msg the informative message - */ - static void info(String msg) { - if (verbose) { - printMessage(null, msg); - } - } - - private static void printMessage(String type, String msg) { - if (type != null) { - type += ": "; - } else { - type = ""; - } - System.err.println("javazic: " + type + msg); - } -} diff --git a/test/jdk/sun/util/calendar/zi/Mappings.java b/test/jdk/sun/util/calendar/zi/Mappings.java deleted file mode 100644 index 582a9509a51..00000000000 --- a/test/jdk/sun/util/calendar/zi/Mappings.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -/** - * Mappings generates two Maps and a List which are used by - * javazic BackEnd. - * - * @since 1.4 - */ -class Mappings { - // All aliases specified by Link statements. It's alias name to - // real name mappings. - private Map aliases; - - private List rawOffsetsIndex; - - private List> rawOffsetsIndexTable; - - // Zone names to be excluded from rawOffset table. Those have GMT - // offsets to change some future time. - private List excludeList; - - /** - * Constructor creates some necessary instances. - */ - Mappings() { - aliases = new TreeMap(); - rawOffsetsIndex = new LinkedList(); - rawOffsetsIndexTable = new LinkedList>(); - } - - /** - * Generates aliases and rawOffsets tables. - * @param zi a Zoneinfo containing Zones - */ - void add(Zoneinfo zi) { - Map zones = zi.getZones(); - - for (String zoneName : zones.keySet()) { - Zone zone = zones.get(zoneName); - String zonename = zone.getName(); - int rawOffset = zone.get(zone.size()-1).getGmtOffset(); - - // If the GMT offset of this Zone will change in some - // future time, this Zone is added to the exclude list. - boolean isExcluded = false; - for (int i = 0; i < zone.size(); i++) { - ZoneRec zrec = zone.get(i); - if ((zrec.getGmtOffset() != rawOffset) - && (zrec.getUntilTime(0) > Time.getCurrentTime())) { - if (excludeList == null) { - excludeList = new ArrayList(); - } - excludeList.add(zone.getName()); - isExcluded = true; - break; - } - } - - if (!rawOffsetsIndex.contains(new Integer(rawOffset))) { - // Find the index to insert this raw offset zones - int n = rawOffsetsIndex.size(); - int i; - for (i = 0; i < n; i++) { - if (rawOffsetsIndex.get(i) > rawOffset) { - break; - } - } - rawOffsetsIndex.add(i, rawOffset); - - Set perRawOffset = new TreeSet(); - if (!isExcluded) { - perRawOffset.add(zonename); - } - rawOffsetsIndexTable.add(i, perRawOffset); - } else if (!isExcluded) { - int i = rawOffsetsIndex.indexOf(new Integer(rawOffset)); - Set perRawOffset = rawOffsetsIndexTable.get(i); - perRawOffset.add(zonename); - } - } - - Map a = zi.getAliases(); - // If there are time zone names which refer to any of the - // excluded zones, add those names to the excluded list. - if (excludeList != null) { - for (String zoneName : a.keySet()) { - String realname = a.get(zoneName); - if (excludeList.contains(realname)) { - excludeList.add(zoneName); - } - } - } - aliases.putAll(a); - } - - /** - * Adds valid aliases to one of per-RawOffset table and removes - * invalid aliases from aliases List. Aliases referring to - * excluded zones are not added to a per-RawOffset table. - */ - void resolve() { - int index = rawOffsetsIndexTable.size(); - List toBeRemoved = new ArrayList(); - for (String key : aliases.keySet()) { - boolean validname = false; - for (int j = 0; j < index; j++) { - Set perRO = rawOffsetsIndexTable.get(j); - boolean isExcluded = (excludeList == null) ? - false : excludeList.contains(key); - - if ((perRO.contains(aliases.get(key)) || isExcluded) - && Zone.isTargetZone(key)) { - validname = true; - if (!isExcluded) { - perRO.add(key); - Main.info("Alias <"+key+"> added to the list."); - } - break; - } - } - - if (!validname) { - Main.info("Alias <"+key+"> removed from the list."); - toBeRemoved.add(key); - } - } - - // Remove zones, if any, from the list. - for (String key : toBeRemoved) { - aliases.remove(key); - } - // Eliminate any alias-to-alias mappings. For example, if - // there are A->B and B->C, A->B is changed to A->C. - Map newMap = new HashMap(); - for (String key : aliases.keySet()) { - String realid = aliases.get(key); - String leaf = realid; - while (aliases.get(leaf) != null) { - leaf = aliases.get(leaf); - } - if (!realid.equals(leaf)) { - newMap.put(key, leaf); - } - } - aliases.putAll(newMap); - } - - Map getAliases() { - return(aliases); - } - - List getRawOffsetsIndex() { - return(rawOffsetsIndex); - } - - List> getRawOffsetsIndexTable() { - return(rawOffsetsIndexTable); - } - - List getExcludeList() { - return excludeList; - } -} diff --git a/test/jdk/sun/util/calendar/zi/Month.java b/test/jdk/sun/util/calendar/zi/Month.java deleted file mode 100644 index bab909f7637..00000000000 --- a/test/jdk/sun/util/calendar/zi/Month.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -/** - * Month enum handles month related manipulation. - * - * @since 1.4 - */ -enum Month { - JANUARY("Jan"), - FEBRUARY("Feb"), - MARCH("Mar"), - APRIL("Apr"), - MAY("May"), - JUNE("Jun"), - JULY("Jul"), - AUGUST("Aug"), - SEPTEMBER("Sep"), - OCTOBER("Oct"), - NOVEMBER("Nov"), - DECEMBER("Dec"); - - private final String abbr; - - private Month(String abbr) { - this.abbr = abbr; - } - - int value() { - return ordinal() + 1; - } - - /** - * Parses the specified string as a month abbreviation. - * @param name the month abbreviation - * @return the Month value - */ - static Month parse(String name) { - int len = name.length(); - - if (name.regionMatches(true, 0, "January", 0, len)) return Month.JANUARY; - if (name.regionMatches(true, 0, "February", 0, len)) return Month.FEBRUARY; - if (name.regionMatches(true, 0, "March", 0, len)) return Month.MARCH; - if (name.regionMatches(true, 0, "April", 0, len)) return Month.APRIL; - if (name.regionMatches(true, 0, "May", 0, len)) return Month.MAY; - if (name.regionMatches(true, 0, "June", 0, len)) return Month.JUNE; - if (name.regionMatches(true, 0, "July", 0, len)) return Month.JULY; - if (name.regionMatches(true, 0, "August", 0, len)) return Month.AUGUST; - if (name.regionMatches(true, 0, "September", 0, len)) return Month.SEPTEMBER; - if (name.regionMatches(true, 0, "October", 0, len)) return Month.OCTOBER; - if (name.regionMatches(true, 0, "November", 0, len)) return Month.NOVEMBER; - if (name.regionMatches(true, 0, "December", 0, len)) return Month.DECEMBER; - - throw new IllegalArgumentException("Unknown month: " + name); - } - - /** - * @param month the nunmth number (1-based) - * @return the month name in uppercase of the specified month - */ - static String toString(int month) { - if (month >= JANUARY.value() && month <= DECEMBER.value()) { - return "Calendar." + Month.values()[month - 1]; - } - throw new IllegalArgumentException("wrong month number: " + month); - } -} diff --git a/test/jdk/sun/util/calendar/zi/Rule.java b/test/jdk/sun/util/calendar/zi/Rule.java deleted file mode 100644 index 3098dc7e766..00000000000 --- a/test/jdk/sun/util/calendar/zi/Rule.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.StringTokenizer; - -/** - * Rule manipulates Rule records. - * - * @since 1.4 - */ -class Rule { - - private List list; - private String name; - - /** - * Constructs a Rule which consists of a Rule record list. The - * specified name is given to this Rule. - * @param name the Rule name - */ - Rule(String name) { - this.name = name; - list = new ArrayList(); - } - - /** - * Added a RuleRec to the Rule record list. - */ - void add(RuleRec rec) { - list.add(rec); - } - - /** - * @return the Rule name - */ - String getName() { - return name; - } - - /** - * Gets all rule records that cover the given year. - * - * @param year the year number for which the rule is applicable. - * @return rules in List that are collated in time. If no rule is found, an empty - * List is returned. - */ - List getRules(int year) { - List rules = new ArrayList(3); - for (RuleRec rec : list) { - if (year >= rec.getFromYear() && year <= rec.getToYear()) { - if ((rec.isOdd() && year % 2 == 0) || (rec.isEven() && year % 2 == 1)) - continue; - rules.add(rec); - } - } - int n = rules.size(); - if (n <= 1) { - return rules; - } - if (n == 2) { - RuleRec rec1 = rules.get(0); - RuleRec rec2 = rules.get(1); - if (rec1.getMonthNum() > rec2.getMonthNum()) { - rules.set(0, rec2); - rules.set(1, rec1); - } else if (rec1.getMonthNum() == rec2.getMonthNum()) { - // TODO: it's not accurate to ignore time types (STD, WALL, UTC) - long t1 = Time.getLocalTime(year, rec1.getMonth(), - rec1.getDay(), rec1.getTime().getTime()); - long t2 = Time.getLocalTime(year, rec2.getMonth(), - rec2.getDay(), rec2.getTime().getTime()); - if (t1 > t2) { - rules.set(0, rec2); - rules.set(1, rec1); - } - } - return rules; - } - - final int y = year; - RuleRec[] recs = new RuleRec[rules.size()]; - rules.toArray(recs); - - Arrays.sort(recs, new Comparator() { - public int compare(RuleRec r1, RuleRec r2) { - int n = r1.getMonthNum() - r2.getMonthNum(); - if (n != 0) { - return n; - } - // TODO: it's not accurate to ignore time types (STD, WALL, UTC) - long t1 = Time.getLocalTime(y, r1.getMonth(), - r1.getDay(), r1.getTime().getTime()); - long t2 = Time.getLocalTime(y, r2.getMonth(), - r2.getDay(), r2.getTime().getTime()); - return Long.compare(t1, t2); - } - public boolean equals(Object o) { - return this == o; - } - }); - rules.clear(); - for (int i = 0; i < n; i++) { - if (i != 0 && recs[i -1].getSave() == recs[i].getSave()) { - // we have two recs back to back with same saving for the same year. - if (recs[i].isLastRule()) { - continue; - } else if (recs[i - 1].isLastRule()) { - rules.remove(rules.size() - 1); - } - } - rules.add(recs[i]); - } - return rules; - } - - /** - * Gets rule records that have either "max" or cover the endYear - * value in its DST schedule. - * - * @return rules that contain last DST schedule. An empty - * ArrayList is returned if no last rules are found. - */ - List getLastRules() { - RuleRec start = null; - RuleRec end = null; - - for (int i = 0; i < list.size(); i++) { - RuleRec rec = list.get(i); - if (rec.isLastRule()) { - if (rec.getSave() > 0) { - start = rec; - } else { - end = rec; - } - } - } - if (start == null || end == null) { - int endYear = Zoneinfo.getEndYear(); - for (int i = 0; i < list.size(); i++) { - RuleRec rec = list.get(i); - if (endYear >= rec.getFromYear() && endYear <= rec.getToYear()) { - if (start == null && rec.getSave() > 0) { - start = rec; - } else { - if (end == null && rec.getSave() == 0) { - end = rec; - } - } - } - } - } - - List r = new ArrayList(2); - if (start == null || end == null) { - if (start != null || end != null) { - Main.warning("found last rules for "+name+" inconsistent."); - } - return r; - } - - r.add(start); - r.add(end); - return r; - } -} diff --git a/test/jdk/sun/util/calendar/zi/RuleDay.java b/test/jdk/sun/util/calendar/zi/RuleDay.java deleted file mode 100644 index 9cd81c1e524..00000000000 --- a/test/jdk/sun/util/calendar/zi/RuleDay.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -/** - * RuleDay class represents the value of the "ON" field. The day of - * week values start from 1 following the {@link java.util.Calendar} - * convention. - * - * @since 1.4 - */ -class RuleDay { - private String dayName = null; - private DayOfWeek dow; - private boolean lastOne = false; - private int soonerOrLater = 0; - private int thanDayOfMonth; // day of month (e.g., 8 for "Sun>=8") - - RuleDay() { - } - - RuleDay(int day) { - thanDayOfMonth = day; - } - - int getDay() { - return thanDayOfMonth; - } - - /** - * @return the day of week value (1-based) - */ - int getDayOfWeekNum() { - return dow.value(); - } - - /** - * @return true if this rule day represents the last day of - * week. (e.g., lastSun). - */ - boolean isLast() { - return lastOne; - } - - /** - * @return true if this rule day represents the day of week on or - * later than (after) the {@link #getDay}. (e.g., Sun>=1) - */ - boolean isLater() { - return soonerOrLater > 0; - } - - /** - * @return true if this rule day represents the day of week on or - * earlier than (before) the {@link #getDay}. (e.g., Sun<=15) - */ - boolean isEarlier() { - return soonerOrLater < 0; - } - - /** - * @return true if this rule day represents an exact day. - */ - boolean isExact() { - return soonerOrLater == 0; - } - - /** - * Parses the "ON" field and constructs a RuleDay. - * @param day an "ON" field string (e.g., "Sun>=1") - * @return a RuleDay representing the given "ON" field - */ - static RuleDay parse(String day) { - RuleDay d = new RuleDay(); - if (day.startsWith("last")) { - d.lastOne = true; - d.dayName = day.substring(4); - d.dow = getDOW(d.dayName); - } else { - int index; - if ((index = day.indexOf(">=")) != -1) { - d.dayName = day.substring(0, index); - d.dow = getDOW(d.dayName); - d.soonerOrLater = 1; // greater or equal - d.thanDayOfMonth = Integer.parseInt(day.substring(index+2)); - } else if ((index = day.indexOf("<=")) != -1) { - d.dayName = day.substring(0, index); - d.dow = getDOW(d.dayName); - d.soonerOrLater = -1; // less or equal - d.thanDayOfMonth = Integer.parseInt(day.substring(index+2)); - } else { - // it should be an integer value. - d.thanDayOfMonth = Integer.parseInt(day); - } - } - return d; - } - - /** - * Converts this RuleDay to the SimpleTimeZone day rule. - * @return the converted SimpleTimeZone day rule - */ - int getDayForSimpleTimeZone() { - if (isLast()) { - return -1; - } - return isEarlier() ? -getDay() : getDay(); - } - - /** - * Converts this RuleDay to the SimpleTimeZone day-of-week rule. - * @return the SimpleTimeZone day-of-week rule value - */ - int getDayOfWeekForSimpleTimeZoneInt() { - if (isEarlier() || isLater()) { - return -getDayOfWeekNum(); - } - return isLast() ? getDayOfWeekNum() : 0; - } - - /** - * @return the string representation of the {@link - * #getDayOfWeekForSimpleTimeZoneInt} value - */ - String getDayOfWeekForSimpleTimeZone() { - int d = getDayOfWeekForSimpleTimeZoneInt(); - if (d == 0) { - return "0"; - } - String sign = ""; - if (d < 0) { - sign = "-"; - d = -d; - } - return sign + toString(d); - } - - private static DayOfWeek getDOW(String name) { - int len = name.length(); - - if (name.regionMatches(true, 0, "Monday", 0, len)) return DayOfWeek.MONDAY; - if (name.regionMatches(true, 0, "Tuesday", 0, len)) return DayOfWeek.TUESDAY; - if (name.regionMatches(true, 0, "Wednesday", 0, len)) return DayOfWeek.WEDNESDAY; - if (name.regionMatches(true, 0, "Thursday", 0, len)) return DayOfWeek.THURSDAY; - if (name.regionMatches(true, 0, "Friday", 0, len)) return DayOfWeek.FRIDAY; - if (name.regionMatches(true, 0, "Saturday", 0, len)) return DayOfWeek.SATURDAY; - if (name.regionMatches(true, 0, "Sunday", 0, len)) return DayOfWeek.SUNDAY; - - throw new IllegalArgumentException("Unknown day-of-week: " + name); - } - - /** - * Converts the specified day of week value to the day-of-week - * name defined in {@link java.util.Calendar}. - * @param dow 1-based day of week value - * @return the Calendar day of week name with "Calendar." prefix. - * @throws IllegalArgumentException if the specified dow value is out of range. - */ - static String toString(int dow) { - if (dow >= DayOfWeek.SUNDAY.value() && dow <= DayOfWeek.SATURDAY.value()) { - return "Calendar." + DayOfWeek.values()[dow - 1]; - } - throw new IllegalArgumentException("wrong Day_of_Week number: " + dow); - } -} diff --git a/test/jdk/sun/util/calendar/zi/RuleRec.java b/test/jdk/sun/util/calendar/zi/RuleRec.java deleted file mode 100644 index e6e18773d16..00000000000 --- a/test/jdk/sun/util/calendar/zi/RuleRec.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.util.StringTokenizer; - -/** - * RuleRec class represents one record of the Rule set. - * - * @since 1.4 - */ -class RuleRec { - private int fromYear; - private int toYear; - private String type; - private Month inMonth; - private RuleDay onDay; - private Time atTime; - private int save; - private String letters; - private String line; - private boolean isLastRule; - - int getFromYear() { - return fromYear; - } - - int getToYear() { - return toYear; - } - - Month getMonth() { - return inMonth; - } - - int getMonthNum() { - return inMonth.value(); - } - - RuleDay getDay() { - return onDay; - } - - Time getTime() { - return atTime; - } - - int getSave() { - return save; - } - - String getLine() { - return line; - } - - /** - * Sets the line from the text file. - * @param line the text of the line - */ - void setLine(String line) { - this.line = line; - } - - /** - * @return true if the rule type is "odd". - */ - boolean isOdd() { - return "odd".equals(type); - } - - /** - * @return true if the rule type is "even". - */ - boolean isEven() { - return "even".equals(type); - } - - /** - * Determines if this rule record is the last DST schedule rule. - * - * @return true if this rule record has "max" as TO (year). - */ - boolean isLastRule() { - return isLastRule; - } - - /** - * Determines if the unadjusted until time of the specified ZoneRec - * is the same as the transition time of this rule in the same - * year as the ZoneRec until year. - * - * @param zrec ZoneRec to compare to - * @param save the amount of daylight saving in milliseconds - * @param gmtOffset the GMT offset value in milliseconds - * @return true if the unadjusted until time is the same as rule's - * transition time. - */ - boolean isSameTransition(ZoneRec zrec, int save, int gmtOffset) { - long until, transition; - - if (zrec.getUntilTime().getType() != atTime.getType()) { - until = zrec.getLocalUntilTime(save, gmtOffset); - transition = Time.getLocalTime(zrec.getUntilYear(), - getMonth(), - getDay(), - save, - gmtOffset, - atTime); - } else { - until = zrec.getLocalUntilTime(); - transition = Time.getLocalTime(zrec.getUntilYear(), - getMonth(), - getDay(), - atTime.getTime()); - } - - return until == transition; - } - - /** - * Parses a Rule line and returns a RuleRec object. - * - * @param tokens a StringTokenizer object that should contain a - * token for the "FROM" field and the rest. - * @return a RuleRec object. - */ - static RuleRec parse(StringTokenizer tokens) { - RuleRec rec = new RuleRec(); - try { - // FROM - String token = tokens.nextToken(); - try { - rec.fromYear = Integer.parseInt(token); - } catch (NumberFormatException e) { - // it's not integer - if ("min".equals(token) || "minimum".equals(token)) { - rec.fromYear = Zoneinfo.getMinYear(); - } else if ("max".equals(token) || "maximum".equals(token)) { - rec.fromYear = Zoneinfo.getMaxYear(); - } else { - Main.panic("invalid year value: "+token); - } - } - - // TO - token = tokens.nextToken(); - rec.isLastRule = false; - try { - rec.toYear = Integer.parseInt(token); - } catch (NumberFormatException e) { - // it's not integer - int len = token.length(); - if (token.regionMatches(true, 0, "minimum", 0, len)) { - rec.fromYear = Zoneinfo.getMinYear(); - } else if (token.regionMatches(true, 0, "maximum", 0, len)) { - rec.toYear = Integer.MAX_VALUE; - rec.isLastRule = true; - } else if (token.regionMatches(true, 0, "only", 0, len)) { - rec.toYear = rec.fromYear; - } else { - Main.panic("invalid year value: "+token); - } - } - - // TYPE - rec.type = tokens.nextToken(); - - // IN - rec.inMonth = Month.parse(tokens.nextToken()); - - // ON - rec.onDay = RuleDay.parse(tokens.nextToken()); - - // AT - rec.atTime = Time.parse(tokens.nextToken()); - - // SAVE - rec.save = (int) Time.parse(tokens.nextToken()).getTime(); - - // LETTER/S - rec.letters = tokens.nextToken(); - } catch (Exception e) { - e.printStackTrace(); - } - return rec; - } - - /** - * Calculates the transition time of the given year under this rule. - * @param year the year value - * @param gmtOffset the GMT offset value in milliseconds - * @param save the amount of daylight save time - * @return the transition time in milliseconds of the given year in UTC. - */ - long getTransitionTime(int year, int gmtOffset, int save) { - long time = Time.getLocalTime(year, getMonth(), - getDay(), atTime.getTime()); - if (atTime.isSTD()) { - time -= gmtOffset; - } else if (atTime.isWall()) { - time -= gmtOffset + save; - } - return time; - } - - private static int getInt(StringTokenizer tokens) { - String token = tokens.nextToken(); - return Integer.parseInt(token); - } -} diff --git a/test/jdk/sun/util/calendar/zi/Simple.java b/test/jdk/sun/util/calendar/zi/Simple.java deleted file mode 100644 index 0889155a99e..00000000000 --- a/test/jdk/sun/util/calendar/zi/Simple.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.TreeMap; -import java.util.TreeSet; - -/** - * Simple generates TimeZoneData, which had been used as internal - * data of TimeZone before J2SDK1.3. - * Since J2SDK1.4 doesn't need TimeZoneData, this class is for maintenance - * of old JDK release. - */ -class Simple extends BackEnd { - - /** - * Zone records which are applied for given year. - */ - private static Map lastZoneRecs = new HashMap<>(); - - /** - * Rule records which are applied for given year. - */ - private static Map> lastRules = new TreeMap<>(); - - /** - * zone IDs sorted by their GMT offsets. If zone's GMT - * offset will change in the future, its last known offset is - * used. - */ - private SortedMap> zonesByOffset = new TreeMap<>(); - - /** - * Sets last Rule records and Zone records for given timezone to - * each Map. - * - * @param tz Timezone object for each zone - * @return always 0 - */ - int processZoneinfo(Timezone tz) { - String zonename = tz.getName(); - - lastRules.put(zonename, tz.getLastRules()); - lastZoneRecs.put(zonename, tz.getLastZoneRec()); - - // Populate zonesByOffset. (Zones that will change their - // GMT offsets are also added to zonesByOffset here.) - int lastKnownOffset = tz.getRawOffset(); - Set set = zonesByOffset.get(lastKnownOffset); - if (set == null) { - set = new TreeSet<>(); - zonesByOffset.put(lastKnownOffset, set); - } - set.add(zonename); - - return 0; - } - - /** - * Generates TimeZoneData to output SimpleTimeZone data. - * @param map Mappings object which is generated by {@link Main#compile}. - * @return 0 if no error occurred, otherwise 1. - */ - int generateSrc(Mappings map) { - try { - File outD = new File(Main.getOutputDir()); - outD.mkdirs(); - - FileWriter fw = - new FileWriter(new File(outD, "TimeZoneData.java"), false); - BufferedWriter out = new BufferedWriter(fw); - - out.write("import java.util.SimpleTimeZone;\n\n"); - out.write(" static SimpleTimeZone zones[] = {\n"); - - Map a = map.getAliases(); - List roi = map.getRawOffsetsIndex(); - List> roit = map.getRawOffsetsIndexTable(); - - int index = 0; - for (int offset : zonesByOffset.keySet()) { - int o = roi.get(index); - Set set = zonesByOffset.get(offset); - if (offset == o) { - // Merge aliases into zonesByOffset - set.addAll(roit.get(index)); - } - index++; - - for (String key : set) { - ZoneRec zrec; - String realname; - List stz; - if ((realname = a.get(key)) != null) { - // if this alias is not targeted, ignore it. - if (!Zone.isTargetZone(key)) { - continue; - } - stz = lastRules.get(realname); - zrec = lastZoneRecs.get(realname); - } else { - stz = lastRules.get(key); - zrec = lastZoneRecs.get(key); - } - - out.write("\t//--------------------------------------------------------------------\n"); - String s = Time.toFormedString(offset); - out.write("\tnew SimpleTimeZone(" + - Time.toFormedString(offset) + ", \"" + key + "\""); - if (realname != null) { - out.write(" /* " + realname + " */"); - } - - if (stz == null) { - out.write("),\n"); - } else { - RuleRec rr0 = stz.get(0); - RuleRec rr1 = stz.get(1); - - out.write(",\n\t " + Month.toString(rr0.getMonthNum()) + - ", " + rr0.getDay().getDayForSimpleTimeZone() + ", " + - rr0.getDay().getDayOfWeekForSimpleTimeZone() + ", " + - Time.toFormedString((int)rr0.getTime().getTime()) + ", " + - rr0.getTime().getTypeForSimpleTimeZone() + ",\n" + - - "\t " + Month.toString(rr1.getMonthNum()) + ", " + - rr1.getDay().getDayForSimpleTimeZone() + ", " + - rr1.getDay().getDayOfWeekForSimpleTimeZone() + ", " + - Time.toFormedString((int)rr1.getTime().getTime())+ ", " + - rr1.getTime().getTypeForSimpleTimeZone() + ",\n" + - - "\t " + Time.toFormedString(rr0.getSave()) + "),\n"); - - out.write("\t// " + rr0.getLine() + "\n"); - out.write("\t// " + rr1.getLine() + "\n"); - } - - String zline = zrec.getLine(); - if (zline.indexOf("Zone") == -1) { - zline = "Zone " + key + "\t" + zline.trim(); - } - out.write("\t// " + zline + "\n"); - } - } - out.write(" };\n"); - - out.close(); - fw.close(); - } catch(IOException e) { - Main.panic("IO error: "+e.getMessage()); - return 1; - } - - return 0; - } -} diff --git a/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java b/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java deleted file mode 100644 index 0b6570b74dc..00000000000 --- a/test/jdk/sun/util/calendar/zi/TestZoneInfo310.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -/* - * @test - * @bug 8007572 8008161 8157792 8212970 8224560 8324065 - * @summary Test whether the TimeZone generated from JSR310 tzdb is the same - * as the one from the tz data from javazic - * @modules java.base/sun.util.calendar:+open - * @build BackEnd Checksum DayOfWeek Gen GenDoc Main Mappings Month - * Rule RuleDay RuleRec Simple TestZoneInfo310 Time Timezone - * TzIDOldMapping Zone ZoneInfoFile ZoneInfoOld ZoneRec Zoneinfo - * @run main TestZoneInfo310 - */ - -import java.io.File; -import java.lang.reflect.*; -import java.nio.file.*; -import java.util.*; -import java.util.regex.*; -import java.time.zone.*; -import java.time.ZoneId; - -public class TestZoneInfo310 { - - public static void main(String[] args) throws Throwable { - - String TESTDIR = System.getProperty("test.dir", "."); - Path tzdir = Paths.get(System.getProperty("test.root"), - "../../src/java.base/share/data/tzdata"); - String tzfiles = "africa antarctica asia australasia europe northamerica southamerica backward etcetera gmt"; - Path jdk_tzdir = Paths.get(System.getProperty("test.src"), "tzdata_jdk"); - String jdk_tzfiles = "jdk11_backward"; - String zidir = TESTDIR + File.separator + "zi"; - File fZidir = new File(zidir); - if (!fZidir.exists()) { - fZidir.mkdirs(); - } - Matcher m = Pattern.compile("tzdata(?[0-9]{4}[A-z])") - .matcher(new String(Files.readAllBytes(tzdir.resolve("VERSION")), "ascii")); - String ver = m.find() ? m.group("ver") : "NULL"; - - ArrayList alist = new ArrayList<>(); - alist.add("-V"); - alist.add(ver); - alist.add("-d"); - alist.add(zidir); - for (String f : tzfiles.split(" ")) { - alist.add(tzdir.resolve(f).toString()); - } - for (String f : jdk_tzfiles.split(" ")) { - alist.add(jdk_tzdir.resolve(f).toString()); - } - System.out.println("Compiling tz files!"); - Main.main(alist.toArray(new String[alist.size()])); - - ////////////////////////////////// - System.out.println("testing!"); - ZoneInfoFile.ziDir = zidir; - long t0, t1; - - t0 = System.nanoTime(); - ZoneInfoOld.getTimeZone("America/Los_Angeles"); - t1 = System.nanoTime(); - System.out.printf("OLD.getZoneInfoOld()[1]=%d%n", (t1 - t0) / 1000); - - t0 = System.nanoTime(); - ZoneInfoOld.getTimeZone("America/New_York"); - t1 = System.nanoTime(); - System.out.printf("OLD.getZoneInfoOld()[2]=%d%n", (t1 - t0) / 1000); - - t0 = System.nanoTime(); - ZoneInfoOld.getTimeZone("America/Denver"); - t1 = System.nanoTime(); - System.out.printf("OLD.getZoneInfoOld()[3]=%d%n", (t1 - t0) / 1000); - - t0 = System.nanoTime(); - String[] zids_old = ZoneInfoOld.getAvailableIDs(); - t1 = System.nanoTime(); - System.out.printf("OLD.getAvailableIDs()=%d, total=%d%n", - (t1 - t0) / 1000, zids_old.length); - Arrays.sort(zids_old); - - t0 = System.nanoTime(); - String[] alias_old = ZoneInfoOld.getAliasTable() - .keySet().toArray(new String[0]); - t1 = System.nanoTime(); - System.out.printf("OLD.getAliasTable()=%d, total=%d%n", - (t1 - t0) / 1000, alias_old.length); - Arrays.sort(alias_old); - - t0 = System.currentTimeMillis(); - for (String zid : zids_old) { - ZoneInfoOld.getTimeZone(zid); - } - t1 = System.currentTimeMillis(); - System.out.printf("OLD.TotalTZ()=%d (ms)%n", t1 - t0); - -/* - t0 = System.nanoTime(); - ZoneId.of("America/Los_Angeles").getRules(); - t1 = System.nanoTime(); - System.out.printf("NEW.ZoneId.of()[1]=%d%n", (t1 - t0) / 1000); -*/ - t0 = System.nanoTime(); - TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles"); - t1 = System.nanoTime(); - System.out.printf("NEW.getTimeZone()[1]=%d%n", (t1 - t0) / 1000); - - t0 = System.nanoTime(); - tz = TimeZone.getTimeZone("America/New_York"); - t1 = System.nanoTime(); - System.out.printf("NEW.getTimeZone()[2]=%d%n", (t1 - t0) / 1000); - - t0 = System.nanoTime(); - tz = TimeZone.getTimeZone("America/Denver"); - t1 = System.nanoTime(); - System.out.printf("NEW.getTimeZone()[3]=%d%n", (t1 - t0) / 1000); - - t0 = System.nanoTime(); - String[] zids_new = TimeZone.getAvailableIDs(); - t1 = System.nanoTime(); - System.out.printf("NEW.getAvailableIDs()=%d, total=%d%n", - (t1 - t0) / 1000, zids_new.length); - Arrays.sort(zids_new); - - t0 = System.nanoTime(); - String[] alias_new = sun.util.calendar.ZoneInfo.getAliasTable() - .keySet().toArray(new String[0]); - t1 = System.nanoTime(); - System.out.printf("NEW.getAliasTable()=%d, total=%d%n", - (t1 - t0) / 1000, alias_new.length); - Arrays.sort(alias_new); - - t0 = System.currentTimeMillis(); - for (String zid : zids_new) { - TimeZone.getTimeZone(zid); - } - t1 = System.currentTimeMillis(); - System.out.printf("NEW.TotalTZ()=%d (ms)%n", t1 - t0); - - if (!Arrays.equals(zids_old, zids_new)) { - throw new RuntimeException(" FAILED: availableIds don't match"); - } - - if (!Arrays.equals(alias_old, alias_new)) { - throw new RuntimeException(" FAILED: aliases don't match"); - } - - for (String zid : zids_new) { - ZoneInfoOld zi = toZoneInfoOld(TimeZone.getTimeZone(zid)); - ZoneInfoOld ziOLD = (ZoneInfoOld)ZoneInfoOld.getTimeZone(zid); - /* - * Ignoring the failing TimeZones which have negative DST - * save time in IANA tzdata, as javazic/ZoneInfoOld cannot - * handle the negative DST. - * - * These are the zones/rules that employ negative DST in vanguard - * format (as of 2019a), Palestine added in 2022d: - * - * - Rule "Eire" - * - Rule "Morocco" - * - Rule "Namibia" - * - Rule "Palestine" - * - Zone "Europe/Prague" - */ - if (zid.equals("Africa/Casablanca") || // uses "Morocco" rule - zid.equals("Africa/El_Aaiun") || // uses "Morocco" rule - zid.equals("Africa/Windhoek") || // uses "Namibia" rule - zid.equals("Eire") || - zid.equals("Europe/Bratislava") || // link to "Europe/Prague" - zid.equals("Europe/Dublin") || // uses "Eire" rule - zid.equals("Europe/Prague") || - zid.equals("Asia/Gaza") || // uses "Palestine" rule - zid.equals("Asia/Hebron")) { // uses "Palestine" rule - continue; - } - if (! zi.equalsTo(ziOLD)) { - System.out.println(zi.diffsTo(ziOLD)); - throw new RuntimeException(" FAILED: " + zid); - } - } - delete(fZidir); - - // test tzdb version - if (!ver.equals(sun.util.calendar.ZoneInfoFile.getVersion())) { - System.out.printf(" FAILED: ver=%s, expected=%s%n", - sun.util.calendar.ZoneInfoFile.getVersion(), ver); - throw new RuntimeException("Version test failed"); - } - - // test getAvailableIDs(raw); - zids_new = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000); - Arrays.sort(zids_new); - zids_old = ZoneInfoOld.getAvailableIDs(-8 * 60 * 60 * 1000); - Arrays.sort(zids_old); - if (!Arrays.equals(zids_new, zids_old)) { - System.out.println("------------------------"); - System.out.println("NEW.getAvailableIDs(-8:00)"); - for (String zid : zids_new) { - System.out.println(zid); - } - System.out.println("------------------------"); - System.out.println("OLD.getAvailableIDs(-8:00)"); - for (String zid : zids_old) { - System.out.println(zid); - } - throw new RuntimeException(" FAILED: availableIds(offset) don't match"); - } - } - - private static void delete(File f) { - if (f.isDirectory()) { - for (File f0 : f.listFiles()) { - delete(f0); - } - } - f.delete(); - } - - // to access sun.util.calendar.ZoneInfo's private fields - static Class ziClz; - static Field rawOffset; - static Field checksum; - static Field dstSavings; - static Field transitions; - static Field offsets; - static Field simpleTimeZoneParams; - static Field willGMTOffsetChange; - static { - try { - ziClz = Class.forName("sun.util.calendar.ZoneInfo"); - rawOffset = ziClz.getDeclaredField("rawOffset"); - checksum = ziClz.getDeclaredField("checksum"); - dstSavings = ziClz.getDeclaredField("dstSavings"); - transitions = ziClz.getDeclaredField("transitions"); - offsets = ziClz.getDeclaredField("offsets"); - simpleTimeZoneParams = ziClz.getDeclaredField("simpleTimeZoneParams"); - willGMTOffsetChange = ziClz.getDeclaredField("willGMTOffsetChange"); - rawOffset.setAccessible(true); - checksum.setAccessible(true); - dstSavings.setAccessible(true); - transitions.setAccessible(true); - offsets.setAccessible(true); - simpleTimeZoneParams.setAccessible(true); - willGMTOffsetChange.setAccessible(true); - } catch (Exception x) { - throw new RuntimeException(x); - } - } - - private static ZoneInfoOld toZoneInfoOld(TimeZone tz) throws Exception { - return new ZoneInfoOld(tz.getID(), - rawOffset.getInt(tz), - dstSavings.getInt(tz), - checksum.getInt(tz), - (long[])transitions.get(tz), - (int[])offsets.get(tz), - (int[])simpleTimeZoneParams.get(tz), - willGMTOffsetChange.getBoolean(tz)); - } - -} diff --git a/test/jdk/sun/util/calendar/zi/Time.java b/test/jdk/sun/util/calendar/zi/Time.java deleted file mode 100644 index 66379d29d28..00000000000 --- a/test/jdk/sun/util/calendar/zi/Time.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.util.Locale; -import sun.util.calendar.CalendarDate; -import sun.util.calendar.CalendarSystem; -import sun.util.calendar.Gregorian; - -/** - * Time class represents the "AT" field and other time related information. - * - * @since 1.4 - */ -class Time { - - static final Gregorian gcal = CalendarSystem.getGregorianCalendar(); - - // type is wall clock time - private static final int WALL = 1; - - // type is standard time - private static final int STD = 2; - - // type is UTC - private static final int UTC = 3; - - // type of representing time - private int type; - - /** - * Time from the EPOCH in milliseconds - */ - private long time; - - /** - * Current time in milliseconds - */ - private static final long currentTime = System.currentTimeMillis(); - - Time() { - time = 0L; - } - - Time(long time) { - this.time = time; - } - - void setType(int type) { - this.type = type; - } - - long getTime() { - return time; - } - - int getType() { - return type; - } - - static long getCurrentTime() { - return currentTime; - } - - /** - * @return true if the time is represented in wall-clock time. - */ - boolean isWall() { - return type == WALL; - } - - /** - * @return true if the time is represented in standard time. - */ - boolean isSTD() { - return type == STD; - } - - /** - * @return true if the time is represented in UTC time. - */ - boolean isUTC() { - return type == UTC; - } - - /** - * Converts the type to a string that represents the type in the - * SimpleTimeZone time mode. (e.g., "SimpleTimeZone.WALL_TIME"). - * @return the converted string or null if the type is undefined. - */ - String getTypeForSimpleTimeZone() { - String stz = "SimpleTimeZone."; - if (isWall()) { - return stz+"WALL_TIME"; - } - else if (isSTD()) { - return stz+"STANDARD_TIME"; - } - else if (isUTC()) { - return stz+"UTC_TIME"; - } - else { - return null; - } - } - - /** - * Converts the given Gregorian calendar field values to local time. - * Local time is represented by the amount of milliseconds from - * January 1, 1970 0:00 GMT. - * @param year the year value - * @param month the Month value - * @param day the day represented by {@link RuleDay} - * @param save the amount of daylight time in milliseconds - * @param gmtOffset the GMT offset in milliseconds - * @param time the time of the day represented by {@link Time} - * @return local time - */ - static long getLocalTime(int year, Month month, RuleDay day, int save, - int gmtOffset, Time time) { - long t = time.getTime(); - - if (time.isSTD()) - t = time.getTime() + save; - else if (time.isUTC()) - t = time.getTime() + save + gmtOffset; - - return getLocalTime(year, month, day, t); - } - - /** - * Converts the given Gregorian calendar field values to local time. - * Local time is represented by the amount of milliseconds from - * January 1, 1970 0:00 GMT. - * @param year the year value - * @param month the Month value - * @param day the day value - * @param time the time of the day in milliseconds - * @return local time - */ - static long getLocalTime(int year, Month month, int day, long time) { - CalendarDate date = gcal.newCalendarDate(null); - date.setDate(year, month.value(), day); - long millis = gcal.getTime(date); - return millis + time; - } - - /** - * Equivalent to getLocalTime(year, month, day, (long)time). - * @param year the year value - * @param month the Month value - * @param day the day value - * @param time the time of the day in milliseconds - * @return local time - */ - static long getLocalTime(int year, Month month, int day, int time) { - return getLocalTime(year, month, day, (long)time); - } - - /** - * Equivalent to {@link #getLocalTime(int, Month, RuleDay, int) - * getLocalTime(year, month, day, (int) time)}. - * @param year the year value - * @param month the Month value - * @param day the day represented by {@link RuleDay} - * @param time the time of the day represented by {@link Time} - * @return local time - */ - static long getLocalTime(int year, Month month, RuleDay day, long time) { - return getLocalTime(year, month, day, (int) time); - } - - /** - * Converts the given Gregorian calendar field values to local time. - * Local time is represented by the amount of milliseconds from - * January 1, 1970 0:00 GMT. - * @param year the year value - * @param month the Month value - * @param day the day represented by {@link RuleDay} - * @param time the time of the day represented by {@link Time} - * @return local time - */ - static long getLocalTime(int year, Month month, RuleDay day, int time) { - CalendarDate cdate = gcal.newCalendarDate(null); - int monthValue = month.value(); - - if (day.isLast()) { // e.g., "lastSun" - cdate.setDate(year, monthValue, 1); - cdate.setDayOfMonth(gcal.getMonthLength(cdate)); - cdate = gcal.getNthDayOfWeek(-1, day.getDayOfWeekNum(), cdate); - } else if (day.isLater()) { // e.g., "Sun>=1" - cdate.setDate(year, monthValue, day.getDay()); - cdate = gcal.getNthDayOfWeek(1, day.getDayOfWeekNum(), cdate); - } else if (day.isExact()) { - cdate.setDate(year, monthValue, day.getDay()); - } else if (day.isEarlier()) { // e.g., "Sun<=15" - cdate.setDate(year, monthValue, day.getDay()); - cdate = gcal.getNthDayOfWeek(-1, day.getDayOfWeekNum(), cdate); - } else { - Main.panic("invalid day type: " + day); - } - return gcal.getTime(cdate) + time; - } - - /** - * Parses the given "AT" field and constructs a Time object. - * @param the "AT" field string - * @return the Time object - */ - static Time parse(String time) { - int sign; - int index = 0; - Time tm; - - if (time.charAt(0) == '-') { - sign = -1; - index++; - } else { - sign = 1; - } - int val = 0; - int num = 0; - int countDelim = 0; - while (index < time.length()) { - char c = time.charAt(index++); - if (c == ':') { - val = val * 60 + num; - countDelim++; - num = 0; - continue; - } - int d = Character.digit(c, 10); - if (d == -1) { - --index; - break; - } - num = num * 10 + d; - } - val = val * 60 + num; - // convert val to second - for (; countDelim < 2; countDelim++) { - val *= 60; - } - tm = new Time((long)val * 1000 * sign); - if (index < time.length()) { - char c = time.charAt(index++); - if (c == 's') { - tm.setType(Time.STD); - } else if (c == 'u' || c == 'g' || c == 'z') { - tm.setType(Time.UTC); - } else if (c == 'w') { - tm.setType(Time.WALL); - } else { - Main.panic("unknown time mode: "+c); - } - } else { - tm.setType(Time.WALL); - } - return tm; - } - - /** - * Converts the given milliseconds string to a "[+-]hh:mm" string. - * @param ms the milliseconds string - */ - static String toGMTFormat(String ms) { - long sec = Long.parseLong(ms) / 1000; - char sign; - if (sec < 0) { - sign = '-'; - sec = -sec; - } else { - sign = '+'; - } - return String.format((Locale)null, "%c%02d:%02d", - sign, sec/3600, (sec%3600)/60); - } - - /** - * Converts the given millisecond value to a string for a - * SimpleTimeZone parameter. - * @param ms the millisecond value - * @return the string in a human readable form - */ - static String toFormedString(int ms) { - StringBuilder s = new StringBuilder(); - boolean minus = false; - - if (ms < 0) { - s.append("-"); - minus = true; - ms = -ms; - } else if (ms == 0) { - return "0"; - } - - int hour = ms / (60 * 60 * 1000); - ms %= (60 * 60 * 1000); - int minute = ms / (60 * 1000); - - if (hour != 0) { - if (minus && minute != 0) { - s.append("("); - } - s.append(Integer.toString(hour) + "*ONE_HOUR"); - } - - if (minute != 0) { - if (hour != 0) { - s.append("+"); - } - s.append(Integer.toString(minute) + "*ONE_MINUTE"); - if (minus && hour != 0) { - s.append(")"); - } - } - - return s.toString(); - } -} diff --git a/test/jdk/sun/util/calendar/zi/Timezone.java b/test/jdk/sun/util/calendar/zi/Timezone.java deleted file mode 100644 index d4890e8f58b..00000000000 --- a/test/jdk/sun/util/calendar/zi/Timezone.java +++ /dev/null @@ -1,450 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.util.ArrayList; -import java.util.List; - -/** - * Timezone represents all information of a single point of time to - * generate its time zone database. - * - * @since 1.4 - */ -class Timezone { - /** - * zone name of this time zone - */ - private String name; - - /** - * transition time values in UTC (millisecond) - */ - private List transitions; - - /** - * All offset values in millisecond - * @see sun.util.calendar.ZoneInfo - */ - private List offsets; - - /** - * Indices of GMT offset values (both raw and raw+saving) - * at transitions - */ - private List gmtOffsets; - - /** - * Indices of regular or "direct" saving time values - * at transitions - */ - private List dstOffsets; - - /** - * Zone records of this time zone - */ - private List usedZoneRecs; - - /** - * Rule records referred to by this time zone - */ - private List usedRuleRecs; - - /** - * Type of DST rules in this time zone - */ - private int dstType; - static final int UNDEF_DST = 0; // DST type not set yet - static final int NO_DST = 1; // never observed DST - static final int LAST_DST = 2; // last rule ends in DST (all year round DST-only) - static final int X_DST = 3; // used to observe DST - static final int DST = 4; // observing DST regularly - - /** - * Raw GMT offset of this time zone in the last rule - */ - private int rawOffset; - - /** - * The CRC32 value of the transitions data - */ - private int crc32; - - /** - * The last ZoneRec - */ - private ZoneRec lastZoneRec; - - /** - * The last DST rules. lastRules[0] is the DST start - * rule. lastRules[1] is the DST end rules. - */ - private List lastRules; - - /** - * The amount of DST saving value (millisecond) in the last DST - * rule. - */ - private int lastSaving; - - /** - * true if the raw offset will change in the future time. - */ - private boolean willRawOffsetChange = false; - - - /** - * Constracts a Timezone object with the given zone name. - * @param name the zone name - */ - Timezone(String name) { - this.name = name; - } - - /** - * @return the number of transitions - */ - int getNTransitions() { - if (transitions == null) { - return 0; - } - return transitions.size(); - } - - /** - * @return the zone name - */ - String getName() { - return name; - } - - /** - * Returns the list of all rule records that have been referred to - * by this time zone. - * @return the rule records list - */ - List getRules() { - return usedRuleRecs; - } - - /** - * Returns the list of all zone records that have been referred to - * by this time zone. - * @return the zone records list - */ - List getZones() { - return usedZoneRecs; - } - - /** - * @return the transition table (list) - */ - List getTransitions() { - return transitions; - } - - /** - * @return the offsets list - */ - List getOffsets() { - return offsets; - } - - /** - * @return the DST saving offsets list - */ - List getDstOffsets() { - return dstOffsets; - } - - /** - * @return the GMT offsets list - */ - List getGmtOffsets() { - return gmtOffsets; - } - - /** - * @return the checksum (crc32) value of the trasition table - */ - int getCRC32() { - return crc32; - } - - /** - * @return true if the GMT offset of this time zone would change - * after the time zone database has been generated, false, otherwise. - */ - boolean willGMTOffsetChange() { - return willRawOffsetChange; - } - - /** - * @return the last known GMT offset value in milliseconds - */ - int getRawOffset() { - return rawOffset; - } - - /** - * Sets time zone's GMT offset to offset. - * @param offset the GMT offset value in milliseconds - */ - void setRawOffset(int offset) { - rawOffset = offset; - } - - /** - * Sets time zone's GMT offset value to offset. If - * startTime is future time, then the {@link - * #willRawOffsetChange} value is set to true. - * @param offset the GMT offset value in milliseconds - * @param startTime the UTC time at which the GMT offset is in effective - */ - void setRawOffset(int offset, long startTime) { - // if this rawOffset is for the future time, let the run-time - // look for the current GMT offset. - if (startTime > Time.getCurrentTime()) { - willRawOffsetChange = true; - } - setRawOffset(offset); - } - - /** - * Adds the specified transition information to the end of the transition table. - * @param time the UTC time at which this transition happens - * @param offset the total amount of the offset from GMT in milliseconds - * @param dstOffset the amount of time in milliseconds saved at this transition - */ - void addTransition(long time, int offset, int dstOffset) { - if (transitions == null) { - transitions = new ArrayList(); - offsets = new ArrayList(); - dstOffsets = new ArrayList(); - } - transitions.add(time); - offsets.add(offset); - dstOffsets.add(dstOffset); - } - - /** - * Sets the type of historical daylight saving time - * observation. For example, China used to observed daylight - * saving time, but it no longer does. Then, X_DST is set to the - * China time zone. - * @param type the type of daylight saving time - */ - void setDSTType(int type) { - dstType = type; - } - - /** - * @return the type of historical daylight saving time - * observation. - */ - int getDSTType() { - return dstType; - } - - /** - * Adds the specified zone record to the zone records list. - * @param rec the zone record - */ - void addUsedRec(ZoneRec rec) { - if (usedZoneRecs == null) { - usedZoneRecs = new ArrayList(); - } - usedZoneRecs.add(rec); - } - - /** - * Adds the specified rule record to the rule records list. - * @param rec the rule record - */ - void addUsedRec(RuleRec rec) { - if (usedRuleRecs == null) { - usedRuleRecs = new ArrayList(); - } - // if the last used rec is the same as the given rec, avoid - // putting the same rule. - int n = usedRuleRecs.size(); - for (int i = 0; i < n; i++) { - if (usedRuleRecs.get(i).equals(rec)) { - return; - } - } - usedRuleRecs.add(rec); - } - - /** - * Sets the last zone record for this time zone. - * @param the last zone record - */ - void setLastZoneRec(ZoneRec zrec) { - lastZoneRec = zrec; - } - - /** - * @return the last zone record for this time zone. - */ - ZoneRec getLastZoneRec() { - return lastZoneRec; - } - - /** - * Sets the last rule records for this time zone. Those are used - * for generating SimpleTimeZone parameters. - * @param rules the last rule records - */ - void setLastRules(List rules) { - int n = rules.size(); - if (n > 0) { - lastRules = rules; - RuleRec rec = rules.get(0); - int offset = rec.getSave(); - if (offset > 0) { - setLastDSTSaving(offset); - } else { - System.err.println("\t No DST starting rule in the last rules."); - } - } - } - - /** - * @return the last rule records for this time zone. - */ - List getLastRules() { - return lastRules; - } - - /** - * Sets the last daylight saving amount. - * @param the daylight saving amount - */ - void setLastDSTSaving(int offset) { - lastSaving = offset; - } - - /** - * @return the last daylight saving amount. - */ - int getLastDSTSaving() { - return lastSaving; - } - - /** - * Calculates the CRC32 value from the transition table and sets - * the value to crc32. - */ - void checksum() { - if (transitions == null) { - crc32 = 0; - return; - } - Checksum sum = new Checksum(); - for (int i = 0; i < transitions.size(); i++) { - int offset = offsets.get(i); - // adjust back to make the transition in local time - sum.update(transitions.get(i) + offset); - sum.update(offset); - sum.update(dstOffsets.get(i)); - } - crc32 = (int)sum.getValue(); - } - - /** - * Removes unnecessary transitions for Java time zone support. - */ - void optimize() { - // if there is only one offset, delete all transitions. This - // could happen if only time zone abbreviations changed. - if (gmtOffsets.size() == 1) { - transitions = null; - usedRuleRecs = null; - setDSTType(NO_DST); - return; - } - for (int i = 0; i < (transitions.size() - 2); i++) { // don't remove the last one - if (transitions.get(i) == transitions.get(i+1)) { - transitions.remove(i); - offsets.remove(i); - dstOffsets.remove(i); - i--; - } - } - - for (int i = 0; i < (transitions.size() - 2); i++) { // don't remove the last one - if (offsets.get(i) == offsets.get(i+1) - && dstOffsets.get(i) == dstOffsets.get(i+1)) { - transitions.remove(i+1); - offsets.remove(i+1); - dstOffsets.remove(i+1); - i--; - } - } - } - - /** - * Stores the specified offset value from GMT in the GMT offsets - * table and returns its index. The offset value includes the base - * GMT offset and any additional daylight saving if applicable. If - * the same value as the specified offset is already in the table, - * its index is returned. - * @param offset the offset value in milliseconds - * @return the index to the offset value in the GMT offsets table. - */ - int getOffsetIndex(int offset) { - return getOffsetIndex(offset, 0); - } - - /** - * Stores the specified daylight saving value in the GMT offsets - * table and returns its index. If the same value as the specified - * offset is already in the table, its index is returned. If 0 is - * specified, it's not stored in the table and -1 is returned. - * @param offset the offset value in milliseconds - * @return the index to the specified offset value in the GMT - * offsets table, or -1 if 0 is specified. - */ - int getDstOffsetIndex(int offset) { - if (offset == 0) { - return -1; - } - return getOffsetIndex(offset, 1); - } - - private int getOffsetIndex(int offset, int index) { - if (gmtOffsets == null) { - gmtOffsets = new ArrayList(); - } - for (int i = index; i < gmtOffsets.size(); i++) { - if (offset == gmtOffsets.get(i)) { - return i; - } - } - if (gmtOffsets.size() < index) { - gmtOffsets.add(0); - } - gmtOffsets.add(offset); - return gmtOffsets.size() - 1; - } -} diff --git a/test/jdk/sun/util/calendar/zi/TzIDOldMapping.java b/test/jdk/sun/util/calendar/zi/TzIDOldMapping.java deleted file mode 100644 index 7e8ce636449..00000000000 --- a/test/jdk/sun/util/calendar/zi/TzIDOldMapping.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.util.Map; -import java.util.HashMap; - -class TzIDOldMapping { - static final Map MAP = new HashMap(); - static { - String[][] oldmap = { - { "ACT", "Australia/Darwin" }, - { "AET", "Australia/Sydney" }, - { "AGT", "America/Argentina/Buenos_Aires" }, - { "ART", "Africa/Cairo" }, - { "AST", "America/Anchorage" }, - { "BET", "America/Sao_Paulo" }, - { "BST", "Asia/Dhaka" }, - { "CAT", "Africa/Harare" }, - { "CNT", "America/St_Johns" }, - { "CST", "America/Chicago" }, - { "CTT", "Asia/Shanghai" }, - { "EAT", "Africa/Addis_Ababa" }, - { "ECT", "Europe/Paris" }, - { "EST", "America/New_York" }, - { "HST", "Pacific/Honolulu" }, - { "IET", "America/Indianapolis" }, - { "IST", "Asia/Calcutta" }, - { "JST", "Asia/Tokyo" }, - { "MIT", "Pacific/Apia" }, - { "MST", "America/Denver" }, - { "NET", "Asia/Yerevan" }, - { "NST", "Pacific/Auckland" }, - { "PLT", "Asia/Karachi" }, - { "PNT", "America/Phoenix" }, - { "PRT", "America/Puerto_Rico" }, - { "PST", "America/Los_Angeles" }, - { "SST", "Pacific/Guadalcanal" }, - { "VST", "Asia/Saigon" }, - }; - for (String[] pair : oldmap) { - MAP.put(pair[0], pair[1]); - } - } -} diff --git a/test/jdk/sun/util/calendar/zi/Zone.java b/test/jdk/sun/util/calendar/zi/Zone.java deleted file mode 100644 index f1adbf6f938..00000000000 --- a/test/jdk/sun/util/calendar/zi/Zone.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.StringTokenizer; - -/** - * Zone holds information corresponding to a "Zone" part of a time - * zone definition file. - * - * @since 1.4 - */ -class Zone { - // zone name (e.g., "America/Los_Angeles") - private String name; - - // zone records - private List list; - - // target zone names for this compilation - private static Set targetZones; - - /** - * Constructs a Zone with the specified zone name. - * @param name the zone name - */ - Zone(String name) { - this.name = name; - list = new ArrayList(); - } - - /** - * Reads time zone names to be generated, called "target zone - * name", from the specified text file and creats an internal hash - * table to keep those names. It's assumed that one text line - * contains a zone name or comments if it starts with - * '#'. Comments can't follow a zone name in a single line. - * @param fileName the text file name - */ - static void readZoneNames(String fileName) { - if (fileName == null) { - return; - } - BufferedReader in = null; - try { - FileReader fr = new FileReader(fileName); - in = new BufferedReader(fr); - } catch (FileNotFoundException e) { - Main.panic("can't open file: " + fileName); - } - targetZones = new HashSet(); - String line; - - try { - while ((line = in.readLine()) != null) { - line = line.trim(); - if (line.length() == 0 || line.charAt(0) == '#') { - continue; - } - if (!targetZones.add(line)) { - Main.warning("duplicated target zone name: " + line); - } - } - in.close(); - } catch (IOException e) { - Main.panic("IO error: "+e.getMessage()); - } - } - - /** - * Determines whether the specified zone is one of the target zones. - * If no target zones are specified, this method always returns - * true for any zone name. - * @param zoneName the zone name - * @return true if the specified name is a target zone. - */ - static boolean isTargetZone(String zoneName) { - if (targetZones == null) { - return true; - } - return targetZones.contains(zoneName); - } - - /** - * Forces to add "MET" to the target zone table. This is because - * there is a conflict between Java zone name "WET" and Olson zone - * name. - */ - static void addMET() { - if (targetZones != null) { - targetZones.add("MET"); - } - } - - /** - * @return the zone name - */ - String getName() { - return name; - } - - /** - * Adds the specified zone record to the zone record list. - */ - void add(ZoneRec rec) { - list.add(rec); - } - - /** - * @param index the index at which the zone record in the list is returned. - * @return the zone record specified by the index. - */ - ZoneRec get(int index) { - return list.get(index); - } - - /** - * @return the size of the zone record list - */ - int size() { - return list.size(); - } - - /** - * Resolves the reference to a rule in each zone record. - * @param zi the Zoneinfo object with which the rule reference is - * resolved. - */ - void resolve(Zoneinfo zi) { - for (int i = 0; i < list.size(); i++) { - ZoneRec rec = list.get(i); - rec.resolve(zi); - } - } -} diff --git a/test/jdk/sun/util/calendar/zi/ZoneInfoFile.java b/test/jdk/sun/util/calendar/zi/ZoneInfoFile.java deleted file mode 100644 index 3134a517979..00000000000 --- a/test/jdk/sun/util/calendar/zi/ZoneInfoFile.java +++ /dev/null @@ -1,1049 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.lang.ref.SoftReference; -import java.nio.file.FileSystems; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import sun.util.calendar.*; - -/** - * ZoneInfoFile reads Zone information files in the - * <java.home>/lib/zi directory and provides time zone - * information in the form of a {@link ZoneInfo} object. Also, it - * reads the ZoneInfoMappings file to obtain time zone IDs information - * that is used by the {@link ZoneInfo} class. The directory layout - * and data file formats are as follows. - * - *

Directory layout

- * - * All zone data files and ZoneInfoMappings are put under the - * <java.home>/lib/zi directory. A path name for a given time - * zone ID is a concatenation of <java.home>/lib/zi/ and the - * time zone ID. (The file separator is replaced with the platform - * dependent value. e.g., '\' for Win32.) An example layout will look - * like as follows. - *

- *
- * <java.home>/lib/zi/Africa/Addis_Ababa
- *                   /Africa/Dakar
- *                   /America/Los_Angeles
- *                   /Asia/Singapore
- *                   /EET
- *                   /Europe/Oslo
- *                   /GMT
- *                   /Pacific/Galapagos
- *                       ...
- *                   /ZoneInfoMappings
- * 
- *
- * - * A zone data file has specific information of each zone. - * ZoneInfoMappings has global information of zone IDs so - * that the information can be obtained without instantiating all time - * zones. - * - *

File format

- * - * Two binary-file formats based on a simple Tag-Length-Value format are used - * to describe TimeZone information. The generic format of a data file is: - *

- *
- *    DataFile {
- *      u1              magic[7];
- *      u1              version;
- *      data_item       data[];
- *    }
- * 
- *
- * where magic is a magic number identifying a file - * format, version is the format version number, and - * data is one or more data_items. The - * data_item structure is: - *
- *
- *    data_item {
- *      u1              tag;
- *      u2              length;
- *      u1              value[length];
- *    }
- * 
- *
- * where tag indicates the data type of the item, - * length is a byte count of the following - * value that is the content of item data. - *

- * All data is stored in the big-endian order. There is no boundary - * alignment between date items. - * - *

1. ZoneInfo data file

- * - * Each ZoneInfo data file consists of the following members. - *
- *

- *
- *    ZoneInfoDataFile {
- *      u1              magic[7];
- *      u1              version;
- *      SET OF1 {
- *        transition            transitions2;
- *        offset_table          offsets2;
- *        simpletimezone        stzparams2;
- *        raw_offset            rawoffset;
- *        dstsaving             dst;
- *        checksum              crc32;
- *        gmtoffsetwillchange   gmtflag2;
- *      }
- *   }
- *   1: an unordered collection of zero or one occurrences of each item
- *   2: optional item
- * 
- *
- * magic is a byte-string constant identifying the - * ZoneInfo data file. This field must be "javazi\0" - * defined as {@link #JAVAZI_LABEL}. - *

- * version is the version number of the file format. This - * will be used for compatibility check. This field must be - * 0x01 in this version. - *

- * transition, offset_table and - * simpletimezone have information of time transition - * from the past to the future. Therefore, these structures don't - * exist if the zone didn't change zone names and haven't applied DST in - * the past, and haven't planned to apply it. (e.g. Asia/Tokyo zone) - *

- * raw_offset, dstsaving and checksum - * exist in every zoneinfo file. They are used by TimeZone.class indirectly. - * - *

1.1 transition structure

- *

- *
- *    transition {
- *      u1      tag;              // 0x04 : constant
- *      u2      length;           // byte length of whole values
- *      s8      value[length/8];  // transitions in `long'
- *    }
- * 
- *
- * See {@link ZoneInfo#transitions ZoneInfo.transitions} about the value. - * - *

1.2 offset_table structure

- *

- *
- *    offset_table {
- *      u1      tag;              // 0x05 : constant
- *      u2      length;           // byte length of whole values
- *      s4      value[length/4];  // offset values in `int'
- *    }
- * 
- *
- * - *

1.3 simpletimezone structure

- * See {@link ZoneInfo#simpleTimeZoneParams ZoneInfo.simpleTimeZoneParams} - * about the value. - *

- *
- *    simpletimezone {
- *      u1      tag;              // 0x06 : constant
- *      u2      length;           // byte length of whole values
- *      s4      value[length/4];  // SimpleTimeZone parameters
- *    }
- * 
- *
- * See {@link ZoneInfo#offsets ZoneInfo.offsets} about the value. - * - *

1.4 raw_offset structure

- *

- *
- *    raw_offset {
- *      u1      tag;              // 0x01 : constant
- *      u2      length;           // must be 4.
- *      s4      value;            // raw GMT offset [millisecond]
- *    }
- * 
- *
- * See {@link ZoneInfo#rawOffset ZoneInfo.rawOffset} about the value. - * - *

1.5 dstsaving structure

- * Value has dstSaving in seconds. - *

- *
- *    dstsaving {
- *      u1      tag;              // 0x02 : constant
- *      u2      length;           // must be 2.
- *      s2      value;            // DST save value [second]
- *    }
- * 
- *
- * See {@link ZoneInfo#dstSavings ZoneInfo.dstSavings} about value. - * - *

1.6 checksum structure

- *

- *
- *    checksum {
- *      u1      tag;              // 0x03 : constant
- *      u2      length;           // must be 4.
- *      s4      value;            // CRC32 value of transitions
- *    }
- * 
- *
- * See {@link ZoneInfo#checksum ZoneInfo.checksum}. - * - *

1.7 gmtoffsetwillchange structure

- * This record has a flag value for {@link ZoneInfo#rawOffsetWillChange}. - * If this record is not present in a zoneinfo file, 0 is assumed for - * the value. - *

- *
- *    gmtoffsetwillchange {
- *      u1      tag;             // 0x07 : constant
- *      u2      length;          // must be 1.
- *      u1      value;           // 1: if the GMT raw offset will change
- *                               // in the future, 0, otherwise.
- *     }
- * 
- *
- * - * - *

2. ZoneInfoMappings file

- * - * The ZoneInfoMappings file consists of the following members. - *
- *

- *
- *    ZoneInfoMappings {
- *      u1      magic[7];
- *      u1      version;
- *      SET OF {
- *        versionName                   version;
- *        zone_id_table                 zoneIDs;
- *        raw_offset_table              rawoffsets;
- *        raw_offset_index_table        rawoffsetindices;
- *        alias_table                   aliases;
- *        excluded_list                 excludedList;
- *      }
- *   }
- * 
- *
- * - * magic is a byte-string constant which has the file type. - * This field must be "javazm\0" defined as {@link #JAVAZM_LABEL}. - *

- * version is the version number of this file - * format. This will be used for compatibility check. This field must - * be 0x01 in this version. - *

- * versionName shows which version of Olson's data has been used - * to generate this ZoneInfoMappings. (e.g. tzdata2000g)
- * This field is for trouble-shooting and isn't usually used in runtime. - *

- * zone_id_table, raw_offset_index_table and - * alias_table are general information of supported - * zones. - * - *

2.1 zone_id_table structure

- * The list of zone IDs included in the zi database. The list does - * not include zone IDs, if any, listed in excludedList. - *
- *

- *
- *    zone_id_table {
- *      u1      tag;              // 0x40 : constant
- *      u2      length;           // byte length of whole values
- *      u2      zone_id_count;
- *      zone_id value[zone_id_count];
- *    }
- *
- *    zone_id {
- *      u1      byte_length;      // byte length of id
- *      u1      id[byte_length];  // zone name string
- *    }
- * 
- *
- * - *

2.2 raw_offset_table structure

- *
- *

- *
- *    raw_offset_table {
- *      u1      tag;              // 0x41 : constant
- *      u2      length;           // byte length of whole values
- *      s4      value[length/4];  // raw GMT offset in milliseconds
- *   }
- * 
- *
- * - *

2.3 raw_offset_index_table structure

- *
- *

- *
- *    raw_offset_index_table {
- *      u1      tag;              // 0x42 : constant
- *      u2      length;           // byte length of whole values
- *      u1      value[length];
- *    }
- * 
- *
- * - *

2.4 alias_table structure

- *
- *

- *
- *   alias_table {
- *      u1      tag;              // 0x43 : constant
- *      u2      length;           // byte length of whole values
- *      u2      nentries;         // number of id-pairs
- *      id_pair value[nentries];
- *   }
- *
- *   id_pair {
- *      zone_id aliasname;
- *      zone_id ID;
- *   }
- * 
- *
- * - *

2.5 versionName structure

- *
- *

- *
- *   versionName {
- *      u1      tag;              // 0x44 : constant
- *      u2      length;           // byte length of whole values
- *      u1      value[length];
- *   }
- * 
- *
- * - *

2.6 excludeList structure

- * The list of zone IDs whose zones will change their GMT offsets - * (a.k.a. raw offsets) some time in the future. Those IDs must be - * added to the list of zone IDs for getAvailableIDs(). Also they must - * be examined for getAvailableIDs(int) to determine the - * current GMT offsets. - *
- *

- *
- *   excluded_list {
- *      u1      tag;              // 0x45 : constant
- *      u2      length;           // byte length of whole values
- *      u2      nentries;         // number of zone_ids
- *      zone_id value[nentries];  // excluded zone IDs
- *   }
- * 
- *
- * - * @since 1.4 - */ - -public class ZoneInfoFile { - - /** - * The magic number for the ZoneInfo data file format. - */ - public static final byte[] JAVAZI_LABEL = { - (byte)'j', (byte)'a', (byte)'v', (byte)'a', (byte)'z', (byte)'i', (byte)'\0' - }; - private static final int JAVAZI_LABEL_LENGTH = JAVAZI_LABEL.length; - - /** - * The ZoneInfo data file format version number. Must increase - * one when any incompatible change has been made. - */ - public static final byte JAVAZI_VERSION = 0x01; - - /** - * Raw offset data item tag. - */ - public static final byte TAG_RawOffset = 1; - - /** - * Known last Daylight Saving Time save value data item tag. - */ - public static final byte TAG_LastDSTSaving = 2; - - /** - * Checksum data item tag. - */ - public static final byte TAG_CRC32 = 3; - - /** - * Transition data item tag. - */ - public static final byte TAG_Transition = 4; - - /** - * Offset table data item tag. - */ - public static final byte TAG_Offset = 5; - - /** - * SimpleTimeZone parameters data item tag. - */ - public static final byte TAG_SimpleTimeZone = 6; - - /** - * Raw GMT offset will change in the future. - */ - public static final byte TAG_GMTOffsetWillChange = 7; - - - /** - * The ZoneInfoMappings file name. - */ - public static final String JAVAZM_FILE_NAME = "ZoneInfoMappings"; - - /** - * The magic number for the ZoneInfoMappings file format. - */ - public static final byte[] JAVAZM_LABEL = { - (byte)'j', (byte)'a', (byte)'v', (byte)'a', (byte)'z', (byte)'m', (byte)'\0' - }; - private static final int JAVAZM_LABEL_LENGTH = JAVAZM_LABEL.length; - - /** - * The ZoneInfoMappings file format version number. Must increase - * one when any incompatible change has been made. - */ - public static final byte JAVAZM_VERSION = 0x01; - - /** - * Time zone IDs data item tag. - */ - public static final byte TAG_ZoneIDs = 64; - - /** - * Raw GMT offsets table data item tag. - */ - public static final byte TAG_RawOffsets = 65; - - /** - * Indices to the raw GMT offset table data item tag. - */ - public static final byte TAG_RawOffsetIndices = 66; - - /** - * Time zone aliases table data item tag. - */ - public static final byte TAG_ZoneAliases = 67; - - /** - * Olson's public zone information version tag. - */ - public static final byte TAG_TZDataVersion = 68; - - /** - * Excluded zones item tag. (Added in Mustang) - */ - public static final byte TAG_ExcludedZones = 69; - - private static Map zoneInfoObjects = null; - - private static final ZoneInfoOld GMT = new ZoneInfoOld("GMT", 0); - - static String ziDir; - - /** - * Converts the given time zone ID to a platform dependent path - * name. For example, "America/Los_Angeles" is converted to - * "America\Los_Angeles" on Win32. - * @return a modified ID replacing '/' with {@link - * java.io.File#separatorChar File.separatorChar} if needed. - */ - public static String getFileName(String ID) { - if (File.separatorChar == '/') { - return ID; - } - return ID.replace('/', File.separatorChar); - } - - /** - * Gets a ZoneInfo with the given GMT offset. The object - * has its ID in the format of GMT{+|-}hh:mm. - * - * @param originalId the given custom id (before normalized such as "GMT+9") - * @param gmtOffset GMT offset in milliseconds - * @return a ZoneInfo constructed with the given GMT offset - */ - public static ZoneInfoOld getCustomTimeZone(String originalId, int gmtOffset) { - String id = toCustomID(gmtOffset); - - ZoneInfoOld zi = getFromCache(id); - if (zi == null) { - zi = new ZoneInfoOld(id, gmtOffset); - zi = addToCache(id, zi); - if (!id.equals(originalId)) { - zi = addToCache(originalId, zi); - } - } - return (ZoneInfoOld) zi.clone(); - } - - public static String toCustomID(int gmtOffset) { - char sign; - int offset = gmtOffset / 60000; - - if (offset >= 0) { - sign = '+'; - } else { - sign = '-'; - offset = -offset; - } - int hh = offset / 60; - int mm = offset % 60; - - char[] buf = new char[] { 'G', 'M', 'T', sign, '0', '0', ':', '0', '0' }; - if (hh >= 10) { - buf[4] += hh / 10; - } - buf[5] += hh % 10; - if (mm != 0) { - buf[7] += mm / 10; - buf[8] += mm % 10; - } - return new String(buf); - } - - /** - * @return a ZoneInfo instance created for the specified id, or - * null if there is no time zone data file found for the specified - * id. - */ - public static ZoneInfoOld getZoneInfoOld(String id) { - //treat GMT zone as special - if ("GMT".equals(id)) - return (ZoneInfoOld) GMT.clone(); - ZoneInfoOld zi = getFromCache(id); - if (zi == null) { - Map aliases = ZoneInfoOld.getCachedAliasTable(); - if (aliases != null && aliases.get(id) != null) { - return null; - } - zi = createZoneInfoOld(id); - if (zi == null) { - return null; - } - zi = addToCache(id, zi); - } - return (ZoneInfoOld) zi.clone(); - } - - synchronized static ZoneInfoOld getFromCache(String id) { - if (zoneInfoObjects == null) { - return null; - } - return zoneInfoObjects.get(id); - } - - synchronized static ZoneInfoOld addToCache(String id, ZoneInfoOld zi) { - if (zoneInfoObjects == null) { - zoneInfoObjects = new HashMap<>(); - } else { - ZoneInfoOld zone = zoneInfoObjects.get(id); - if (zone != null) { - return zone; - } - } - zoneInfoObjects.put(id, zi); - return zi; - } - - private static ZoneInfoOld createZoneInfoOld(String id) { - byte[] buf = readZoneInfoFile(getFileName(id)); - if (buf == null) { - return null; - } - - int index = 0; - int filesize = buf.length; - int rawOffset = 0; - int dstSavings = 0; - int checksum = 0; - boolean willGMTOffsetChange = false; - long[] transitions = null; - int[] offsets = null; - int[] simpleTimeZoneParams = null; - - try { - for (index = 0; index < JAVAZI_LABEL.length; index++) { - if (buf[index] != JAVAZI_LABEL[index]) { - System.err.println("ZoneInfoOld: wrong magic number: " + id); - return null; - } - } - if (buf[index++] > JAVAZI_VERSION) { - System.err.println("ZoneInfo: incompatible version (" - + buf[index - 1] + "): " + id); - return null; - } - - while (index < filesize) { - byte tag = buf[index++]; - int len = ((buf[index++] & 0xFF) << 8) + (buf[index++] & 0xFF); - - if (filesize < index+len) { - break; - } - - switch (tag) { - case TAG_CRC32: - { - int val = buf[index++] & 0xff; - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - checksum = val; - } - break; - - case TAG_LastDSTSaving: - { - short val = (short)(buf[index++] & 0xff); - val = (short)((val << 8) + (buf[index++] & 0xff)); - dstSavings = val * 1000; - } - break; - - case TAG_RawOffset: - { - int val = buf[index++] & 0xff; - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - rawOffset = val; - } - break; - - case TAG_Transition: - { - int n = len / 8; - transitions = new long[n]; - for (int i = 0; i < n; i ++) { - long val = buf[index++] & 0xff; - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - transitions[i] = val; - } - } - break; - - case TAG_Offset: - { - int n = len / 4; - offsets = new int[n]; - for (int i = 0; i < n; i ++) { - int val = buf[index++] & 0xff; - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - offsets[i] = val; - } - } - break; - - case TAG_SimpleTimeZone: - { - if (len != 32 && len != 40) { - System.err.println("ZoneInfo: wrong SimpleTimeZone parameter size"); - return null; - } - int n = len / 4; - simpleTimeZoneParams = new int[n]; - for (int i = 0; i < n; i++) { - int val = buf[index++] & 0xff; - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - simpleTimeZoneParams[i] = val; - } - } - break; - - case TAG_GMTOffsetWillChange: - { - if (len != 1) { - System.err.println("ZoneInfo: wrong byte length for TAG_GMTOffsetWillChange"); - } - willGMTOffsetChange = buf[index++] == 1; - } - break; - - default: - System.err.println("ZoneInfo: unknown tag < " + tag + ">. ignored."); - index += len; - break; - } - } - } catch (Exception e) { - System.err.println("ZoneInfo: corrupted zoneinfo file: " + id); - return null; - } - - if (index != filesize) { - System.err.println("ZoneInfo: wrong file size: " + id); - return null; - } - - return new ZoneInfoOld(id, rawOffset, dstSavings, checksum, - transitions, offsets, simpleTimeZoneParams, - willGMTOffsetChange); - } - - private volatile static SoftReference> zoneIDs = null; - - static List getZoneIDs() { - List ids = null; - SoftReference> cache = zoneIDs; - if (cache != null) { - ids = cache.get(); - if (ids != null) { - return ids; - } - } - byte[] buf = null; - buf = getZoneInfoOldMappings(); - int index = JAVAZM_LABEL_LENGTH + 1; - int filesize = buf.length; - try { - loop: - while (index < filesize) { - byte tag = buf[index++]; - int len = ((buf[index++] & 0xFF) << 8) + (buf[index++] & 0xFF); - - switch (tag) { - case TAG_ZoneIDs: - { - int n = (buf[index++] << 8) + (buf[index++] & 0xFF); - ids = new ArrayList<>(n); - - for (int i = 0; i < n; i++) { - byte m = buf[index++]; - ids.add(new String(buf, index, m, "UTF-8")); - index += m; - } - } - break loop; - - default: - index += len; - break; - } - } - } catch (Exception e) { - System.err.println("ZoneInfoOld: corrupted " + JAVAZM_FILE_NAME); - } - - zoneIDs = new SoftReference<>(ids); - return ids; - } - - /** - * @return an alias table in HashMap where a key is an alias ID - * (e.g., "PST") and its value is a real time zone ID (e.g., - * "America/Los_Angeles"). - */ - static Map getZoneAliases() { - byte[] buf = getZoneInfoOldMappings(); - int index = JAVAZM_LABEL_LENGTH + 1; - int filesize = buf.length; - Map aliases = null; - - try { - loop: - while (index < filesize) { - byte tag = buf[index++]; - int len = ((buf[index++] & 0xFF) << 8) + (buf[index++] & 0xFF); - - switch (tag) { - case TAG_ZoneAliases: - { - int n = (buf[index++] << 8) + (buf[index++] & 0xFF); - aliases = new HashMap<>(n); - for (int i = 0; i < n; i++) { - byte m = buf[index++]; - String name = new String(buf, index, m, "UTF-8"); - index += m; - m = buf[index++]; - String realName = new String(buf, index, m, "UTF-8"); - index += m; - aliases.put(name, realName); - } - } - break loop; - - default: - index += len; - break; - } - } - } catch (Exception e) { - System.err.println("ZoneInfoOld: corrupted " + JAVAZM_FILE_NAME); - return null; - } - return aliases; - } - - private volatile static SoftReference> excludedIDs = null; - private volatile static boolean hasNoExcludeList = false; - - /** - * @return a List of zone IDs for zones that will change their GMT - * offsets in some future time. - * - * @since 1.6 - */ - static List getExcludedZones() { - if (hasNoExcludeList) { - return null; - } - - List excludeList = null; - - SoftReference> cache = excludedIDs; - if (cache != null) { - excludeList = cache.get(); - if (excludeList != null) { - return excludeList; - } - } - - byte[] buf = getZoneInfoOldMappings(); - int index = JAVAZM_LABEL_LENGTH + 1; - int filesize = buf.length; - - try { - loop: - while (index < filesize) { - byte tag = buf[index++]; - int len = ((buf[index++] & 0xFF) << 8) + (buf[index++] & 0xFF); - - switch (tag) { - case TAG_ExcludedZones: - { - int n = (buf[index++] << 8) + (buf[index++] & 0xFF); - excludeList = new ArrayList<>(); - for (int i = 0; i < n; i++) { - byte m = buf[index++]; - String name = new String(buf, index, m, "UTF-8"); - index += m; - excludeList.add(name); - } - } - break loop; - - default: - index += len; - break; - } - } - } catch (Exception e) { - System.err.println("ZoneInfoOld: corrupted " + JAVAZM_FILE_NAME); - return null; - } - - if (excludeList != null) { - excludedIDs = new SoftReference<>(excludeList); - } else { - hasNoExcludeList = true; - } - return excludeList; - } - - private volatile static SoftReference rawOffsetIndices = null; - - static byte[] getRawOffsetIndices() { - byte[] indices = null; - - SoftReference cache = rawOffsetIndices; - if (cache != null) { - indices = cache.get(); - if (indices != null) { - return indices; - } - } - - byte[] buf = getZoneInfoOldMappings(); - int index = JAVAZM_LABEL_LENGTH + 1; - int filesize = buf.length; - - try { - loop: - while (index < filesize) { - byte tag = buf[index++]; - int len = ((buf[index++] & 0xFF) << 8) + (buf[index++] & 0xFF); - - switch (tag) { - case TAG_RawOffsetIndices: - { - indices = new byte[len]; - for (int i = 0; i < len; i++) { - indices[i] = buf[index++]; - } - } - break loop; - - default: - index += len; - break; - } - } - } catch (ArrayIndexOutOfBoundsException e) { - System.err.println("ZoneInfoOld: corrupted " + JAVAZM_FILE_NAME); - } - - rawOffsetIndices = new SoftReference<>(indices); - return indices; - } - - private volatile static SoftReference rawOffsets = null; - - static int[] getRawOffsets() { - int[] offsets = null; - - SoftReference cache = rawOffsets; - if (cache != null) { - offsets = cache.get(); - if (offsets != null) { - return offsets; - } - } - - byte[] buf = getZoneInfoOldMappings(); - int index = JAVAZM_LABEL_LENGTH + 1; - int filesize = buf.length; - - try { - loop: - while (index < filesize) { - byte tag = buf[index++]; - int len = ((buf[index++] & 0xFF) << 8) + (buf[index++] & 0xFF); - - switch (tag) { - case TAG_RawOffsets: - { - int n = len/4; - offsets = new int[n]; - for (int i = 0; i < n; i++) { - int val = buf[index++] & 0xff; - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - val = (val << 8) + (buf[index++] & 0xff); - offsets[i] = val; - } - } - break loop; - - default: - index += len; - break; - } - } - } catch (ArrayIndexOutOfBoundsException e) { - System.err.println("ZoneInfoOld: corrupted " + JAVAZM_FILE_NAME); - } - - rawOffsets = new SoftReference<>(offsets); - return offsets; - } - - private volatile static SoftReference zoneInfoMappings = null; - - private static byte[] getZoneInfoOldMappings() { - byte[] data; - SoftReference cache = zoneInfoMappings; - if (cache != null) { - data = cache.get(); - if (data != null) { - return data; - } - } - data = readZoneInfoFile(JAVAZM_FILE_NAME); - if (data == null) { - throw new RuntimeException("ZoneInfoOldMapping " + - JAVAZM_FILE_NAME + " either doesn't exist or doesn't have data"); - } - - int index; - for (index = 0; index < JAVAZM_LABEL.length; index++) { - if (data[index] != JAVAZM_LABEL[index]) { - System.err.println("ZoneInfoOld: wrong magic number: " + JAVAZM_FILE_NAME); - return null; - } - } - if (data[index++] > JAVAZM_VERSION) { - System.err.println("ZoneInfoOld: incompatible version (" - + data[index - 1] + "): " + JAVAZM_FILE_NAME); - return null; - } - - zoneInfoMappings = new SoftReference<>(data); - return data; - } - - /** - * Reads the specified file under <java.home>/lib/zi into a buffer. - * @return the buffer, or null if any I/O error occurred. - */ - private static byte[] readZoneInfoFile(final String fileName) { - if (fileName.indexOf("..") >= 0) { - return null; - } - byte[] buffer = null; - File file = new File(ziDir, fileName); - try { - int filesize = (int)file.length(); - if (filesize > 0) { - FileInputStream fis = new FileInputStream(file); - buffer = new byte[filesize]; - try { - if (fis.read(buffer) != filesize) { - throw new IOException("read error on " + fileName); - } - } finally { - fis.close(); - } - } - } catch (Exception ex) { - if (!(ex instanceof FileNotFoundException) || JAVAZM_FILE_NAME.equals(fileName)) { - System.err.println("ZoneInfoOld: " + ex.getMessage()); - } - } - return buffer; - } - - private ZoneInfoFile() { - } -} diff --git a/test/jdk/sun/util/calendar/zi/ZoneInfoOld.java b/test/jdk/sun/util/calendar/zi/ZoneInfoOld.java deleted file mode 100644 index 300b7f13ddd..00000000000 --- a/test/jdk/sun/util/calendar/zi/ZoneInfoOld.java +++ /dev/null @@ -1,1022 +0,0 @@ -/* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.lang.ref.SoftReference; -import java.time.ZoneOffset; -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.SimpleTimeZone; -import java.util.TimeZone; - -import sun.util.calendar.CalendarSystem; -import sun.util.calendar.CalendarDate; - -/** - * ZoneInfoOld is an implementation subclass of {@link - * java.util.TimeZone TimeZone} that represents GMT offsets and - * daylight saving time transitions of a time zone. - *

- * The daylight saving time transitions are described in the {@link - * #transitions transitions} table consisting of a chronological - * sequence of transitions of GMT offset and/or daylight saving time - * changes. Since all transitions are represented in UTC, in theory, - * ZoneInfoOld can be used with any calendar systems except - * for the {@link #getOffset(int,int,int,int,int,int) getOffset} - * method that takes Gregorian calendar date fields. - *

- * This table covers transitions from 1900 until 2100 (as of version - * 23), Before 1900, it assumes that there was no daylight saving - * time and the getOffset methods always return the - * {@link #getRawOffset} value. No Local Mean Time is supported. If a - * specified date is beyond the transition table and this time zone is - * supposed to observe daylight saving time in 2100, it delegates - * operations to a {@link java.util.SimpleTimeZone SimpleTimeZone} - * object created using the daylight saving time schedule as of 2100. - *

- * The date items, transitions, GMT offset(s), etc. are read from a database - * file. See {@link ZoneInfoFile} for details. - * @see java.util.SimpleTimeZone - * @since 1.4 - */ - -public class ZoneInfoOld extends TimeZone { - - // The constants assume no leap seconds support. - static final int SECOND_IN_MILLIS = 1000; - static final int MINUTE_IN_MILLIS = SECOND_IN_MILLIS * 60; - static final int HOUR_IN_MILLIS = MINUTE_IN_MILLIS * 60; - static final int DAY_IN_MILLIS = HOUR_IN_MILLIS * 24; - - private static final int UTC_TIME = 0; - private static final int STANDARD_TIME = 1; - private static final int WALL_TIME = 2; - - private static final long OFFSET_MASK = 0x0fL; - private static final long DST_MASK = 0xf0L; - private static final int DST_NSHIFT = 4; - // this bit field is reserved for abbreviation support - private static final long ABBR_MASK = 0xf00L; - private static final int TRANSITION_NSHIFT = 12; - - // IDs having conflicting data between Olson and JDK 1.1 - static final Map conflictingIDs = Map.of( - "EST", "America/Panama", - "MST", "America/Phoenix"); - - private static final CalendarSystem gcal = CalendarSystem.getGregorianCalendar(); - - /** - * The raw GMT offset in milliseconds between this zone and GMT. - * Negative offsets are to the west of Greenwich. To obtain local - * standard time, add the offset to GMT time. - * @serial - */ - int rawOffset; - - /** - * Difference in milliseconds from the original GMT offset in case - * the raw offset value has been modified by calling {@link - * #setRawOffset}. The initial value is 0. - * @serial - */ - int rawOffsetDiff = 0; - - /** - * A CRC32 value of all pairs of transition time (in milliseconds - * in long) in local time and its GMT offset (in - * seconds in int) in the chronological order. Byte - * values of each long and int are taken - * in the big endian order (i.e., MSB to LSB). - * @serial - */ - int checksum; - - /** - * The amount of time in milliseconds saved during daylight saving - * time. If useDaylight is false, this value is 0. - * @serial - */ - int dstSavings; - - /** - * This array describes transitions of GMT offsets of this time - * zone, including both raw offset changes and daylight saving - * time changes. - * A long integer consists of four bit fields. - *

    - *
  • The most significant 52-bit field represents transition - * time in milliseconds from Gregorian January 1 1970, 00:00:00 - * GMT.
  • - *
  • The next 4-bit field is reserved and must be 0.
  • - *
  • The next 4-bit field is an index value to {@link #offsets - * offsets[]} for the amount of daylight saving at the - * transition. If this value is zero, it means that no daylight - * saving, not the index value zero.
  • - *
  • The least significant 4-bit field is an index value to - * {@link #offsets offsets[]} for total GMT offset at the - * transition.
  • - *
- * If this time zone doesn't observe daylight saving time and has - * never changed any GMT offsets in the past, this value is null. - * @serial - */ - long[] transitions; - - /** - * This array holds all unique offset values in - * milliseconds. Index values to this array are stored in the - * transitions array elements. - * @serial - */ - int[] offsets; - - /** - * SimpleTimeZone parameter values. It has to have either 8 for - * {@link java.util.SimpleTimeZone#SimpleTimeZone(int, String, - * int, int , int , int , int , int , int , int , int) the - * 11-argument SimpleTimeZone constructor} or 10 for {@link - * java.util.SimpleTimeZone#SimpleTimeZone(int, String, int, int, - * int , int , int , int , int , int , int, int, int) the - * 13-argument SimpleTimeZone constructor} parameters. - * @serial - */ - int[] simpleTimeZoneParams; - - /** - * True if the raw GMT offset value would change after the time - * zone data has been generated; false, otherwise. The default - * value is false. - * @serial - */ - boolean willGMTOffsetChange = false; - - /** - * True if the object has been modified after its instantiation. - */ - transient private boolean dirty = false; - - private static final long serialVersionUID = 2653134537216586139L; - - /** - * A constructor. - */ - public ZoneInfoOld() { - } - - /** - * A Constructor for CustomID. - */ - public ZoneInfoOld(String ID, int rawOffset) { - this(ID, rawOffset, 0, 0, null, null, null, false); - } - - /** - * Constructs a ZoneInfoOld instance. - * - * @param ID time zone name - * @param rawOffset GMT offset in milliseconds - * @param dstSavings daylight saving value in milliseconds or 0 - * (zero) if this time zone doesn't observe Daylight Saving Time. - * @param checksum CRC32 value with all transitions table entry - * values - * @param transitions transition table - * @param offsets offset value table - * @param simpleTimeZoneParams parameter values for constructing - * SimpleTimeZone - * @param willGMTOffsetChange the value of willGMTOffsetChange - */ - ZoneInfoOld(String ID, - int rawOffset, - int dstSavings, - int checksum, - long[] transitions, - int[] offsets, - int[] simpleTimeZoneParams, - boolean willGMTOffsetChange) { - setID(ID); - this.rawOffset = rawOffset; - this.dstSavings = dstSavings; - this.checksum = checksum; - this.transitions = transitions; - this.offsets = offsets; - this.simpleTimeZoneParams = simpleTimeZoneParams; - this.willGMTOffsetChange = willGMTOffsetChange; - } - - /** - * Returns the difference in milliseconds between local time and UTC - * of given time, taking into account both the raw offset and the - * effect of daylight savings. - * - * @param date the milliseconds in UTC - * @return the milliseconds to add to UTC to get local wall time - */ - public int getOffset(long date) { - return getOffsets(date, null, UTC_TIME); - } - - public int getOffsets(long utc, int[] offsets) { - return getOffsets(utc, offsets, UTC_TIME); - } - - public int getOffsetsByStandard(long standard, int[] offsets) { - return getOffsets(standard, offsets, STANDARD_TIME); - } - - public int getOffsetsByWall(long wall, int[] offsets) { - return getOffsets(wall, offsets, WALL_TIME); - } - - private int getOffsets(long date, int[] offsets, int type) { - // if dst is never observed, there is no transition. - if (transitions == null) { - int offset = getLastRawOffset(); - if (offsets != null) { - offsets[0] = offset; - offsets[1] = 0; - } - return offset; - } - - date -= rawOffsetDiff; - int index = getTransitionIndex(date, type); - - // prior to the transition table, returns the raw offset. - // FIXME: should support LMT. - if (index < 0) { - int offset = getLastRawOffset(); - if (offsets != null) { - offsets[0] = offset; - offsets[1] = 0; - } - return offset; - } - - if (index < transitions.length) { - long val = transitions[index]; - int offset = this.offsets[(int)(val & OFFSET_MASK)] + rawOffsetDiff; - if (offsets != null) { - int dst = (int)((val >>> DST_NSHIFT) & 0xfL); - int save = (dst == 0) ? 0 : this.offsets[dst]; - offsets[0] = offset - save; - offsets[1] = save; - } - return offset; - } - - // beyond the transitions, delegate to SimpleTimeZone if there - // is a rule; otherwise, return rawOffset. - SimpleTimeZone tz = getLastRule(); - if (tz != null) { - int rawoffset = tz.getRawOffset(); - long msec = date; - if (type != UTC_TIME) { - msec -= rawOffset; - } - int dstoffset = tz.getOffset(msec) - rawOffset; - - // Check if it's in a standard-to-daylight transition. - if (dstoffset > 0 && tz.getOffset(msec - dstoffset) == rawoffset) { - dstoffset = 0; - } - - if (offsets != null) { - offsets[0] = rawoffset; - offsets[1] = dstoffset; - } - return rawoffset + dstoffset; - } - int offset = getLastRawOffset(); - if (offsets != null) { - offsets[0] = offset; - offsets[1] = 0; - } - return offset; - } - - private int getTransitionIndex(long date, int type) { - int low = 0; - int high = transitions.length - 1; - - while (low <= high) { - int mid = (low + high) / 2; - long val = transitions[mid]; - long midVal = val >> TRANSITION_NSHIFT; // sign extended - if (type != UTC_TIME) { - midVal += offsets[(int)(val & OFFSET_MASK)]; // wall time - } - if (type == STANDARD_TIME) { - int dstIndex = (int)((val >>> DST_NSHIFT) & 0xfL); - if (dstIndex != 0) { - midVal -= offsets[dstIndex]; // make it standard time - } - } - - if (midVal < date) { - low = mid + 1; - } else if (midVal > date) { - high = mid - 1; - } else { - return mid; - } - } - - // if beyond the transitions, returns that index. - if (low >= transitions.length) { - return low; - } - return low - 1; - } - - /** - * Returns the difference in milliseconds between local time and - * UTC, taking into account both the raw offset and the effect of - * daylight savings, for the specified date and time. This method - * assumes that the start and end month are distinct. This method - * assumes a Gregorian calendar for calculations. - *

- * Note: In general, clients should use - * {@link Calendar#ZONE_OFFSET Calendar.get(ZONE_OFFSET)} + - * {@link Calendar#DST_OFFSET Calendar.get(DST_OFFSET)} - * instead of calling this method. - * - * @param era The era of the given date. The value must be either - * GregorianCalendar.AD or GregorianCalendar.BC. - * @param year The year in the given date. - * @param month The month in the given date. Month is 0-based. e.g., - * 0 for January. - * @param day The day-in-month of the given date. - * @param dayOfWeek The day-of-week of the given date. - * @param millis The milliseconds in day in standard local time. - * @return The milliseconds to add to UTC to get local time. - */ - public int getOffset(int era, int year, int month, int day, - int dayOfWeek, int milliseconds) { - if (milliseconds < 0 || milliseconds >= DAY_IN_MILLIS) { - throw new IllegalArgumentException(); - } - - if (era == java.util.GregorianCalendar.BC) { // BC - year = 1 - year; - } else if (era != java.util.GregorianCalendar.AD) { - throw new IllegalArgumentException(); - } - - CalendarDate date = gcal.newCalendarDate(null); - date.setDate(year, month + 1, day); - if (gcal.validate(date) == false) { - throw new IllegalArgumentException(); - } - - // bug-for-bug compatible argument checking - if (dayOfWeek < java.util.GregorianCalendar.SUNDAY - || dayOfWeek > java.util.GregorianCalendar.SATURDAY) { - throw new IllegalArgumentException(); - } - - if (transitions == null) { - return getLastRawOffset(); - } - - long dateInMillis = gcal.getTime(date) + milliseconds; - dateInMillis -= (long) rawOffset; // make it UTC - return getOffsets(dateInMillis, null, UTC_TIME); - } - - /** - * Sets the base time zone offset from GMT. This operation - * modifies all the transitions of this ZoneInfoOld object, including - * historical ones, if applicable. - * - * @param offsetMillis the base time zone offset to GMT. - * @see getRawOffset - */ - public synchronized void setRawOffset(int offsetMillis) { - if (offsetMillis == rawOffset + rawOffsetDiff) { - return; - } - rawOffsetDiff = offsetMillis - rawOffset; - if (lastRule != null) { - lastRule.setRawOffset(offsetMillis); - } - dirty = true; - } - - /** - * Returns the GMT offset of the current date. This GMT offset - * value is not modified during Daylight Saving Time. - * - * @return the GMT offset value in milliseconds to add to UTC time - * to get local standard time - */ - public int getRawOffset() { - if (!willGMTOffsetChange) { - return rawOffset + rawOffsetDiff; - } - - int[] offsets = new int[2]; - getOffsets(System.currentTimeMillis(), offsets, UTC_TIME); - return offsets[0]; - } - - public boolean isDirty() { - return dirty; - } - - int getLastRawOffset() { - return rawOffset + rawOffsetDiff; - } - - /** - * Queries if this time zone uses Daylight Saving Time in the last known rule. - */ - public boolean useDaylightTime() { - return (simpleTimeZoneParams != null); - } - - @Override - public boolean observesDaylightTime() { - if (simpleTimeZoneParams != null) { - return true; - } - if (transitions == null) { - return false; - } - - // Look up the transition table to see if it's in DST right - // now or if there's any standard-to-daylight transition at - // any future. - long utc = System.currentTimeMillis() - rawOffsetDiff; - int index = getTransitionIndex(utc, UTC_TIME); - - // before transitions in the transition table - if (index < 0) { - return false; - } - - // the time is in the table range. - for (int i = index; i < transitions.length; i++) { - if ((transitions[i] & DST_MASK) != 0) { - return true; - } - } - // No further DST is observed. - return false; - } - - /** - * Queries if the specified date is in Daylight Saving Time. - */ - public boolean inDaylightTime(Date date) { - if (date == null) { - throw new NullPointerException(); - } - - if (transitions == null) { - return false; - } - - long utc = date.getTime() - rawOffsetDiff; - int index = getTransitionIndex(utc, UTC_TIME); - - // before transitions in the transition table - if (index < 0) { - return false; - } - - // the time is in the table range. - if (index < transitions.length) { - return (transitions[index] & DST_MASK) != 0; - } - - // beyond the transition table - SimpleTimeZone tz = getLastRule(); - if (tz != null) { - return tz.inDaylightTime(date); - } - return false; - } - - /** - * Returns the amount of time in milliseconds that the clock is advanced - * during daylight saving time is in effect in its last daylight saving time rule. - * - * @return the number of milliseconds the time is advanced with respect to - * standard time when daylight saving time is in effect. - */ - public int getDSTSavings() { - return dstSavings; - } - -// /** -// * @return the last year in the transition table or -1 if this -// * time zone doesn't observe any daylight saving time. -// */ -// public int getMaxTransitionYear() { -// if (transitions == null) { -// return -1; -// } -// long val = transitions[transitions.length - 1]; -// int offset = this.offsets[(int)(val & OFFSET_MASK)] + rawOffsetDiff; -// val = (val >> TRANSITION_NSHIFT) + offset; -// CalendarDate lastDate = Gregorian.getCalendarDate(val); -// return lastDate.getYear(); -// } - - /** - * Returns a string representation of this time zone. - * @return the string - */ - public String toString() { - return getClass().getName() + - "[id=\"" + getID() + "\"" + - ",offset=" + getLastRawOffset() + - ",dstSavings=" + dstSavings + - ",useDaylight=" + useDaylightTime() + - ",transitions=" + ((transitions != null) ? transitions.length : 0) + - ",lastRule=" + (lastRule == null ? getLastRuleInstance() : lastRule) + - "]"; - } - - /** - * Gets all available IDs supported in the Java run-time. - * - * @return an array of time zone IDs. - */ - public static String[] getAvailableIDs() { - List idList = ZoneInfoFile.getZoneIDs(); - List excluded = ZoneInfoFile.getExcludedZones(); - if (excluded != null) { - // List all zones from the idList and excluded lists - List list = new ArrayList<>(idList.size() + excluded.size()); - list.addAll(idList); - list.addAll(excluded); - idList = list; - } - String[] ids = new String[idList.size()]; - return idList.toArray(ids); - } - - /** - * Gets all available IDs that have the same value as the - * specified raw GMT offset. - * - * @param rawOffset the GMT offset in milliseconds. This - * value should not include any daylight saving time. - * - * @return an array of time zone IDs. - */ - public static String[] getAvailableIDs(int rawOffset) { - String[] result; - List matched = new ArrayList<>(); - List IDs = ZoneInfoFile.getZoneIDs(); - int[] rawOffsets = ZoneInfoFile.getRawOffsets(); - - loop: - for (int index = 0; index < rawOffsets.length; index++) { - if (rawOffsets[index] == rawOffset) { - byte[] indices = ZoneInfoFile.getRawOffsetIndices(); - for (int i = 0; i < indices.length; i++) { - if (indices[i] == index) { - matched.add(IDs.get(i++)); - while (i < indices.length && indices[i] == index) { - matched.add(IDs.get(i++)); - } - break loop; - } - } - } - } - - // We need to add any zones from the excluded zone list that - // currently have the same GMT offset as the specified - // rawOffset. The zones returned by this method may not be - // correct as of return to the caller if any GMT offset - // transition is happening during this GMT offset checking... - List excluded = ZoneInfoFile.getExcludedZones(); - if (excluded != null) { - for (String id : excluded) { - TimeZone zi = getTimeZone(id); - if (zi != null && zi.getRawOffset() == rawOffset) { - matched.add(id); - } - } - } - - result = new String[matched.size()]; - matched.toArray(result); - return result; - } - - /** - * Gets the ZoneInfoOld for the given ID. - * - * @param ID the ID for a ZoneInfoOld. See TimeZone for detail. - * - * @return the specified ZoneInfoOld object, or null if there is no - * time zone of the ID. - */ - public static TimeZone getTimeZone(String ID) { - String givenID = null; - - ZoneInfoOld zi = ZoneInfoFile.getZoneInfoOld(ID); - if (zi == null) { - // if we can't create an object for the ID, try aliases. - try { - Map map = getAliasTable(); - String alias = ID; - while ((alias = map.get(alias)) != null) { - zi = ZoneInfoFile.getZoneInfoOld(alias); - if (zi != null) { - zi.setID(ID); - zi = ZoneInfoFile.addToCache(ID, zi); - zi = (ZoneInfoOld) zi.clone(); - break; - } - } - } catch (Exception e) { - // ignore exceptions - } - } - - if (givenID != null && zi != null) { - zi.setID(givenID); - } - return zi; - } - - private transient SimpleTimeZone lastRule; - - /** - * Returns a SimpleTimeZone object representing the last GMT - * offset and DST schedule or null if this time zone doesn't - * observe DST. - */ - synchronized SimpleTimeZone getLastRule() { - if (lastRule == null) { - lastRule = getLastRuleInstance(); - } - return lastRule; - } - - /** - * Returns a SimpleTimeZone object that represents the last - * known daylight saving time rules. - * - * @return a SimpleTimeZone object or null if this time zone - * doesn't observe DST. - */ - public SimpleTimeZone getLastRuleInstance() { - if (simpleTimeZoneParams == null) { - return null; - } - if (simpleTimeZoneParams.length == 10) { - return new SimpleTimeZone(getLastRawOffset(), getID(), - simpleTimeZoneParams[0], - simpleTimeZoneParams[1], - simpleTimeZoneParams[2], - simpleTimeZoneParams[3], - simpleTimeZoneParams[4], - simpleTimeZoneParams[5], - simpleTimeZoneParams[6], - simpleTimeZoneParams[7], - simpleTimeZoneParams[8], - simpleTimeZoneParams[9], - dstSavings); - } - return new SimpleTimeZone(getLastRawOffset(), getID(), - simpleTimeZoneParams[0], - simpleTimeZoneParams[1], - simpleTimeZoneParams[2], - simpleTimeZoneParams[3], - simpleTimeZoneParams[4], - simpleTimeZoneParams[5], - simpleTimeZoneParams[6], - simpleTimeZoneParams[7], - dstSavings); - } - - /** - * Returns a copy of this ZoneInfoOld. - */ - public Object clone() { - ZoneInfoOld zi = (ZoneInfoOld) super.clone(); - zi.lastRule = null; - return zi; - } - - /** - * Returns a hash code value calculated from the GMT offset and - * transitions. - * @return a hash code of this time zone - */ - public int hashCode() { - return getLastRawOffset() ^ checksum; - } - - /** - * Compares the equity of two ZoneInfoOld objects. - * - * @param obj the object to be compared with - * @return true if given object is same as this ZoneInfoOld object, - * false otherwise. - */ - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof ZoneInfoOld)) { - return false; - } - ZoneInfoOld that = (ZoneInfoOld) obj; - return (getID().equals(that.getID()) - && (getLastRawOffset() == that.getLastRawOffset()) - && (checksum == that.checksum)); - } - - /** - * Returns true if this zone has the same raw GMT offset value and - * transition table as another zone info. If the specified - * TimeZone object is not a ZoneInfoOld instance, this method returns - * true if the specified TimeZone object has the same raw GMT - * offset value with no daylight saving time. - * - * @param other the ZoneInfoOld object to be compared with - * @return true if the given TimeZone has the same - * GMT offset and transition information; false, otherwise. - */ - public boolean hasSameRules(TimeZone other) { - if (this == other) { - return true; - } - if (other == null) { - return false; - } - if (!(other instanceof ZoneInfoOld)) { - if (getRawOffset() != other.getRawOffset()) { - return false; - } - // if both have the same raw offset and neither observes - // DST, they have the same rule. - if ((transitions == null) - && (useDaylightTime() == false) - && (other.useDaylightTime() == false)) { - return true; - } - return false; - } - if (getLastRawOffset() != ((ZoneInfoOld)other).getLastRawOffset()) { - return false; - } - return (checksum == ((ZoneInfoOld)other).checksum); - } - - private static SoftReference> aliasTable; - - static Map getCachedAliasTable() { - Map aliases = null; - - SoftReference> cache = aliasTable; - if (cache != null) { - aliases = cache.get(); - } - return aliases; - } - - /** - * Returns a Map from alias time zone IDs to their standard - * time zone IDs. - * - * @return the Map that holds the mappings from alias time zone IDs - * to their standard time zone IDs, or null if - * ZoneInfoOldMappings file is not available. - */ - public synchronized static Map getAliasTable() { - Map aliases = getCachedAliasTable(); - if (aliases == null) { - aliases = ZoneInfoFile.getZoneAliases(); - if (aliases != null) { - // Replace old mappings from `jdk11_backward` - aliases.putAll(conflictingIDs); - aliasTable = new SoftReference>(aliases); - } - } - return aliases; - } - - private void readObject(ObjectInputStream stream) - throws IOException, ClassNotFoundException { - stream.defaultReadObject(); - // We don't know how this object from 1.4.x or earlier has - // been mutated. So it should always be marked as `dirty'. - dirty = true; - } - - ////////////////////////////////////////////////////////////// - public boolean equalsTo(ZoneInfoOld other) { - return (getID().equals(other.getID()) - && (getLastRawOffset() == other.getLastRawOffset()) - && (dstSavings == other.dstSavings) - && (willGMTOffsetChange == other.willGMTOffsetChange) - && (checksum == other.checksum) - && equalsTransOffsets(other) - && (Arrays.equals(simpleTimeZoneParams, other.simpleTimeZoneParams) || - getLastRule().equals(other.getLastRule()))); - } - - private boolean equalsTransOffsets(ZoneInfoOld other) { - if (transitions == null) { - return (other.transitions == null && - Arrays.equals(offsets, other.offsets)); - } - if (other.transitions == null || - transitions.length != other.transitions.length) { - return false; - } - // if offsets and other.offsets have different order - // the last 4-bit in trans are different. - for (int i = 0; i < transitions.length; i++) { - long val = transitions[i]; - int dst = (int)((val >>> DST_NSHIFT) & 0xfL); - int save = (dst == 0) ? 0 : offsets[dst] / 1000; - int off = offsets[(int)(val & OFFSET_MASK)]/1000; - long second = (val >> TRANSITION_NSHIFT)/1000; - - val = other.transitions[i]; - int dstO = (int)((val >>> DST_NSHIFT) & 0xfL); - int saveO = (dstO == 0) ? 0 : other.offsets[dstO] / 1000; - int offO = other.offsets[(int)(val & OFFSET_MASK)]/1000; - long secondO = (val >> TRANSITION_NSHIFT)/1000; - if ((dst == 0) != (dstO == 0) || save != saveO || off != offO || second != secondO) - return false; - } - return true; - } - - private int transToString(long val, int off_old, int[] offsets, StringBuilder sb) { - int dst = (int)((val >>> DST_NSHIFT) & 0xfL); - int save = (dst == 0) ? 0 : offsets[dst] / 1000; - int off = offsets[(int)(val & OFFSET_MASK)]/1000; - long second = (val >> TRANSITION_NSHIFT)/1000; - ZoneOffset offset_old = ZoneOffset.ofTotalSeconds(off_old); - ZoneOffset offset = ZoneOffset.ofTotalSeconds(off); - sb.append(" " + LocalDateTime.ofEpochSecond(second, 0, offset_old)); - - sb.append(" [utc=" + second + - " raw=" + Long.toHexString(val >> TRANSITION_NSHIFT) + - ", offset=" + off + "/" + offset + ", saving=" + save + "]"); - return off; - } - - public String diffsTo(ZoneInfoOld other) { - - int rawOffset0 = other.rawOffset; - int checksum0 = other.checksum; - int dstSavings0 = other.dstSavings; - long[] transitions0 = other.transitions; - int[] offsets0 = other.offsets; - int[] simpleTimeZoneParams0 = other.simpleTimeZoneParams; - boolean willGMTOffsetChange0 = other.willGMTOffsetChange; - - - //return getClass().getName() + - StringBuilder sb = new StringBuilder(); - sb.append("******************************\n" + - getID() + " : " + other.getID()); - // ROC is excluded by ZoneInfoOld - if ("ROC".equals(getID())) { - return sb.toString(); - } - if (rawOffset != rawOffset0 || - dstSavings != dstSavings0 || - checksum != checksum0 || - willGMTOffsetChange != willGMTOffsetChange0 || - (simpleTimeZoneParams != null ) != (simpleTimeZoneParams0 != null) || - (transitions != null && transitions0 != null && - transitions.length != transitions0.length)) - { - sb.append("\n offset=" + getLastRawOffset() + - ",dstSavings=" + dstSavings + - ",useDaylight=" + useDaylightTime() + - ",transitions=" + ((transitions != null) ? transitions.length : 0) + - ",offsets=" + ((offsets != null) ? offsets.length : 0) + - ",checksum=" + checksum + - ",gmtChanged=" + willGMTOffsetChange) - .append("\n[NG]offset=" + rawOffset0 + - ",dstSavings=" + dstSavings0 + - ",useDaylight=" + (simpleTimeZoneParams != null) + - ",transitions=" + ((transitions0 != null) ? transitions0.length : 0) + - ",offsets=" + ((offsets0 != null) ? offsets0.length : 0) + - ",checksum=" + checksum0 + - ",gmtChanged=" + willGMTOffsetChange0 + - ""); - } - // offsets - if (!Arrays.equals(offsets, offsets0)) { - sb.append("\n offset.len=" + ((offsets != null)? offsets.length : "null") + - " " + ((offsets0 != null)? offsets0.length : "null")); - if (offsets != null && offsets0.length != 0) { - int len = Math.min(offsets.length, offsets0.length); - int i = 0; - for (i = 0; i < len; i++) { - sb.append("\n " + - ZoneOffset.ofTotalSeconds(offsets[i]/1000) + " " + - ZoneOffset.ofTotalSeconds(offsets0[i]/1000)); - } - for (; i < offsets0.length; i++) { - sb.append("\n " + ZoneOffset.ofTotalSeconds(offsets0[i]/1000)); - } - } - } - // trans - int offset = 0; - int offset0 = 0; - if (!equalsTransOffsets(other)) { - sb.append("\n -------------"); - if ((transitions == null) != (transitions0 == null)) { - sb.append("\n (NG) Different trans(null) :" + - transitions + ", " + transitions0); - if (transitions != null) { - for (int i = 0; i < transitions.length; i++) { - sb.append("\n (NG)"); - offset = transToString(transitions[i], offset, offsets, sb); - } - } - } else { - if (transitions.length != transitions0.length) { - sb.append("\n (NG) Different trans size :" + - transitions.length + ", " + transitions0.length); - } - int length = Math.min(transitions.length, transitions0.length); - for (int i = 0; i < length; i++) { - // sb.append("\n[" + i + "] "); - // offset = transToString(transitions[i], offset, offsets, sb); - long val = transitions[i]; - int dst = (int)((val >>> DST_NSHIFT) & 0xfL); - int save = (dst == 0) ? 0 : offsets[dst] / 1000; - int off = offsets[(int)(val & OFFSET_MASK)]/1000; - long second = (val >> TRANSITION_NSHIFT)/1000; - sb.append("\n "); - offset = transToString(transitions[i], offset, offsets, sb); - if (transitions0 == null || i >= transitions0.length) { - sb.append("\n "); - offset = transToString(transitions[i], offset, offsets, sb); - sb.append("\n (NG) trans0 is null or < trans.length"); - } else { - long val0 = transitions0[i]; - int dst0 = (int)((val0 >>> DST_NSHIFT) & 0xfL); - int save0 = (dst0 == 0) ? 0 : offsets0[dst0] / 1000; - int off0 = offsets0[(int)(val0 & OFFSET_MASK)]/1000; - long second0 = (val0 >> TRANSITION_NSHIFT)/1000; - if (save != save0 || off != off0 || second != second0) { - sb.append("\n (NG)"); - } else { - sb.append("\n (OK)"); - } - offset0 = transToString(transitions0[i], offset0, offsets0, sb); - sb.append("\n -----"); - } - } - } - } - SimpleTimeZone stz = getLastRuleInstance(); - if (stz != null) { - SimpleTimeZone stz0 = other.getLastRule(); - if (!stz.hasSameRules(stz0)) { - sb.append("\n -------------") - .append("\n SimpleTimeZone (NG)") - .append("\n stz=" + stz) - .append("\n stz0=" + stz0); - } - } - sb.append("\n -------------"); - return sb.toString(); - } -} diff --git a/test/jdk/sun/util/calendar/zi/ZoneRec.java b/test/jdk/sun/util/calendar/zi/ZoneRec.java deleted file mode 100644 index f6bbeb3a199..00000000000 --- a/test/jdk/sun/util/calendar/zi/ZoneRec.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.StringTokenizer; - -/** - * ZoneRec hold information of time zone corresponding to each text - * line of the "Zone" part. - * - * @since 1.4 - */ -class ZoneRec { - private int gmtOffset; - private String ruleName; - private int directSave; - private Rule ruleRef; - private String format; - private boolean hasUntil; - private int untilYear; - private Month untilMonth; - private RuleDay untilDay; - private Time untilTime; - private long untilInMillis; - private String line; - - /** - * @return the "UNTIL" value in milliseconds - */ - Time getUntilTime() { - return untilTime; - } - - /** - * @return the GMT offset value in milliseconds - */ - int getGmtOffset() { - return gmtOffset; - } - - /** - * @return the rule name to which this zone record refers - */ - String getRuleName() { - return ruleName; - } - - /** - * @return the amount of saving time directly defined in the - * "RULES/SAVE" field. - */ - int getDirectSave() { - return directSave; - } - - /** - * @return true if this zone record has a reference to a rule - */ - boolean hasRuleReference() { - return ruleRef != null; - } - - /** - * Returns the "FORMAT" field string of this zone record. This - * @return the "FORMAT" field - */ - String getFormat() { - return format; - } - - /** - * @return the year in the "UNTIL" field - */ - int getUntilYear() { - return untilYear; - } - - /** - * Returns the "UNTIL" field value in milliseconds from Janurary - * 1, 1970 0:00 GMT. - * @param currentSave the amount of daylight saving in - * milliseconds that is used to adjust wall-clock time. - * @return the milliseconds value of the "UNTIL" field - */ - long getUntilTime(int currentSave) { - if (untilTime.isWall()) { - return untilInMillis - currentSave; - } - return untilInMillis; - } - - /** - * Returns the "UNTIL" time in milliseconds without adjusting GMT - * offsets or daylight saving. - * @return local "UNTIL" time in milliseconds - */ - long getLocalUntilTime() { - return Time.getLocalTime(untilYear, - untilMonth, - untilDay, - untilTime.getTime()); - } - - /** - * Returns the "UNTIL" time in milliseconds with adjusting GMT offsets and daylight saving. - * @return the "UNTIL" time after the adjustment - */ - long getLocalUntilTime(int save, int gmtOffset) { - return Time.getLocalTime(untilYear, - untilMonth, - untilDay, - save, - gmtOffset, - untilTime); - } - - /** - * @return the text line of this zone record - */ - String getLine() { - return line; - } - - /** - * Sets the specified text line to this zone record - */ - void setLine(String line) { - this.line = line; - } - - /** - * @return true if this zone record has the "UNTIL" field - */ - boolean hasUntil() { - return this.hasUntil; - } - - /** - * Adjusts the "UNTIL" time to GMT offset if this zone record has - * it. untilTime is not adjusted to daylight saving - * in this method. - */ - void adjustTime() { - if (!hasUntil()) { - return; - } - if (untilTime.isSTD() || untilTime.isWall()) { - // adjust to gmt offset only here. adjust to real - // wall-clock time when tracking rules - untilInMillis -= gmtOffset; - } - } - - /** - * @return the reference to the Rule object - */ - Rule getRuleRef() { - return ruleRef; - } - - /** - * Resolves the reference to a Rule and adjusts its "UNTIL" time - * to GMT offset. - */ - void resolve(Zoneinfo zi) { - if (ruleName != null && (!"-".equals(ruleName))) { - ruleRef = zi.getRule(ruleName); - } - adjustTime(); - } - - /** - * Parses a Zone text line that is described by a StringTokenizer. - * @param tokens represents tokens of a Zone text line - * @return the zone record produced by parsing the text - */ - static ZoneRec parse(StringTokenizer tokens) { - ZoneRec rec = new ZoneRec(); - try { - rec.gmtOffset = (int) Time.parse(tokens.nextToken()).getTime(); - String token = tokens.nextToken(); - char c = token.charAt(0); - if (c >= '0' && c <= '9') { - rec.directSave = (int) Time.parse(token).getTime(); - } else { - rec.ruleName = token; - } - rec.format = tokens.nextToken(); - if (tokens.hasMoreTokens()) { - rec.hasUntil = true; - rec.untilYear = Integer.parseInt(tokens.nextToken()); - if (tokens.hasMoreTokens()) { - rec.untilMonth = Month.parse(tokens.nextToken()); - } else { - rec.untilMonth = Month.JANUARY; - } - if (tokens.hasMoreTokens()) { - rec.untilDay = RuleDay.parse(tokens.nextToken()); - } else { - rec.untilDay = new RuleDay(1); - } - if (tokens.hasMoreTokens()) { - rec.untilTime = Time.parse(tokens.nextToken()); - } else { - rec.untilTime = Time.parse("0:00"); - } - rec.untilInMillis = rec.getLocalUntilTime(); - } - } catch (Exception e) { - // TODO: error reporting - e.printStackTrace(); - } - return rec; - } - - private static void panic(String msg) { - Main.panic(msg); - } -} diff --git a/test/jdk/sun/util/calendar/zi/Zoneinfo.java b/test/jdk/sun/util/calendar/zi/Zoneinfo.java deleted file mode 100644 index e125ad2cb87..00000000000 --- a/test/jdk/sun/util/calendar/zi/Zoneinfo.java +++ /dev/null @@ -1,579 +0,0 @@ -/* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. - * 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. - * - * 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. - */ - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -/** - * Zoneinfo provides javazic compiler front-end functionality. - * @since 1.4 - */ -class Zoneinfo { - - private static final int minYear = 1900; - private static final int maxYear = 2100; - private static final long minTime = Time.getLocalTime(minYear, Month.JANUARY, 1, 0); - private static int startYear = minYear; - private static int endYear = maxYear; - - /** - * True if javazic should generate a list of SimpleTimeZone - * instances for the SimpleTimeZone-based time zone support. - */ - static boolean isYearForTimeZoneDataSpecified = false; - - /** - * Zone name to Zone mappings - */ - private Map zones; - - /** - * Rule name to Rule mappings - */ - private Map rules; - - /** - * Alias name to real name mappings - */ - private Map aliases; - - /** - * Constracts a Zoneinfo. - */ - Zoneinfo() { - zones = new HashMap(); - rules = new HashMap(); - aliases = new HashMap(); - } - - /** - * Adds the given zone to the list of Zones. - * @param zone Zone to be added to the list. - */ - void add(Zone zone) { - String name = zone.getName(); - zones.put(name, zone); - } - - /** - * Adds the given rule to the list of Rules. - * @param rule Rule to be added to the list. - */ - void add(Rule rule) { - String name = rule.getName(); - rules.put(name, rule); - } - - /** - * Puts the specifid name pair to the alias table. - * @param name1 an alias time zone name - * @param name2 the real time zone of the alias name - */ - void putAlias(String name1, String name2) { - aliases.put(name1, name2); - } - - /** - * Sets the given year for SimpleTimeZone list output. - * This method is called when the -S option is specified. - * @param year the year for which SimpleTimeZone list should be generated - */ - static void setYear(int year) { - setStartYear(year); - setEndYear(year); - isYearForTimeZoneDataSpecified = true; - } - - /** - * Sets the start year. - * @param year the start year value - * @throws IllegalArgumentException if the specified year value is - * smaller than the minimum year or greater than the end year. - */ - static void setStartYear(int year) { - if (year < minYear || year > endYear) { - throw new IllegalArgumentException("invalid start year specified: " + year); - } - startYear = year; - } - - /** - * @return the start year value - */ - static int getStartYear() { - return startYear; - } - - /** - * Sets the end year. - * @param year the end year value - * @throws IllegalArgumentException if the specified year value is - * smaller than the start year or greater than the maximum year. - */ - static void setEndYear(int year) { - if (year < startYear || year > maxYear) { - throw new IllegalArgumentException(); - } - endYear = year; - } - - /** - * @return the end year value - */ - static int getEndYear() { - return endYear; - } - - /** - * @return the minimum year value - */ - static int getMinYear() { - return minYear; - } - - /** - * @return the maximum year value - */ - static int getMaxYear() { - return maxYear; - } - - /** - * @return the alias table - */ - Map getAliases() { - return aliases; - } - - /** - * @return the Zone list - */ - Map getZones() { - return zones; - } - - /** - * @return a Zone specified by name. - * @param name a zone name - */ - Zone getZone(String name) { - return zones.get(name); - } - - /** - * @return a Rule specified by name. - * @param name a rule name - */ - Rule getRule(String name) { - return rules.get(name); - } - - private static String line; - - private static int lineNum; - - /** - * Parses the specified time zone data file and creates a Zoneinfo - * that has all Rules, Zones and Links (aliases) information. - * @param fname the time zone data file name - * @return a Zoneinfo object - */ - static Zoneinfo parse(String fname) { - BufferedReader in = null; - try { - FileReader fr = new FileReader(fname); - in = new BufferedReader(fr); - } catch (FileNotFoundException e) { - panic("can't open file: "+fname); - } - Zoneinfo zi = new Zoneinfo(); - boolean continued = false; - Zone zone = null; - String l; - lineNum = 0; - - try { - while ((line = in.readLine()) != null) { - lineNum++; - // skip blank and comment lines - if (line.length() == 0 || line.charAt(0) == '#') { - continue; - } - - // trim trailing comments - int rindex = line.lastIndexOf('#'); - if (rindex != -1) { - // take the data part of the line - l = line.substring(0, rindex); - } else { - l = line; - } - - StringTokenizer tokens = new StringTokenizer(l); - if (!tokens.hasMoreTokens()) { - continue; - } - String token = tokens.nextToken(); - int len = token.length(); - - if (continued || token.regionMatches(true, 0, "Zone", 0, len)){ - if (zone == null) { - if (!tokens.hasMoreTokens()) { - panic("syntax error: zone no more token"); - } - token = tokens.nextToken(); - // if the zone name is in "GMT+hh" or "GMT-hh" - // format, ignore it due to spec conflict. - if (token.startsWith("GMT+") || token.startsWith("GMT-")) { - continue; - } - zone = new Zone(token); - } else { - // no way to push the current token back... - tokens = new StringTokenizer(l); - } - - ZoneRec zrec = ZoneRec.parse(tokens); - zrec.setLine(line); - zone.add(zrec); - if ((continued = zrec.hasUntil()) == false) { - if (Zone.isTargetZone(zone.getName())) { - // zone.resolve(zi); - zi.add(zone); - } - zone = null; - } - } else if (token.regionMatches(true, 0, "Rule", 0, len)) { - if (!tokens.hasMoreTokens()) { - panic("syntax error: rule no more token"); - } - token = tokens.nextToken(); - Rule rule = zi.getRule(token); - if (rule == null) { - rule = new Rule(token); - zi.add(rule); - } - RuleRec rrec = RuleRec.parse(tokens); - rrec.setLine(line); - rule.add(rrec); - } else if (token.regionMatches(true, 0, "Link", 0, len)) { - // Link - try { - String name1 = tokens.nextToken(); - String name2 = tokens.nextToken(); - - // if the zone name is in "GMT+hh" or "GMT-hh" - // format, ignore it due to spec conflict with - // custom time zones. Also, ignore "ROC" for - // PC-ness. - if (name2.startsWith("GMT+") || name2.startsWith("GMT-") - || "ROC".equals(name2)) { - continue; - } - zi.putAlias(name2, name1); - } catch (Exception e) { - panic("syntax error: no more token for Link"); - } - } - } - in.close(); - } catch (IOException ex) { - panic("IO error: " + ex.getMessage()); - } - - return zi; - } - - /** - * Interprets a zone and constructs a Timezone object that - * contains enough information on GMT offsets and DST schedules to - * generate a zone info database. - * - * @param zoneName the zone name for which a Timezone object is - * constructed. - * - * @return a Timezone object that contains all GMT offsets and DST - * rules information. - */ - Timezone phase2(String zoneName) { - Timezone tz = new Timezone(zoneName); - Zone zone = getZone(zoneName); - zone.resolve(this); - - // TODO: merge phase2's for the regular and SimpleTimeZone ones. - if (isYearForTimeZoneDataSpecified) { - ZoneRec zrec = zone.get(zone.size()-1); - tz.setLastZoneRec(zrec); - tz.setRawOffset(zrec.getGmtOffset()); - if (zrec.hasRuleReference()) { - /* - * This part assumes that the specified year is covered by - * the rules referred to by the last zone record. - */ - List rrecs = zrec.getRuleRef().getRules(startYear); - - if (rrecs.size() == 2) { - // make sure that one is a start rule and the other is - // an end rule. - RuleRec r0 = rrecs.get(0); - RuleRec r1 = rrecs.get(1); - if (r0.getSave() == 0 && r1.getSave() > 0) { - rrecs.set(0, r1); - rrecs.set(1, r0); - } else if (!(r0.getSave() > 0 && r1.getSave() == 0)) { - rrecs = null; - Main.error(zoneName + ": rules for " + startYear + " not found."); - } - } else { - rrecs = null; - } - if (rrecs != null) { - tz.setLastRules(rrecs); - } - } - return tz; - } - - int gmtOffset; - int year = minYear; - int fromYear = year; - long fromTime = Time.getLocalTime(startYear, - Month.JANUARY, - 1, 0); - - // take the index 0 for the GMT offset of the last zone record - ZoneRec zrec = zone.get(zone.size()-1); - tz.getOffsetIndex(zrec.getGmtOffset()); - - int lastGmtOffsetValue = -1; - ZoneRec prevzrec = null; - int currentSave = 0; - boolean usedZone; - for (int zindex = 0; zindex < zone.size(); zindex++) { - zrec = zone.get(zindex); - usedZone = false; - gmtOffset = zrec.getGmtOffset(); - int stdOffset = zrec.getDirectSave(); - - if (gmtOffset != lastGmtOffsetValue) { - tz.setRawOffset(gmtOffset, fromTime); - lastGmtOffsetValue = gmtOffset; - } - // If this is the last zone record, take the last rule info. - if (!zrec.hasUntil()) { - if (zrec.hasRuleReference()) { - tz.setLastRules(zrec.getRuleRef().getLastRules()); - } else if (stdOffset != 0) { - // in case the last rule is all year round DST-only - // (Asia/Amman once announced this rule.) - tz.setLastDSTSaving(stdOffset); - } - } - if (!zrec.hasRuleReference()) { - if (!zrec.hasUntil() || zrec.getUntilTime(stdOffset) >= fromTime) { - tz.addTransition(fromTime, - tz.getOffsetIndex(gmtOffset+stdOffset), - tz.getDstOffsetIndex(stdOffset)); - usedZone = true; - } - currentSave = stdOffset; - // optimization in case the last rule is fixed. - if (!zrec.hasUntil()) { - if (tz.getNTransitions() > 0) { - if (stdOffset == 0) { - tz.setDSTType(Timezone.X_DST); - } else { - tz.setDSTType(Timezone.LAST_DST); - } - long time = Time.getLocalTime(maxYear, - Month.JANUARY, 1, 0); - time -= zrec.getGmtOffset(); - tz.addTransition(time, - tz.getOffsetIndex(gmtOffset+stdOffset), - tz.getDstOffsetIndex(stdOffset)); - tz.addUsedRec(zrec); - } else { - tz.setDSTType(Timezone.NO_DST); - } - break; - } - } else { - Rule rule = zrec.getRuleRef(); - boolean fromTimeUsed = false; - currentSave = 0; - year_loop: - for (year = getMinYear(); year <= endYear; year++) { - if (zrec.hasUntil() && year > zrec.getUntilYear()) { - break; - } - List rules = rule.getRules(year); - if (rules.size() > 0) { - for (int i = 0; i < rules.size(); i++) { - RuleRec rrec = rules.get(i); - long transition = rrec.getTransitionTime(year, - gmtOffset, - currentSave); - if (zrec.hasUntil()) { - if (transition >= zrec.getUntilTime(currentSave)) { - // If the GMT offset changed from the previous one, - // record fromTime as a transition. - if (!fromTimeUsed && prevzrec != null - && gmtOffset != prevzrec.getGmtOffset()) { - tz.addTransition(fromTime, - tz.getOffsetIndex(gmtOffset+currentSave), - tz.getDstOffsetIndex(currentSave)); - fromTimeUsed = true; // for consistency - } - break year_loop; - } - } - - if (fromTimeUsed == false) { - if (fromTime <= transition) { - fromTimeUsed = true; - - if (fromTime != minTime) { - int prevsave; - - // See if until time in the previous - // ZoneRec is the same thing as the - // local time in the next rule. - // (examples are Asia/Ashkhabad in 1991, - // Europe/Riga in 1989) - - if (i > 0) { - prevsave = rules.get(i-1).getSave(); - } else { - List prevrules = rule.getRules(year-1); - - if (prevrules.size() > 0) { - prevsave = prevrules.get(prevrules.size()-1).getSave(); - } else { - prevsave = 0; - } - } - - if (rrec.isSameTransition(prevzrec, prevsave, gmtOffset)) { - currentSave = rrec.getSave(); - tz.addTransition(fromTime, - tz.getOffsetIndex(gmtOffset+currentSave), - tz.getDstOffsetIndex(currentSave)); - tz.addUsedRec(rrec); - usedZone = true; - continue; - } - if (!prevzrec.hasRuleReference() - || rule != prevzrec.getRuleRef() - || (rule == prevzrec.getRuleRef() - && gmtOffset != prevzrec.getGmtOffset())) { - int save = (fromTime == transition) ? rrec.getSave() : currentSave; - tz.addTransition(fromTime, - tz.getOffsetIndex(gmtOffset+save), - tz.getDstOffsetIndex(save)); - tz.addUsedRec(rrec); - usedZone = true; - } - } else { // fromTime == minTime - int save = rrec.getSave(); - tz.addTransition(minTime, - tz.getOffsetIndex(gmtOffset), - tz.getDstOffsetIndex(0)); - - tz.addTransition(transition, - tz.getOffsetIndex(gmtOffset+save), - tz.getDstOffsetIndex(save)); - - tz.addUsedRec(rrec); - usedZone = true; - } - } else if (year == fromYear && i == rules.size()-1) { - int save = rrec.getSave(); - tz.addTransition(fromTime, - tz.getOffsetIndex(gmtOffset+save), - tz.getDstOffsetIndex(save)); - } - } - - currentSave = rrec.getSave(); - if (fromTime < transition) { - tz.addTransition(transition, - tz.getOffsetIndex(gmtOffset+currentSave), - tz.getDstOffsetIndex(currentSave)); - tz.addUsedRec(rrec); - usedZone = true; - } - } - } else { - if (year == fromYear) { - tz.addTransition(fromTime, - tz.getOffsetIndex(gmtOffset+currentSave), - tz.getDstOffsetIndex(currentSave)); - fromTimeUsed = true; - } - if (year == endYear && !zrec.hasUntil()) { - if (tz.getNTransitions() > 0) { - // Assume that this Zone stopped DST - tz.setDSTType(Timezone.X_DST); - long time = Time.getLocalTime(maxYear, Month.JANUARY, - 1, 0); - time -= zrec.getGmtOffset(); - tz.addTransition(time, - tz.getOffsetIndex(gmtOffset), - tz.getDstOffsetIndex(0)); - usedZone = true; - } else { - tz.setDSTType(Timezone.NO_DST); - } - } - } - } - } - if (usedZone) { - tz.addUsedRec(zrec); - } - if (zrec.hasUntil() && zrec.getUntilTime(currentSave) > fromTime) { - fromTime = zrec.getUntilTime(currentSave); - fromYear = zrec.getUntilYear(); - year = zrec.getUntilYear(); - } - prevzrec = zrec; - } - - if (tz.getDSTType() == Timezone.UNDEF_DST) { - tz.setDSTType(Timezone.DST); - } - tz.optimize(); - tz.checksum(); - return tz; - } - - private static void panic(String msg) { - Main.panic(msg); - } -} diff --git a/test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_backward b/test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_backward deleted file mode 100644 index e480a0083be..00000000000 --- a/test/jdk/sun/util/calendar/zi/tzdata_jdk/jdk11_backward +++ /dev/null @@ -1,78 +0,0 @@ -# -# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. -# 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. -# -# 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. -# -# JDK 1.1.x compatible time zone IDs -# - -Link Australia/Darwin ACT -Link Australia/Sydney AET -Link America/Argentina/Buenos_Aires AGT -Link Africa/Cairo ART -Link America/Anchorage AST -Link America/Sao_Paulo BET -Link Asia/Dhaka BST -Link Africa/Harare CAT -Link America/St_Johns CNT -Link America/Chicago CST -Link Asia/Shanghai CTT -Link Africa/Addis_Ababa EAT -Link Europe/Paris ECT -Link America/New_York EST -Link Pacific/Honolulu HST -Link America/Indianapolis IET -Link Asia/Calcutta IST -Link Asia/Tokyo JST -Link Pacific/Apia MIT -Link America/Denver MST -Link Asia/Yerevan NET -Link Pacific/Auckland NST -Link Asia/Karachi PLT -Link America/Phoenix PNT -Link America/Puerto_Rico PRT -Link America/Los_Angeles PST -Link Pacific/Guadalcanal SST -Link Asia/Saigon VST - -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule SystemV min 1973 - Apr lastSun 2:00 1:00 D -Rule SystemV min 1973 - Oct lastSun 2:00 0 S -Rule SystemV 1974 only - Jan 6 2:00 1:00 D -Rule SystemV 1974 only - Nov lastSun 2:00 0 S -Rule SystemV 1975 only - Feb 23 2:00 1:00 D -Rule SystemV 1975 only - Oct lastSun 2:00 0 S -Rule SystemV 1976 max - Apr lastSun 2:00 1:00 D -Rule SystemV 1976 max - Oct lastSun 2:00 0 S - -# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] -Zone SystemV/AST4ADT -4:00 SystemV A%sT -Zone SystemV/EST5EDT -5:00 SystemV E%sT -Zone SystemV/CST6CDT -6:00 SystemV C%sT -Zone SystemV/MST7MDT -7:00 SystemV M%sT -Zone SystemV/PST8PDT -8:00 SystemV P%sT -Zone SystemV/YST9YDT -9:00 SystemV Y%sT -Zone SystemV/AST4 -4:00 - AST -Zone SystemV/EST5 -5:00 - EST -Zone SystemV/CST6 -6:00 - CST -Zone SystemV/MST7 -7:00 - MST -Zone SystemV/PST8 -8:00 - PST -Zone SystemV/YST9 -9:00 - YST -Zone SystemV/HST10 -10:00 - HST diff --git a/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java b/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java index 827f7da624d..1ffe1240d07 100644 --- a/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java +++ b/test/jdk/tools/jlink/runtimeImage/AddOptionsTest.java @@ -40,7 +40,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m AddOptionsTest + * @run main/othervm -Xmx1g AddOptionsTest */ public class AddOptionsTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java b/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java index ebf5b060665..b0d2a2d66f5 100644 --- a/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java +++ b/test/jdk/tools/jlink/runtimeImage/BasicJlinkMissingJavaBase.java @@ -41,7 +41,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m BasicJlinkMissingJavaBase + * @run main/othervm -Xmx1g BasicJlinkMissingJavaBase */ public class BasicJlinkMissingJavaBase extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java index 8cbd74e5ed1..b97ebff9b49 100644 --- a/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java +++ b/test/jdk/tools/jlink/runtimeImage/BasicJlinkTest.java @@ -39,7 +39,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m BasicJlinkTest false + * @run main/othervm -Xmx1g BasicJlinkTest false */ public class BasicJlinkTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java index d6c237a173b..369bccfecfc 100644 --- a/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java +++ b/test/jdk/tools/jlink/runtimeImage/CustomModuleJlinkTest.java @@ -39,7 +39,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m CustomModuleJlinkTest + * @run main/othervm -Xmx1g CustomModuleJlinkTest */ public class CustomModuleJlinkTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java b/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java index e59d18bd6f0..533a8db30d0 100644 --- a/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java +++ b/test/jdk/tools/jlink/runtimeImage/GenerateJLIClassesTest.java @@ -39,7 +39,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m GenerateJLIClassesTest + * @run main/othervm -Xmx1g GenerateJLIClassesTest */ public class GenerateJLIClassesTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java b/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java index a376d075ecd..d923358aed9 100644 --- a/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java +++ b/test/jdk/tools/jlink/runtimeImage/JavaSEReproducibleTest.java @@ -40,7 +40,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m JavaSEReproducibleTest + * @run main/othervm -Xmx1g JavaSEReproducibleTest */ public class JavaSEReproducibleTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java b/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java index 6fdaf5a9824..8094579ecd5 100644 --- a/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java +++ b/test/jdk/tools/jlink/runtimeImage/KeepPackagedModulesFailTest.java @@ -41,7 +41,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m KeepPackagedModulesFailTest + * @run main/othervm -Xmx1g KeepPackagedModulesFailTest */ public class KeepPackagedModulesFailTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java index 777ce302ce7..443cbbaec3c 100644 --- a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java +++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesExitTest.java @@ -40,7 +40,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m ModifiedFilesExitTest + * @run main/othervm -Xmx1g ModifiedFilesExitTest */ public class ModifiedFilesExitTest extends ModifiedFilesTest { diff --git a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java index c871024f37c..619c67e01b4 100644 --- a/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java +++ b/test/jdk/tools/jlink/runtimeImage/ModifiedFilesWarningTest.java @@ -39,7 +39,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m ModifiedFilesWarningTest + * @run main/othervm -Xmx1g ModifiedFilesWarningTest */ public class ModifiedFilesWarningTest extends ModifiedFilesTest { diff --git a/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java b/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java index 0e2cabe7425..88f91f238bd 100644 --- a/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java +++ b/test/jdk/tools/jlink/runtimeImage/MultiHopTest.java @@ -40,7 +40,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m MultiHopTest + * @run main/othervm -Xmx1g MultiHopTest */ public class MultiHopTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java b/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java index d276e80702b..ef7030d2e62 100644 --- a/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java +++ b/test/jdk/tools/jlink/runtimeImage/PackagedModulesVsRuntimeImageLinkTest.java @@ -49,7 +49,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm/timeout=1200 -Xmx1400m PackagedModulesVsRuntimeImageLinkTest + * @run main/othervm/timeout=1200 -Xmx1g PackagedModulesVsRuntimeImageLinkTest */ public class PackagedModulesVsRuntimeImageLinkTest extends AbstractLinkableRuntimeTest { @@ -76,7 +76,6 @@ void runTest(Helper helper, boolean isLinkableRuntime) throws Exception { .output(helper.createNewImageDir("java-se-jmodfull")) .addMods("java.se").call().assertSuccess(); - System.out.println("Now comparing jmod-less and jmod-full) images"); compareRecursively(javaSEruntimeLink, javaSEJmodFull); } diff --git a/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java b/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java index d4654ec98bd..81579e0754b 100644 --- a/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java +++ b/test/jdk/tools/jlink/runtimeImage/PatchedJDKModuleJlinkTest.java @@ -42,7 +42,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m PatchedJDKModuleJlinkTest + * @run main/othervm -Xmx1g PatchedJDKModuleJlinkTest */ public class PatchedJDKModuleJlinkTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java index d0a6234eec0..fac8cac112d 100644 --- a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java +++ b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest.java @@ -41,7 +41,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m SystemModulesTest + * @run main/othervm -Xmx1g SystemModulesTest */ public class SystemModulesTest extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java index ee22a55f3a7..6be4ad7321c 100644 --- a/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java +++ b/test/jdk/tools/jlink/runtimeImage/SystemModulesTest2.java @@ -42,7 +42,7 @@ * jdk.jlink/jdk.tools.jimage * @build tests.* jdk.test.lib.process.OutputAnalyzer * jdk.test.lib.process.ProcessTools - * @run main/othervm -Xmx1400m SystemModulesTest2 + * @run main/othervm -Xmx1g SystemModulesTest2 */ public class SystemModulesTest2 extends AbstractLinkableRuntimeTest { diff --git a/test/jdk/tools/jpackage/share/LicenseTest.java b/test/jdk/tools/jpackage/share/LicenseTest.java index b0eef94fa7c..66cda39eec2 100644 --- a/test/jdk/tools/jpackage/share/LicenseTest.java +++ b/test/jdk/tools/jpackage/share/LicenseTest.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 @@ -29,6 +29,8 @@ import java.util.Arrays; import java.util.function.Function; import java.util.stream.Collectors; +import static jdk.internal.util.OperatingSystem.LINUX; +import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.PackageType; import jdk.jpackage.test.PackageTest; @@ -67,6 +69,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @compile LicenseTest.java + * @requires (jpackage.test.SQETest != null) * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=LicenseTest.testCommon */ @@ -78,18 +81,14 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @compile LicenseTest.java - * @requires (os.family == "linux") * @requires (jpackage.test.SQETest == null) * @run main/othervm/timeout=1440 -Xmx512m jdk.jpackage.test.Main - * --jpt-run=LicenseTest.testCustomDebianCopyright - * --jpt-run=LicenseTest.testCustomDebianCopyrightSubst - * --jpt-run=LicenseTest.testLinuxLicenseInUsrTree - * --jpt-run=LicenseTest.testLinuxLicenseInUsrTree2 - * --jpt-run=LicenseTest.testLinuxLicenseInUsrTree3 - * --jpt-run=LicenseTest.testLinuxLicenseInUsrTree4 + * --jpt-run=LicenseTest */ public class LicenseTest { + + @Test public static void testCommon() { PackageTest test = new PackageTest().configureHelloApp() .addInitializer(cmd -> { @@ -102,26 +101,32 @@ public static void testCommon() { test.run(); } + @Test(ifOS = LINUX) public static void testLinuxLicenseInUsrTree() { testLinuxLicenseInUsrTree("/usr"); } + @Test(ifOS = LINUX) public static void testLinuxLicenseInUsrTree2() { testLinuxLicenseInUsrTree("/usr/local"); } + @Test(ifOS = LINUX) public static void testLinuxLicenseInUsrTree3() { testLinuxLicenseInUsrTree("/usr/foo"); } + @Test(ifOS = LINUX) public static void testLinuxLicenseInUsrTree4() { testLinuxLicenseInUsrTree("/usrbuz"); } + @Test(ifOS = LINUX) public static void testCustomDebianCopyright() { new CustomDebianCopyrightTest().run(); } + @Test(ifOS = LINUX) public static void testCustomDebianCopyrightSubst() { new CustomDebianCopyrightTest().withSubstitution(true).run(); } diff --git a/test/jdk/tools/jpackage/share/RuntimeImageSymbolicLinksTest.java b/test/jdk/tools/jpackage/share/RuntimeImageSymbolicLinksTest.java index db74e3456c4..867ea571213 100644 --- a/test/jdk/tools/jpackage/share/RuntimeImageSymbolicLinksTest.java +++ b/test/jdk/tools/jpackage/share/RuntimeImageSymbolicLinksTest.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 @@ -23,6 +23,7 @@ import java.nio.file.Files; import java.nio.file.Path; +import static jdk.internal.util.OperatingSystem.WINDOWS; import jdk.jpackage.test.ApplicationLayout; import jdk.jpackage.test.TKit; import jdk.jpackage.test.Annotations.Test; @@ -49,7 +50,7 @@ public class RuntimeImageSymbolicLinksTest { - @Test + @Test(ifNotOS = WINDOWS) public static void test() throws Exception { final Path jmods = Path.of(System.getProperty("java.home"), "jmods"); final Path workDir = TKit.createTempDirectory("runtime").resolve("data"); diff --git a/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java b/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java index c6489ab68cf..7dcf025a506 100644 --- a/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java +++ b/test/jdk/tools/jpackage/windows/WinInstallerUiTest.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 @@ -122,13 +122,13 @@ private void setPackageName(JPackageCommand cmd) { StringBuilder sb = new StringBuilder(cmd.name()); sb.append("With"); if (withDirChooser) { - sb.append("DirChooser"); + sb.append("Dc"); // DirChooser } if (withShortcutPrompt) { - sb.append("ShortcutPrompt"); + sb.append("Sp"); // ShortcutPrompt } if (withLicense) { - sb.append("License"); + sb.append("L"); // License } cmd.setArgumentValue("--name", sb.toString()); } diff --git a/test/jdk/tools/jpackage/windows/WinLongPathTest.java b/test/jdk/tools/jpackage/windows/WinLongPathTest.java index e9e5ef8ce03..10e713f02a8 100644 --- a/test/jdk/tools/jpackage/windows/WinLongPathTest.java +++ b/test/jdk/tools/jpackage/windows/WinLongPathTest.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 @@ -30,6 +30,7 @@ import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.PackageType; import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.Executor; import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.RunnablePackageTest.Action; import jdk.jpackage.test.TKit; @@ -39,8 +40,10 @@ * @bug 8289771 * @summary jpackage with long paths on windows * @library /test/jdk/tools/jpackage/helpers + * @library /test/lib * @key jpackagePlatformPackage * @build jdk.jpackage.test.* + * @build jtreg.SkippedException * @requires (os.family == "windows") * @compile WinLongPathTest.java * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main @@ -64,6 +67,8 @@ public static List input() { @Test public void test() throws IOException { + verifyDosNamesSupported(); + if (appImage) { var cmd = JPackageCommand.helloAppImage(); setOptionLongPath(cmd, optionName); @@ -84,4 +89,23 @@ private static void setOptionLongPath(JPackageCommand cmd, String option) throws Files.createDirectories(longPath); cmd.setArgumentValue(option, longPath); } + + private static void verifyDosNamesSupported() throws IOException { + // Pick the file's name long enough to make Windows shorten it. + final var probeDosNameFile = TKit.createTempFile(Path.of("probeDosName")); + + // The output should be a DOS variant of the `probeDosNameFile` path. + // The filename should differ if the volume owning `probeDosNameFile` file supports DOS names. + final var dosPath = new Executor() + .addArguments("/c", String.format("for %%P in (\"%s\") do @echo %%~sP", probeDosNameFile)) + .setExecutable("cmd") + .dumpOutput() + .executeAndGetFirstLineOfOutput(); + + if (Path.of(dosPath).getFileName().equals(probeDosNameFile.getFileName())) { + TKit.throwSkippedException(String.format("The volume %s owning the test work directory doesn't support DOS paths", + probeDosNameFile.toAbsolutePath().getRoot())); + } + } + } diff --git a/test/micro/org/openjdk/bench/vm/compiler/MergeLoadBench.java b/test/micro/org/openjdk/bench/vm/compiler/MergeLoadBench.java new file mode 100644 index 00000000000..e29b5373791 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/MergeLoadBench.java @@ -0,0 +1,515 @@ +/* + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved. + * 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. + * + * 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 org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.Blackhole; + +import java.lang.invoke.MethodHandles; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.util.Random; +import java.util.concurrent.TimeUnit; + +import jdk.internal.misc.Unsafe; + +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +@Warmup(iterations = 3, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Measurement(iterations = 5, time = 1000, timeUnit = TimeUnit.MILLISECONDS) +@Fork(value = 1, jvmArgs = {"--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED"}) +public class MergeLoadBench { + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); + + final static VarHandle + INT_L = MethodHandles.byteArrayViewVarHandle(int[].class , ByteOrder.LITTLE_ENDIAN), + INT_B = MethodHandles.byteArrayViewVarHandle(int[].class , ByteOrder.BIG_ENDIAN), + LONG_L = MethodHandles.byteArrayViewVarHandle(long[].class, ByteOrder.LITTLE_ENDIAN), + LONG_B = MethodHandles.byteArrayViewVarHandle(long[].class, ByteOrder.BIG_ENDIAN), + CHAR_L = MethodHandles.byteArrayViewVarHandle(char[].class, ByteOrder.LITTLE_ENDIAN), + CHAR_B = MethodHandles.byteArrayViewVarHandle(char[].class, ByteOrder.BIG_ENDIAN); + + final static int NUMBERS = 8192; + + final byte[] bytes4 = new byte[NUMBERS * 4]; + final byte[] bytes8 = new byte[NUMBERS * 8]; + final int [] ints = new int [NUMBERS ]; + final long[] longs = new long[NUMBERS ]; + + @Setup + public void setup() { + Random r = new Random(); + for (int i = 0; i < ints.length; i++) { + ints[i] = r.nextInt(); + INT_L.set(bytes4, i * 4, i); + } + + for (int i = 0; i < longs.length; i++) { + longs[i] = r.nextLong(); + LONG_L.set(bytes8, i * 8, i); + } + } + + /* + * The names of these cases have the following `B/L/V/U` suffixes, which are: + * ``` + * B BigEndian + * L LittleEndian + * V VarHandle + * U Unsafe + * R ReverseBytes + * C Unsafe.getChar & putChar + * S Unsafe.getShort & putShort + * ``` + */ + + @Benchmark + public void getIntB(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntB(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntBU(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntBU(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntBV(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += (int) INT_B.get(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntL(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntL(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntLU(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntLU(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntLV(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += (int) INT_L.get(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntRB(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntRB(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntRBU(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntRBU(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntRL(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntRL(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntRLU(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += getIntRLU(bytes4, i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getIntRU(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += Integer.reverseBytes( + UNSAFE.getInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 4)); + } + BH.consume(sum); + } + + @Benchmark + public void getIntU(Blackhole BH) { + int sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += UNSAFE.getInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 4); + } + BH.consume(sum); + } + + @Benchmark + public void getLongB(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongB(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongBU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongBU(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongBV(Blackhole BH) { + long sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += (long) LONG_B.get(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongL(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongL(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongLU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongLU(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongLV(Blackhole BH) { + long sum = 0; + for (int i = 0; i < ints.length; i++) { + sum += (long) LONG_L.get(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongRB(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongRB(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongRBU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongRBU(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongRL(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongRL(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongRLU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += getLongRLU(bytes8, i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getLongRU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += Long.reverseBytes( + UNSAFE.getLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 8)); + } + BH.consume(sum); + } + + @Benchmark + public void getLongU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + sum += UNSAFE.getLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 8); + } + BH.consume(sum); + } + + @Benchmark + public void getCharB(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + char c = getCharB(bytes4, i); + sum += c; + } + BH.consume(sum); + } + + @Benchmark + public void getCharBV(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + char c = (char) CHAR_B.get(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 2); + sum += c; + } + BH.consume(sum); + } + + @Benchmark + public void getCharBU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + char c = getCharBU(bytes4, i); + sum += c; + } + BH.consume(sum); + } + + @Benchmark + public void getCharL(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + char c = getCharL(bytes4, i); + sum += c; + } + BH.consume(sum); + } + @Benchmark + public void getCharLU(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + char c = getCharLU(bytes4, i); + sum += c; + } + BH.consume(sum); + } + + + @Benchmark + public void getCharLV(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + char c = (char) CHAR_L.get(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 2); + sum += c; + } + BH.consume(sum); + } + + @Benchmark + public void getCharC(Blackhole BH) { + long sum = 0; + for (int i = 0; i < longs.length; i++) { + char c = UNSAFE.getChar(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 2); + sum += c; + } + BH.consume(sum); + } + + static int getIntB(byte[] array, int offset) { + return ((array[offset ] & 0xff) << 24) + | ((array[offset + 1] & 0xff) << 16) + | ((array[offset + 2] & 0xff) << 8) + | ((array[offset + 3] & 0xff) ); + } + + static int getIntBU(byte[] array, int offset) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; + return ((UNSAFE.getByte(array, address ) & 0xff) << 24) + | ((UNSAFE.getByte(array, address + 1) & 0xff) << 16) + | ((UNSAFE.getByte(array, address + 2) & 0xff) << 8) + | ((UNSAFE.getByte(array, address + 3) & 0xff) ); + } + + static int getIntL(byte[] array, int offset) { + return ((array[offset ] & 0xff) ) + | ((array[offset + 1] & 0xff) << 8) + | ((array[offset + 2] & 0xff) << 16) + | ((array[offset + 3] & 0xff) << 24); + } + + static int getIntRB(byte[] array, int offset) { + return Integer.reverseBytes(getIntB(array, offset)); + } + + static int getIntRBU(byte[] array, int offset) { + return Integer.reverseBytes(getIntBU(array, offset)); + } + + static int getIntRL(byte[] array, int offset) { + return Integer.reverseBytes(getIntL(array, offset)); + } + + static int getIntRLU(byte[] array, int offset) { + return Integer.reverseBytes(getIntLU(array, offset)); + } + + static long getLongB(byte[] array, int offset) { + return (((long) array[offset ] & 0xff) << 56) + | (((long) array[offset + 1] & 0xff) << 48) + | (((long) array[offset + 2] & 0xff) << 40) + | (((long) array[offset + 3] & 0xff) << 32) + | (((long) array[offset + 4] & 0xff) << 24) + | (((long) array[offset + 5] & 0xff) << 16) + | (((long) array[offset + 6] & 0xff) << 8) + | (((long) array[offset + 7] & 0xff) ); + } + + static long getLongBU(byte[] array, int offset) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; + return (((long)(UNSAFE.getByte(array, address) & 0xff)) << 56) + | (((long)(UNSAFE.getByte(array, address + 1) & 0xff)) << 48) + | (((long)(UNSAFE.getByte(array, address + 2) & 0xff)) << 40) + | (((long)(UNSAFE.getByte(array, address + 3) & 0xff)) << 32) + | (((long)(UNSAFE.getByte(array, address + 4) & 0xff)) << 24) + | (((long)(UNSAFE.getByte(array, address + 5) & 0xff)) << 16) + | (((long)(UNSAFE.getByte(array, address + 6) & 0xff)) << 8) + | (((long)(UNSAFE.getByte(array, address + 7) & 0xff)) ); + } + + public static long getLongL(byte[] array, int offset) { + return (((long) array[offset ] & 0xff) ) + | (((long) array[offset + 1] & 0xff) << 8) + | (((long) array[offset + 2] & 0xff) << 16) + | (((long) array[offset + 3] & 0xff) << 24) + | (((long) array[offset + 4] & 0xff) << 32) + | (((long) array[offset + 5] & 0xff) << 40) + | (((long) array[offset + 6] & 0xff) << 48) + | (((long) array[offset + 7] & 0xff) << 56); + } + + static long getLongLU(byte[] array, int offset) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; + return (((long)(UNSAFE.getByte(array, address ) & 0xff)) ) + | (((long)(UNSAFE.getByte(array, address + 1) & 0xff)) << 8) + | (((long)(UNSAFE.getByte(array, address + 2) & 0xff)) << 16) + | (((long)(UNSAFE.getByte(array, address + 3) & 0xff)) << 24) + | (((long)(UNSAFE.getByte(array, address + 4) & 0xff)) << 32) + | (((long)(UNSAFE.getByte(array, address + 5) & 0xff)) << 40) + | (((long)(UNSAFE.getByte(array, address + 6) & 0xff)) << 48) + | (((long)(UNSAFE.getByte(array, address + 7) & 0xff)) << 56); + } + + static long getLongRB(byte[] array, int offset) { + return getLongB(array, offset); + } + + static long getLongRBU(byte[] array, int offset) { + return getLongBU(array, offset); + } + + static long getLongRL(byte[] array, int offset) { + return getLongL(array, offset); + } + + static long getLongRLU(byte[] array, int offset) { + return getLongLU(array, offset); + } + + public static int getIntLU(byte[] array, int offset) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; + return ((UNSAFE.getByte(array, address ) & 0xff) ) + | ((UNSAFE.getByte(array, address + 1) & 0xff) << 8) + | ((UNSAFE.getByte(array, address + 2) & 0xff) << 16) + | ((UNSAFE.getByte(array, address + 3) & 0xff) << 24); + } + + public static char getCharB(byte[] val, int index) { + index <<= 1; + return (char)(((val[index ] & 0xff) << 8) + | ((val[index + 1] & 0xff))); + } + + public static char getCharBR(byte[] val, int index) { + return Character.reverseBytes(getCharB(val, index)); + } + + public static char getCharL(byte[] val, int index) { + index <<= 1; + return (char)(((val[index ] & 0xff)) + | ((val[index + 1] & 0xff) << 8)); + } + + public static char getCharLR(byte[] val, int index) { + return Character.reverseBytes(getCharL(val, index)); + } + + public static char getCharBU(byte[] array, int offset) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + (offset << 1); + return (char) (((UNSAFE.getByte(array, address ) & 0xff) << 8) + | ((UNSAFE.getByte(array, address + 1) & 0xff) )); + } + + public static char getCharLU(byte[] array, int offset) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + (offset << 1); + return (char) (((UNSAFE.getByte(array, address ) & 0xff) ) + | ((UNSAFE.getByte(array, address + 1) & 0xff) << 8)); + } +} diff --git a/test/micro/org/openjdk/bench/vm/compiler/MergeStoreBench.java b/test/micro/org/openjdk/bench/vm/compiler/MergeStoreBench.java index 870422de256..88b68868813 100644 --- a/test/micro/org/openjdk/bench/vm/compiler/MergeStoreBench.java +++ b/test/micro/org/openjdk/bench/vm/compiler/MergeStoreBench.java @@ -25,13 +25,9 @@ import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; -import org.openjdk.jmh.runner.Runner; -import org.openjdk.jmh.runner.options.Options; -import org.openjdk.jmh.runner.options.OptionsBuilder; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; -import java.lang.reflect.Field; import java.nio.ByteOrder; import java.util.Random; import java.util.concurrent.TimeUnit; @@ -41,18 +37,19 @@ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @State(Scope.Thread) -@Warmup(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Warmup(iterations = 3, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 1000, timeUnit = TimeUnit.MILLISECONDS) -@Fork(value = 3, jvmArgs = {"--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED"}) +@Fork(value = 1, jvmArgs = {"--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED"}) public class MergeStoreBench { private static final Unsafe UNSAFE = Unsafe.getUnsafe(); - final static VarHandle INT_L = MethodHandles.byteArrayViewVarHandle(int[].class , ByteOrder.LITTLE_ENDIAN); - final static VarHandle INT_B = MethodHandles.byteArrayViewVarHandle(int[].class , ByteOrder.BIG_ENDIAN); - final static VarHandle LONG_L = MethodHandles.byteArrayViewVarHandle(long[].class, ByteOrder.LITTLE_ENDIAN); - final static VarHandle LONG_B = MethodHandles.byteArrayViewVarHandle(long[].class, ByteOrder.BIG_ENDIAN); - final static VarHandle CHAR_L = MethodHandles.byteArrayViewVarHandle(char[].class, ByteOrder.LITTLE_ENDIAN); - final static VarHandle CHAR_B = MethodHandles.byteArrayViewVarHandle(char[].class, ByteOrder.BIG_ENDIAN); + final static VarHandle + INT_L = MethodHandles.byteArrayViewVarHandle(int[].class , ByteOrder.LITTLE_ENDIAN), + INT_B = MethodHandles.byteArrayViewVarHandle(int[].class , ByteOrder.BIG_ENDIAN), + LONG_L = MethodHandles.byteArrayViewVarHandle(long[].class, ByteOrder.LITTLE_ENDIAN), + LONG_B = MethodHandles.byteArrayViewVarHandle(long[].class, ByteOrder.BIG_ENDIAN), + CHAR_L = MethodHandles.byteArrayViewVarHandle(char[].class, ByteOrder.LITTLE_ENDIAN), + CHAR_B = MethodHandles.byteArrayViewVarHandle(char[].class, ByteOrder.BIG_ENDIAN); final static int NUMBERS = 8192; @@ -89,115 +86,6 @@ public void setup() { * ``` */ - @Benchmark - public void getIntB(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntB(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntBU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntBU(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntBV(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += (int) INT_B.get(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntL(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntL(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntLU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntLU(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntLV(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += (int) INT_L.get(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntRB(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntRB(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntRBU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntRBU(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntRL(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntRL(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntRLU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += getIntRLU(bytes4, i * 4); - } - BH.consume(sum); - } - - @Benchmark - public void getIntRU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += Integer.reverseBytes( - UNSAFE.getInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 4)); - } - BH.consume(sum); - } - - @Benchmark - public void getIntU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += UNSAFE.getInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 4); - } - BH.consume(sum); - } - @Benchmark public void setIntB(Blackhole BH) { int sum = 0; @@ -211,613 +99,396 @@ public void setIntB(Blackhole BH) { @Benchmark public void setIntBU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - setIntBU(bytes4, i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + setIntBU(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntBV(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - INT_B.set(bytes4, i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + INT_B.set(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntL(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - setIntL(bytes4, i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + setIntL(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntLU(Blackhole BH) { - int sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - setIntLU(bytes4, i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + setIntLU(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntLV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - INT_L.set(bytes4, i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + INT_L.set(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntRB(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - setIntRB(bytes4, i * 4, ints[i]); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + setIntRB(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntRBU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - setIntRBU(bytes4, i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + setIntRBU(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntRL(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - setIntRL(bytes4, i * 4, ints[i]); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + setIntRL(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntRLU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - setIntRLU(bytes4, i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + setIntRLU(bytes4, off, ints[i]); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntRU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - v = Integer.reverseBytes(v); - UNSAFE.putInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 4, v); - sum += v; + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + UNSAFE.putInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, Integer.reverseBytes(ints[i])); + off += 4; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setIntU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - int v = ints[i]; - UNSAFE.putInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 4, v); - sum += v; - } - BH.consume(sum); - } - - @Benchmark - public void getLongB(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongB(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongBU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongBU(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongBV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += (long) LONG_B.get(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongL(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongL(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongLU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongLU(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongLV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < ints.length; i++) { - sum += (long) LONG_L.get(bytes8, i * 8); + int off = 0; + for (int i = ints.length - 1; i >= 0; i--) { + UNSAFE.putInt(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, ints[i]); + off += 4; } - BH.consume(sum); - } - - @Benchmark - public void getLongRB(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongRB(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongRBU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongRBU(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongRL(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongRL(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongRLU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += getLongRLU(bytes8, i * 8); - } - BH.consume(sum); - } - - @Benchmark - public void getLongRU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += Long.reverseBytes( - UNSAFE.getLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 8)); - } - BH.consume(sum); - } - - @Benchmark - public void getLongU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - sum += UNSAFE.getLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 8); - } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongB(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongB(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongB(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongBU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongBU(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongBU(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongBV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - LONG_B.set(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + LONG_B.set(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongL(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongL(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongL(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongLU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongLU(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongLU(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongLV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - LONG_L.set(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + LONG_L.set(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongRB(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongRB(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongRB(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongRBU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongRBU(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongRBU(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongRL(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongRL(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongRL(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongRLU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - setLongRLU(bytes8, i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + setLongRLU(bytes8, off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongRU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - v = Long.reverseBytes(v); - UNSAFE.putLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 8, v); - sum += v; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + UNSAFE.putLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, Long.reverseBytes(longs[i])); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark public void setLongU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - long v = longs[i]; - UNSAFE.putLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 8, v); - sum += v; - } - BH.consume(sum); - } - - @Benchmark - public void getCharB(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - char c = getCharB(bytes4, i); - sum += c; + int off = 0; + for (int i = longs.length - 1; i >= 0; i--) { + UNSAFE.putLong(bytes8, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, longs[i]); + off += 8; } - BH.consume(sum); + BH.consume(off); } @Benchmark - public void getCharBV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - char c = (char) CHAR_B.get(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 2); - sum += c; - } - BH.consume(sum); - } - - @Benchmark - public void getCharBU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - char c = getCharBU(bytes4, i); - sum += c; + public void setCharBS(Blackhole BH) { + int off = 0; + for (int i = chars.length - 1; i >= 0; i--) { + putShortB(bytes4, off, chars[i]); + off += 2; } - BH.consume(sum); + BH.consume(off); } @Benchmark - public void getCharL(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - char c = getCharL(bytes4, i); - sum += c; - } - BH.consume(sum); - } - @Benchmark - public void getCharLU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - char c = getCharLU(bytes4, i); - sum += c; + public void setCharBV(Blackhole BH) { + int off = 0; + for (int i = chars.length - 1; i >= 0; i--) { + CHAR_B.set(bytes4, off, chars[i]); + off += 2; } - BH.consume(sum); + BH.consume(off); } - @Benchmark - public void getCharLV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - char c = (char) CHAR_L.get(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 2); - sum += c; + public void setCharLS(Blackhole BH) { + int off = 0; + for (int i = chars.length - 1; i >= 0; i--) { + putShortL(bytes4, off, chars[i]); + off += 2; } - BH.consume(sum); + BH.consume(off); } @Benchmark - public void getCharC(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - char c = UNSAFE.getChar(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 2); - sum += c; + public void setCharLV(Blackhole BH) { + int off = 0; + for (int i = chars.length - 1; i >= 0; i--) { + CHAR_L.set(bytes4, off, chars[i]); + off += 2; } - BH.consume(sum); + BH.consume(off); } @Benchmark - public void setCharBS(Blackhole BH) { - long sum = 0; - for (int i = 0; i < chars.length; i++) { - char c = chars[i]; - putShortB(bytes4, i * 2, c); - sum += c; + public void setCharC(Blackhole BH) { + int off = 0; + for (int i = chars.length - 1; i >= 0; i--) { + UNSAFE.putChar(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, chars[i]); + off += 2; } - BH.consume(sum); + BH.consume(off); } + /* + * putChars4 and putBytes4 Test whether four constant chars can be MergeStored + * + */ @Benchmark - public void setCharBV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < chars.length; i++) { - char c = chars[i]; - CHAR_B.set(bytes4, i * 2, c); - sum += c; + public void putBytes4(Blackhole BH) { + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putBytes4(bytes4, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark - public void setCharLS(Blackhole BH) { - long sum = 0; - for (int i = 0; i < chars.length; i++) { - char c = chars[i]; - putShortL(bytes4, i * 2, c); - sum += c; + public void putBytes4X(Blackhole BH) { + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putBytes4X(bytes4, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark - public void setCharLV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < chars.length; i++) { - char c = chars[i]; - CHAR_L.set(bytes4, i * 2, c); - sum += c; + public void putBytes4U(Blackhole BH) { + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putBytes4U(bytes4, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark - public void setCharC(Blackhole BH) { - long sum = 0; - for (int i = 0; i < chars.length; i++) { - char c = chars[i]; - UNSAFE.putChar(bytes4, Unsafe.ARRAY_BYTE_BASE_OFFSET + i * 2, c); - sum += c; + @SuppressWarnings("deprecation") + public void putBytes4GetBytes(Blackhole BH) { + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + "null".getBytes(0, 4, bytes4, off); + off += 4; } - BH.consume(sum); + BH.consume(off); } - /* - * putChars4 Test whether four constant chars can be MergeStored - * - */ @Benchmark public void putChars4B(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4B(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4B(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark public void putChars4BU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4BU(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4BU(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark public void putChars4BV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4BV(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4BV(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark public void putChars4L(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4L(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4L(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark public void putChars4LU(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4LU(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4LU(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark public void putChars4LV(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4LV(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4LV(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark public void putChars4C(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4C(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4C(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); + BH.consume(off); } @Benchmark public void putChars4S(Blackhole BH) { - long sum = 0; - for (int i = 0; i < longs.length; i++) { - putChars4S(bytes8, i * 4); - sum += longs[i]; + int off = 0; + for (int i = 0; i < NUMBERS; i++) { + off = putChars4S(bytes8, off, 'n', 'u', 'l', 'l'); } - BH.consume(sum); - } - - static int getIntB(byte[] array, int offset) { - return ((array[offset ] & 0xff) << 24) - | ((array[offset + 1] & 0xff) << 16) - | ((array[offset + 2] & 0xff) << 8) - | ((array[offset + 3] & 0xff) ); - } - - static int getIntBU(byte[] array, int offset) { - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; - return ((UNSAFE.getByte(array, address ) & 0xff) << 24) - | ((UNSAFE.getByte(array, address + 1) & 0xff) << 16) - | ((UNSAFE.getByte(array, address + 2) & 0xff) << 8) - | ((UNSAFE.getByte(array, address + 3) & 0xff) ); - } - - static int getIntL(byte[] array, int offset) { - return ((array[offset ] & 0xff) ) - | ((array[offset + 1] & 0xff) << 8) - | ((array[offset + 2] & 0xff) << 16) - | ((array[offset + 3] & 0xff) << 24); - } - - static int getIntRB(byte[] array, int offset) { - return Integer.reverseBytes(getIntB(array, offset)); - } - - static int getIntRBU(byte[] array, int offset) { - return Integer.reverseBytes(getIntBU(array, offset)); - } - - static int getIntRL(byte[] array, int offset) { - return Integer.reverseBytes(getIntL(array, offset)); - } - - static int getIntRLU(byte[] array, int offset) { - return Integer.reverseBytes(getIntLU(array, offset)); + BH.consume(off); } static void setIntB(byte[] array, int offset, int value) { @@ -870,68 +541,6 @@ public static void setIntRBU(byte[] array, int offset, int value) { setIntBU(array, offset, value); } - static long getLongB(byte[] array, int offset) { - return (((long) array[offset ] & 0xff) << 56) - | (((long) array[offset + 1] & 0xff) << 48) - | (((long) array[offset + 2] & 0xff) << 40) - | (((long) array[offset + 3] & 0xff) << 32) - | (((long) array[offset + 4] & 0xff) << 24) - | (((long) array[offset + 5] & 0xff) << 16) - | (((long) array[offset + 6] & 0xff) << 8) - | (((long) array[offset + 7] & 0xff) ); - } - - static long getLongBU(byte[] array, int offset) { - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; - return (((long)(UNSAFE.getByte(array, address) & 0xff)) << 56) - | (((long)(UNSAFE.getByte(array, address + 1) & 0xff)) << 48) - | (((long)(UNSAFE.getByte(array, address + 2) & 0xff)) << 40) - | (((long)(UNSAFE.getByte(array, address + 3) & 0xff)) << 32) - | (((long)(UNSAFE.getByte(array, address + 4) & 0xff)) << 24) - | (((long)(UNSAFE.getByte(array, address + 5) & 0xff)) << 16) - | (((long)(UNSAFE.getByte(array, address + 6) & 0xff)) << 8) - | (((long)(UNSAFE.getByte(array, address + 7) & 0xff)) ); - } - - public static long getLongL(byte[] array, int offset) { - return (((long) array[offset ] & 0xff) ) - | (((long) array[offset + 1] & 0xff) << 8) - | (((long) array[offset + 2] & 0xff) << 16) - | (((long) array[offset + 3] & 0xff) << 24) - | (((long) array[offset + 4] & 0xff) << 32) - | (((long) array[offset + 5] & 0xff) << 40) - | (((long) array[offset + 6] & 0xff) << 48) - | (((long) array[offset + 7] & 0xff) << 56); - } - - static long getLongLU(byte[] array, int offset) { - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; - return (((long)(UNSAFE.getByte(array, address ) & 0xff)) ) - | (((long)(UNSAFE.getByte(array, address + 1) & 0xff)) << 8) - | (((long)(UNSAFE.getByte(array, address + 2) & 0xff)) << 16) - | (((long)(UNSAFE.getByte(array, address + 3) & 0xff)) << 24) - | (((long)(UNSAFE.getByte(array, address + 4) & 0xff)) << 32) - | (((long)(UNSAFE.getByte(array, address + 5) & 0xff)) << 40) - | (((long)(UNSAFE.getByte(array, address + 6) & 0xff)) << 48) - | (((long)(UNSAFE.getByte(array, address + 7) & 0xff)) << 56); - } - - static long getLongRB(byte[] array, int offset) { - return getLongB(array, offset); - } - - static long getLongRBU(byte[] array, int offset) { - return getLongBU(array, offset); - } - - static long getLongRL(byte[] array, int offset) { - return getLongL(array, offset); - } - - static long getLongRLU(byte[] array, int offset) { - return getLongLU(array, offset); - } - static void setLongB(byte[] array, int offset, long value) { array[offset] = (byte) (value >> 56); array[offset + 1] = (byte) (value >> 48); @@ -998,112 +607,95 @@ public static void setLongLU(byte[] array, int offset, long value) { UNSAFE.putByte(array, address + 7, (byte) (value >> 56)); } - public static int getIntLU(byte[] array, int offset) { - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; - return ((UNSAFE.getByte(array, address ) & 0xff) ) - | ((UNSAFE.getByte(array, address + 1) & 0xff) << 8) - | ((UNSAFE.getByte(array, address + 2) & 0xff) << 16) - | ((UNSAFE.getByte(array, address + 3) & 0xff) << 24); - } - - public static char getCharB(byte[] val, int index) { - index <<= 1; - return (char)(((val[index ] & 0xff) << 8) - | ((val[index + 1] & 0xff))); - } - - public static char getCharBR(byte[] val, int index) { - return Character.reverseBytes(getCharB(val, index)); - } - - public static char getCharL(byte[] val, int index) { - index <<= 1; - return (char)(((val[index ] & 0xff)) - | ((val[index + 1] & 0xff) << 8)); + public int putBytes4(byte[] bytes, int offset, int c0, int c1, int c2, int c3) { + bytes[offset ] = (byte) c0; + bytes[offset + 1] = (byte) c1; + bytes[offset + 2] = (byte) c2; + bytes[offset + 3] = (byte) c3; + return offset + 4; } - public static char getCharLR(byte[] val, int index) { - return Character.reverseBytes(getCharL(val, index)); + public int putBytes4X(byte[] bytes, int offset, int c0, int c1, int c2, int c3) { + bytes[offset++] = (byte) c0; + bytes[offset++] = (byte) c1; + bytes[offset++] = (byte) c2; + bytes[offset++] = (byte) c3; + return offset; } - public static char getCharBU(byte[] array, int offset) { - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + (offset << 1); - return (char) (((UNSAFE.getByte(array, address ) & 0xff) << 8) - | ((UNSAFE.getByte(array, address + 1) & 0xff) )); - } - - public static char getCharLU(byte[] array, int offset) { - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + (offset << 1); - return (char) (((UNSAFE.getByte(array, address ) & 0xff) ) - | ((UNSAFE.getByte(array, address + 1) & 0xff) << 8)); + public int putBytes4U(byte[] bytes, int offset, int c0, int c1, int c2, int c3) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; + UNSAFE.putByte(bytes, address , (byte) c0); + UNSAFE.putByte(bytes, address + 1, (byte) c1); + UNSAFE.putByte(bytes, address + 2, (byte) c2); + UNSAFE.putByte(bytes, address + 3, (byte) c3); + return offset + 4; } - public void putChars4B(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; + public int putChars4B(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { putShortB(bytes, offset , c0); putShortB(bytes, offset + 1, c1); putShortB(bytes, offset + 2, c2); putShortB(bytes, offset + 3, c3); + return offset + 4; } - public void putChars4BU(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; + public int putChars4BU(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { putShortBU(bytes, offset , c0); putShortBU(bytes, offset + 1, c1); putShortBU(bytes, offset + 2, c2); putShortBU(bytes, offset + 3, c3); + return offset + 4; } - public void putChars4BV(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; - offset <<= 1; - CHAR_B.set(bytes, offset , c0); + public int putChars4BV(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { + CHAR_B.set(bytes, offset , c0); CHAR_B.set(bytes, offset + 2, c1); CHAR_B.set(bytes, offset + 4, c2); CHAR_B.set(bytes, offset + 6, c3); + return offset + 8; } - public void putChars4L(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; + public int putChars4L(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { putShortL(bytes, offset , c0); putShortL(bytes, offset + 1, c1); putShortL(bytes, offset + 2, c2); putShortL(bytes, offset + 3, c3); + return offset + 4; } - public void putChars4LV(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; - offset <<= 1; + public int putChars4LV(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { CHAR_L.set(bytes, offset , c0); CHAR_L.set(bytes, offset + 2, c1); CHAR_L.set(bytes, offset + 4, c2); CHAR_L.set(bytes, offset + 6, c3); + return offset + 8; } - public void putChars4LU(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; + public int putChars4LU(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { putShortLU(bytes, offset , c0); putShortLU(bytes, offset + 1, c1); putShortLU(bytes, offset + 2, c2); putShortLU(bytes, offset + 3, c3); + return offset + 4; } - public void putChars4C(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + (offset << 1); + public int putChars4C(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; UNSAFE.putChar(bytes, address , c0); UNSAFE.putChar(bytes, address + 2, c1); UNSAFE.putChar(bytes, address + 4, c2); UNSAFE.putChar(bytes, address + 6, c3); + return offset + 8; } - public void putChars4S(byte[] bytes, int offset) { - char c0 = 'n', c1 = 'u', c2 = 'l', c3 = 'l'; - final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + (offset << 1); + public int putChars4S(byte[] bytes, int offset, char c0, char c1, char c2, char c3) { + final long address = Unsafe.ARRAY_BYTE_BASE_OFFSET + offset; UNSAFE.putShort(bytes, address , (short) c0); UNSAFE.putShort(bytes, address + 2, (short) c1); UNSAFE.putShort(bytes, address + 4, (short) c2); UNSAFE.putShort(bytes, address + 6, (short) c3); + return offset + 8; } private static void putShortB(byte[] val, int index, int c) { @@ -1129,4 +721,9 @@ public static void putShortLU(byte[] array, int offset, int c) { UNSAFE.putByte(array, address , (byte) (c )); UNSAFE.putByte(array, address + 1, (byte) (c >> 8)); } + + @Fork(value = 1, jvmArgs = { + "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:+UnlockDiagnosticVMOptions", "-XX:-MergeStores" + }) + public static class MergeStoresDisabled extends MergeStoreBench {} }