diff --git a/.jcheck/conf b/.jcheck/conf index e657e8ff3f8..f002fd8b96f 100644 --- a/.jcheck/conf +++ b/.jcheck/conf @@ -1,7 +1,7 @@ [general] project=jdk8u jbs=JDK -version=openjdk8u412 +version=openjdk8u422 [checks] error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace diff --git a/common/autoconf/version-numbers b/common/autoconf/version-numbers index 248532982d6..bd3c3824e33 100644 --- a/common/autoconf/version-numbers +++ b/common/autoconf/version-numbers @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 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 @@ -26,7 +26,7 @@ JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=8 JDK_MICRO_VERSION=0 -JDK_UPDATE_VERSION=412 +JDK_UPDATE_VERSION=422 LAUNCHER_NAME=openjdk PRODUCT_NAME=OpenJDK PRODUCT_SUFFIX="Runtime Environment" diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 3a4246c6816..42586c4eaec 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -390,15 +390,6 @@ class VM_Version_StubGenerator: public StubCodeGenerator { }; }; - -void VM_Version::get_cpu_info_wrapper() { - get_cpu_info_stub(&_cpuid_info); -} - -#ifndef CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED - #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) f() -#endif - void VM_Version::get_processor_features() { _cpu = 4; // 486 by default @@ -412,9 +403,7 @@ void VM_Version::get_processor_features() { if (!Use486InstrsOnly) { // Get raw processor info - // Some platforms (like Win*) need a wrapper around here - // in order to properly handle SEGV for YMM registers test. - CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(get_cpu_info_wrapper); + get_cpu_info_stub(&_cpuid_info); assert_is_initialized(); _cpu = extended_cpu_family(); diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 329e0e7b5fa..e7c38f1ea7d 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -751,6 +751,11 @@ void os::set_native_thread_name(const char *name) { // is already attached to a debugger; debugger must observe // the exception below to show the correct name. + // If there is no debugger attached skip raising the exception + if (!IsDebuggerPresent()) { + return; + } + const DWORD MS_VC_EXCEPTION = 0x406D1388; struct { DWORD dwType; // must be 0x1000 @@ -2865,17 +2870,6 @@ address os::win32::fast_jni_accessor_wrapper(BasicType type) { } #endif -void os::win32::call_test_func_with_wrapper(void (*funcPtr)(void)) { - // Install a win32 structured exception handler around the test - // function call so the VM can generate an error dump if needed. - __try { - (*funcPtr)(); - } __except(topLevelExceptionFilter( - (_EXCEPTION_POINTERS*)_exception_info())) { - // Nothing to do. - } -} - // Virtual Memory int os::vm_page_size() { return os::win32::vm_page_size(); } diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index 20e2ca2f5c3..142bc4e534f 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -97,8 +97,6 @@ class win32 { static address fast_jni_accessor_wrapper(BasicType); #endif - static void call_test_func_with_wrapper(void (*funcPtr)(void)); - // filter function to ignore faults on serializations page static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); }; diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index 5dac11c903a..a814f0adf4d 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,4 @@ inline int os::close(int fd) { return ::close(fd); } -#define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) \ - os::win32::call_test_func_with_wrapper(f) - #endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP diff --git a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp index 2285eb0a5b4..bb3937c1534 100644 --- a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp +++ b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp @@ -379,7 +379,7 @@ static const char *flagnames[] = { void ciBlock::dump() { tty->print(" [%d .. %d), {", _start_bci, _limit_bci); - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 7; i++) { if ((_flags & (1 << i)) != 0) { tty->print(" %s", flagnames[i]); } diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index ca37a08756e..ac29c82934e 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -97,6 +97,9 @@ static jint CurrentVersion = JNI_VERSION_1_8; +#ifdef _WIN32 +extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* ); +#endif // The DT_RETURN_MARK macros create a scoped object to fire the dtrace // '-return' probe regardless of the return path is taken out of the function. @@ -5186,12 +5189,11 @@ DT_RETURN_MARK_DECL(CreateJavaVM, jint , HOTSPOT_JNI_CREATEJAVAVM_RETURN(_ret_ref)); #endif /* USDT2 */ -_JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, void *args) { +static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) { #ifndef USDT2 HS_DTRACE_PROBE3(hotspot_jni, CreateJavaVM__entry, vm, penv, args); #else /* USDT2 */ - HOTSPOT_JNI_CREATEJAVAVM_ENTRY( - (void **) vm, penv, args); + HOTSPOT_JNI_CREATEJAVAVM_ENTRY((void **) vm, penv, args); #endif /* USDT2 */ jint result = JNI_ERR; @@ -5263,18 +5265,14 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v post_thread_start_event(thread); #ifndef PRODUCT - #ifndef CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED - #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) f() - #endif - // Check if we should compile all classes on bootclasspath if (CompileTheWorld) ClassLoader::compile_the_world(); if (ReplayCompiles) ciReplay::replay(thread); // Some platforms (like Win*) need a wrapper around these test // functions in order to properly handle error conditions. - CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(test_error_handler); - CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(execute_internal_vm_tests); + test_error_handler(); + execute_internal_vm_tests(); #endif // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving. @@ -5294,6 +5292,22 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v } return result; + +} + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, void *args) { + jint result = JNI_ERR; + // On Windows, let CreateJavaVM run with SEH protection +#ifdef _WIN32 + __try { +#endif + result = JNI_CreateJavaVM_inner(vm, penv, args); +#ifdef _WIN32 + } __except(topLevelExceptionFilter((_EXCEPTION_POINTERS*)_exception_info())) { + // Nothing to do. + } +#endif + return result; } #ifndef USDT2 @@ -5336,12 +5350,11 @@ DT_RETURN_MARK_DECL(DestroyJavaVM, jint , HOTSPOT_JNI_DESTROYJAVAVM_RETURN(_ret_ref)); #endif /* USDT2 */ -jint JNICALL jni_DestroyJavaVM(JavaVM *vm) { +static jint JNICALL jni_DestroyJavaVM_inner(JavaVM *vm) { #ifndef USDT2 DTRACE_PROBE1(hotspot_jni, DestroyJavaVM__entry, vm); #else /* USDT2 */ - HOTSPOT_JNI_DESTROYJAVAVM_ENTRY( - vm); + HOTSPOT_JNI_DESTROYJAVAVM_ENTRY(vm); #endif /* USDT2 */ jint res = JNI_ERR; DT_RETURN_MARK(DestroyJavaVM, jint, (const jint&)res); @@ -5377,6 +5390,20 @@ jint JNICALL jni_DestroyJavaVM(JavaVM *vm) { } } +jint JNICALL jni_DestroyJavaVM(JavaVM *vm) { + jint result = JNI_ERR; + // On Windows, we need SEH protection +#ifdef _WIN32 + __try { +#endif + result = jni_DestroyJavaVM_inner(vm); +#ifdef _WIN32 + } __except(topLevelExceptionFilter((_EXCEPTION_POINTERS*)_exception_info())) { + // Nothing to do. + } +#endif + return result; +} static jint attach_current_thread(JavaVM *vm, void **penv, void *_args, bool daemon) { JavaVMAttachArgs *args = (JavaVMAttachArgs *) _args; diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index 2dcda097ebb..2950b0aa2ef 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -81,6 +81,7 @@ Mutex* Shared_SATB_Q_lock = NULL; Mutex* DirtyCardQ_FL_lock = NULL; Monitor* DirtyCardQ_CBL_mon = NULL; Mutex* Shared_DirtyCardQ_lock = NULL; +Mutex* MonitoringSupport_lock = NULL; Mutex* ParGCRareEvent_lock = NULL; Mutex* EvacFailureStack_lock = NULL; Mutex* DerivedPointerTableGC_lock = NULL; @@ -208,6 +209,8 @@ void mutex_init() { def(StringDedupQueue_lock , Monitor, leaf, true ); def(StringDedupTable_lock , Mutex , leaf, true ); + + def(MonitoringSupport_lock , Mutex , leaf, true ); // used for serviceability monitoring support } def(ParGCRareEvent_lock , Mutex , leaf , true ); def(DerivedPointerTableGC_lock , Mutex, leaf, true ); diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp index ec642a24e65..098cb9f443f 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.hpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -101,6 +101,7 @@ extern Mutex* Shared_DirtyCardQ_lock; // Lock protecting dirty card // queue shared by // non-Java threads. // (see option ExplicitGCInvokesConcurrent) +extern Mutex* MonitoringSupport_lock; // Protects updates to the serviceability memory pools and allocated memory high water mark. extern Mutex* ParGCRareEvent_lock; // Synchronizes various (rare) parallel GC ops. extern Mutex* EvacFailureStack_lock; // guards the evac failure scan stack extern Mutex* Compile_lock; // a lock held when Compilation is updating code (used to block CodeCache traversal, CHA updates, etc) diff --git a/hotspot/src/share/vm/services/jmm.h b/hotspot/src/share/vm/services/jmm.h index e00b882dd1d..00adb4ad584 100644 --- a/hotspot/src/share/vm/services/jmm.h +++ b/hotspot/src/share/vm/services/jmm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -218,7 +218,8 @@ typedef struct { } dcmdArgInfo; typedef struct jmmInterface_1_ { - void* reserved1; + jlong (JNICALL *GetTotalThreadAllocatedMemory) + (JNIEnv *env); jlong (JNICALL *GetOneThreadAllocatedMemory) (JNIEnv *env, jlong thread_id); diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index 6163ac35dac..566e7a780a9 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -37,6 +37,7 @@ #include "runtime/interfaceSupport.hpp" #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" +#include "runtime/mutexLocker.hpp" #include "runtime/os.hpp" #include "runtime/serviceThread.hpp" #include "runtime/thread.inline.hpp" @@ -428,8 +429,6 @@ static MemoryPool* get_memory_pool_from_jobject(jobject obj, TRAPS) { return MemoryService::get_memory_pool(ph); } -#endif // INCLUDE_MANAGEMENT - static void validate_thread_id_array(typeArrayHandle ids_ah, TRAPS) { int num_threads = ids_ah->length(); @@ -445,8 +444,6 @@ static void validate_thread_id_array(typeArrayHandle ids_ah, TRAPS) { } } -#if INCLUDE_MANAGEMENT - static void validate_thread_info_array(objArrayHandle infoArray_h, TRAPS) { // check if the element of infoArray is of type ThreadInfo class Klass* threadinfo_klass = Management::java_lang_management_ThreadInfo_klass(CHECK); @@ -2230,7 +2227,39 @@ jlong Management::ticks_to_ms(jlong ticks) { return (jlong)(((double)ticks / (double)os::elapsed_frequency()) * (double)1000.0); } -#endif // INCLUDE_MANAGEMENT + +// Gets the amount of memory allocated on the Java heap since JVM launch. +JVM_ENTRY(jlong, jmm_GetTotalThreadAllocatedMemory(JNIEnv *env)) + // We keep a high water mark to ensure monotonicity + static jlong high_water_result = 0; + static jlong prev_result = 0; + + jlong result; + if (Threads_lock->try_lock()) { + result = ThreadService::exited_allocated_bytes(); + for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) { + jlong size = thread->cooked_allocated_bytes(); + result += size; + } + Threads_lock->unlock(); + } else { + // Return the previous result if Threads_lock is locked + result = prev_result; + } + + { + MutexLockerEx ml(MonitoringSupport_lock, Mutex::_no_safepoint_check_flag); + if (result < high_water_result) { + // Result wrapped to a negative value, in which case it's + // pegged at the last positive value. + result = high_water_result; + } else { + high_water_result = result; + } + prev_result = result; + } + return result; +JVM_END // Gets the amount of memory allocated on the Java heap for a single thread. // Returns -1 if the thread does not exist or has terminated. @@ -2368,11 +2397,8 @@ JVM_ENTRY(void, jmm_GetThreadCpuTimesWithKind(JNIEnv *env, jlongArray ids, } JVM_END - - -#if INCLUDE_MANAGEMENT const struct jmmInterface_1_ jmm_interface = { - NULL, + jmm_GetTotalThreadAllocatedMemory, jmm_GetOneThreadAllocatedMemory, jmm_GetVersion, jmm_GetOptionalSupport, diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp index 93ba0579fad..3bfd6b538de 100644 --- a/hotspot/src/share/vm/services/threadService.cpp +++ b/hotspot/src/share/vm/services/threadService.cpp @@ -58,6 +58,8 @@ PerfVariable* ThreadService::_daemon_threads_count = NULL; volatile int ThreadService::_exiting_threads_count = 0; volatile int ThreadService::_exiting_daemon_threads_count = 0; +volatile jlong ThreadService::_exited_allocated_bytes = 0; + ThreadDumpResult* ThreadService::_threaddump_list = NULL; static const int INITIAL_ARRAY_SIZE = 10; @@ -119,6 +121,9 @@ void ThreadService::add_thread(JavaThread* thread, bool daemon) { } void ThreadService::remove_thread(JavaThread* thread, bool daemon) { + // Include hidden thread allcations in exited_allocated_bytes + ThreadService::incr_exited_allocated_bytes(thread->cooked_allocated_bytes()); + Atomic::dec((jint*) &_exiting_threads_count); if (thread->is_hidden_from_external_view() || diff --git a/hotspot/src/share/vm/services/threadService.hpp b/hotspot/src/share/vm/services/threadService.hpp index 46bc012f73e..5c725db60c8 100644 --- a/hotspot/src/share/vm/services/threadService.hpp +++ b/hotspot/src/share/vm/services/threadService.hpp @@ -58,6 +58,8 @@ class ThreadService : public AllStatic { static PerfVariable* _peak_threads_count; static PerfVariable* _daemon_threads_count; + static volatile jlong _exited_allocated_bytes; + // These 2 counters are atomically incremented once the thread is exiting. // They will be atomically decremented when ThreadService::remove_thread is called. static volatile int _exiting_threads_count; @@ -95,6 +97,14 @@ class ThreadService : public AllStatic { static int exiting_threads_count() { return _exiting_threads_count; } static int exiting_daemon_threads_count() { return _exiting_daemon_threads_count; } + static jlong exited_allocated_bytes() { return Atomic::load(&_exited_allocated_bytes); } + static void incr_exited_allocated_bytes(jlong size) { + // No need for an atomic add because called under the Threads_lock, + // but because _exited_allocated_bytes is read concurrently, need + // atomic store to avoid readers seeing a partial update. + Atomic::store(_exited_allocated_bytes + size, &_exited_allocated_bytes); + } + // Support for thread dump static void add_thread_dump(ThreadDumpResult* dump); static void remove_thread_dump(ThreadDumpResult* dump); diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION index 560884d1a82..b138ed7fa78 100644 --- a/jdk/make/data/tzdata/VERSION +++ b/jdk/make/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2023d +tzdata2024a diff --git a/jdk/make/data/tzdata/africa b/jdk/make/data/tzdata/africa index c9f48463604..5709888207a 100644 --- a/jdk/make/data/tzdata/africa +++ b/jdk/make/data/tzdata/africa @@ -53,6 +53,10 @@ # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. # https://www.jstor.org/stable/1774359 # +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. +# # European-style abbreviations are commonly used along the Mediterranean. # For sub-Saharan Africa abbreviations were less standardized. # Previous editions of this database used WAT, CAT, SAT, and EAT @@ -136,7 +140,7 @@ Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia # Chad # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena +Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 1:00 - WAT @@ -162,7 +166,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena # Inaccessible, Nightingale: uninhabited # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Africa/Abidjan -0:16:08 - LMT 1912 +Zone Africa/Abidjan -0:16:08 - LMT 1912 Jan 1 0:00 - GMT ############################################################################### diff --git a/jdk/make/data/tzdata/asia b/jdk/make/data/tzdata/asia index 67a2ef6e93c..c51170c34a7 100644 --- a/jdk/make/data/tzdata/asia +++ b/jdk/make/data/tzdata/asia @@ -2480,18 +2480,33 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # effective December 21st, 2018.... # http://adilet.zan.kz/rus/docs/P1800000817 (russian language). +# From Zhanbolat Raimbekov (2024-01-19): +# Kazakhstan (all parts) switching to UTC+5 on March 1, 2024 +# https://www.gov.kz/memleket/entities/mti/press/news/details/688998?lang=ru +# [in Russian] +# (2024-01-20): https://primeminister.kz/ru/decisions/19012024-20 +# +# From Alexander Krivenyshev (2024-01-19): +# According to a different news and the official web site for the Ministry of +# Trade and Integration of the Republic of Kazakhstan: +# https://en.inform.kz/news/kazakhstan-to-switch-to-single-hour-zone-mar-1-54ad0b/ + # Zone NAME STDOFF RULES FORMAT [UNTIL] # # Almaty (formerly Alma-Ata), representing most locations in Kazakhstan -# This includes KZ-AKM, KZ-ALA, KZ-ALM, KZ-AST, KZ-BAY, KZ-VOS, KZ-ZHA, -# KZ-KAR, KZ-SEV, KZ-PAV, and KZ-YUZ. +# This includes Abai/Abay (ISO 3166-2 code KZ-10), Aqmola/Akmola (KZ-11), +# Almaty (KZ-19), Almaty city (KZ-75), Astana city (KZ-71), +# East Kazkhstan (KZ-63), Jambyl/Zhambyl (KZ-31), Jetisu/Zhetysu (KZ-33), +# Karaganda (KZ-35), North Kazakhstan (KZ-59), Pavlodar (KZ-55), +# Shyumkent city (KZ-79), Turkistan (KZ-61), and Ulytau (KZ-62). Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata 5:00 - +05 1930 Jun 21 6:00 RussiaAsia +06/+07 1991 Mar 31 2:00s 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s - 6:00 - +06 -# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) + 6:00 - +06 2024 Mar 1 0:00 + 5:00 - +05 +# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-43) Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2504,8 +2519,7 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s 6:00 - +06 2018 Dec 21 0:00 5:00 - +05 -# -# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# Qostanay (aka Kostanay, Kustanay) (KZ-39) # The 1991/2 rules are unclear partly because of the 1997 Turgai # reorganization. Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 @@ -2516,9 +2530,9 @@ Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 - -# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) + 6:00 - +06 2024 Mar 1 0:00 + 5:00 - +05 +# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-15) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2528,7 +2542,7 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s 5:00 - +05 -# Mangghystaū (KZ-MAN) +# Mangghystaū (KZ-47) # Aqtau was not founded until 1963, but it represents an inhabited region, # so include timestamps before 1963. Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 @@ -2540,7 +2554,7 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s 5:00 - +05 -# Atyraū (KZ-ATY) is like Mangghystaū except it switched from +# Atyraū (KZ-23) is like Mangghystaū except it switched from # +04/+05 to +05/+06 in spring 1999, not fall 1994. Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2 3:00 - +03 1930 Jun 21 @@ -2551,7 +2565,7 @@ Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1999 Mar 28 2:00s 4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s 5:00 - +05 -# West Kazakhstan (KZ-ZAP) +# West Kazakhstan (KZ-27) # From Paul Eggert (2016-03-18): # The 1989 transition is from USSR act No. 227 (1989-03-14). Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk @@ -3453,19 +3467,26 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # ... winter time will begin in Palestine from Saturday 10-28-2023, # 02:00 AM by 60 minutes back. # -# From Paul Eggert (2023-03-22): +# From Heba Hamad (2024-01-25): +# the summer time for the years 2024,2025 will begin in Palestine +# from Saturday at 02:00 AM by 60 minutes forward as shown below: +# year date +# 2024 2024-04-20 +# 2025 2025-04-12 +# +# From Paul Eggert (2024-01-25): # For now, guess that spring and fall transitions will normally # continue to use 2022's rules, that during DST Palestine will switch # to standard time at 02:00 the last Saturday before Ramadan and back -# to DST at 02:00 the first Saturday after Ramadan, and that +# to DST at 02:00 the second Saturday after Ramadan, and that # if the normal spring-forward or fall-back transition occurs during # Ramadan the former is delayed and the latter advanced. # To implement this, I predicted Ramadan-oriented transition dates for -# 2023 through 2086 by running the following program under GNU Emacs 28.2, +# 2026 through 2086 by running the following program under GNU Emacs 29.2, # with the results integrated by hand into the table below. # Predictions after 2086 are approximated without Ramadan. # -# (let ((islamic-year 1444)) +# (let ((islamic-year 1447)) # (require 'cal-islam) # (while (< islamic-year 1510) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) @@ -3474,6 +3495,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # (while (/= saturday (mod (setq a (1- a)) 7))) # (while (/= saturday (mod b 7)) # (setq b (1+ b))) +# (setq b (+ 7 b)) # (setq a (calendar-gregorian-from-absolute a)) # (setq b (calendar-gregorian-from-absolute b)) # (insert @@ -3524,84 +3546,84 @@ Rule Palestine 2021 only - Oct 29 1:00 0 - Rule Palestine 2022 only - Mar 27 0:00 1:00 S Rule Palestine 2022 2035 - Oct Sat<=30 2:00 0 - Rule Palestine 2023 only - Apr 29 2:00 1:00 S -Rule Palestine 2024 only - Apr 13 2:00 1:00 S -Rule Palestine 2025 only - Apr 5 2:00 1:00 S +Rule Palestine 2024 only - Apr 20 2:00 1:00 S +Rule Palestine 2025 only - Apr 12 2:00 1:00 S Rule Palestine 2026 2054 - Mar Sat<=30 2:00 1:00 S Rule Palestine 2036 only - Oct 18 2:00 0 - Rule Palestine 2037 only - Oct 10 2:00 0 - Rule Palestine 2038 only - Sep 25 2:00 0 - Rule Palestine 2039 only - Sep 17 2:00 0 - -Rule Palestine 2039 only - Oct 22 2:00 1:00 S -Rule Palestine 2039 2067 - Oct Sat<=30 2:00 0 - Rule Palestine 2040 only - Sep 1 2:00 0 - -Rule Palestine 2040 only - Oct 13 2:00 1:00 S +Rule Palestine 2040 only - Oct 20 2:00 1:00 S +Rule Palestine 2040 2067 - Oct Sat<=30 2:00 0 - Rule Palestine 2041 only - Aug 24 2:00 0 - -Rule Palestine 2041 only - Sep 28 2:00 1:00 S +Rule Palestine 2041 only - Oct 5 2:00 1:00 S Rule Palestine 2042 only - Aug 16 2:00 0 - -Rule Palestine 2042 only - Sep 20 2:00 1:00 S +Rule Palestine 2042 only - Sep 27 2:00 1:00 S Rule Palestine 2043 only - Aug 1 2:00 0 - -Rule Palestine 2043 only - Sep 12 2:00 1:00 S +Rule Palestine 2043 only - Sep 19 2:00 1:00 S Rule Palestine 2044 only - Jul 23 2:00 0 - -Rule Palestine 2044 only - Aug 27 2:00 1:00 S +Rule Palestine 2044 only - Sep 3 2:00 1:00 S Rule Palestine 2045 only - Jul 15 2:00 0 - -Rule Palestine 2045 only - Aug 19 2:00 1:00 S +Rule Palestine 2045 only - Aug 26 2:00 1:00 S Rule Palestine 2046 only - Jun 30 2:00 0 - -Rule Palestine 2046 only - Aug 11 2:00 1:00 S +Rule Palestine 2046 only - Aug 18 2:00 1:00 S Rule Palestine 2047 only - Jun 22 2:00 0 - -Rule Palestine 2047 only - Jul 27 2:00 1:00 S +Rule Palestine 2047 only - Aug 3 2:00 1:00 S Rule Palestine 2048 only - Jun 6 2:00 0 - -Rule Palestine 2048 only - Jul 18 2:00 1:00 S +Rule Palestine 2048 only - Jul 25 2:00 1:00 S Rule Palestine 2049 only - May 29 2:00 0 - -Rule Palestine 2049 only - Jul 3 2:00 1:00 S +Rule Palestine 2049 only - Jul 10 2:00 1:00 S Rule Palestine 2050 only - May 21 2:00 0 - -Rule Palestine 2050 only - Jun 25 2:00 1:00 S +Rule Palestine 2050 only - Jul 2 2:00 1:00 S Rule Palestine 2051 only - May 6 2:00 0 - -Rule Palestine 2051 only - Jun 17 2:00 1:00 S +Rule Palestine 2051 only - Jun 24 2:00 1:00 S Rule Palestine 2052 only - Apr 27 2:00 0 - -Rule Palestine 2052 only - Jun 1 2:00 1:00 S +Rule Palestine 2052 only - Jun 8 2:00 1:00 S Rule Palestine 2053 only - Apr 12 2:00 0 - -Rule Palestine 2053 only - May 24 2:00 1:00 S +Rule Palestine 2053 only - May 31 2:00 1:00 S Rule Palestine 2054 only - Apr 4 2:00 0 - -Rule Palestine 2054 only - May 16 2:00 1:00 S -Rule Palestine 2055 only - May 1 2:00 1:00 S -Rule Palestine 2056 only - Apr 22 2:00 1:00 S -Rule Palestine 2057 only - Apr 7 2:00 1:00 S -Rule Palestine 2058 max - Mar Sat<=30 2:00 1:00 S +Rule Palestine 2054 only - May 23 2:00 1:00 S +Rule Palestine 2055 only - May 8 2:00 1:00 S +Rule Palestine 2056 only - Apr 29 2:00 1:00 S +Rule Palestine 2057 only - Apr 14 2:00 1:00 S +Rule Palestine 2058 only - Apr 6 2:00 1:00 S +Rule Palestine 2059 max - Mar Sat<=30 2:00 1:00 S Rule Palestine 2068 only - Oct 20 2:00 0 - Rule Palestine 2069 only - Oct 12 2:00 0 - Rule Palestine 2070 only - Oct 4 2:00 0 - Rule Palestine 2071 only - Sep 19 2:00 0 - Rule Palestine 2072 only - Sep 10 2:00 0 - -Rule Palestine 2072 only - Oct 15 2:00 1:00 S +Rule Palestine 2072 only - Oct 22 2:00 1:00 S Rule Palestine 2072 max - Oct Sat<=30 2:00 0 - Rule Palestine 2073 only - Sep 2 2:00 0 - -Rule Palestine 2073 only - Oct 7 2:00 1:00 S +Rule Palestine 2073 only - Oct 14 2:00 1:00 S Rule Palestine 2074 only - Aug 18 2:00 0 - -Rule Palestine 2074 only - Sep 29 2:00 1:00 S +Rule Palestine 2074 only - Oct 6 2:00 1:00 S Rule Palestine 2075 only - Aug 10 2:00 0 - -Rule Palestine 2075 only - Sep 14 2:00 1:00 S +Rule Palestine 2075 only - Sep 21 2:00 1:00 S Rule Palestine 2076 only - Jul 25 2:00 0 - -Rule Palestine 2076 only - Sep 5 2:00 1:00 S +Rule Palestine 2076 only - Sep 12 2:00 1:00 S Rule Palestine 2077 only - Jul 17 2:00 0 - -Rule Palestine 2077 only - Aug 28 2:00 1:00 S +Rule Palestine 2077 only - Sep 4 2:00 1:00 S Rule Palestine 2078 only - Jul 9 2:00 0 - -Rule Palestine 2078 only - Aug 13 2:00 1:00 S +Rule Palestine 2078 only - Aug 20 2:00 1:00 S Rule Palestine 2079 only - Jun 24 2:00 0 - -Rule Palestine 2079 only - Aug 5 2:00 1:00 S +Rule Palestine 2079 only - Aug 12 2:00 1:00 S Rule Palestine 2080 only - Jun 15 2:00 0 - -Rule Palestine 2080 only - Jul 20 2:00 1:00 S +Rule Palestine 2080 only - Jul 27 2:00 1:00 S Rule Palestine 2081 only - Jun 7 2:00 0 - -Rule Palestine 2081 only - Jul 12 2:00 1:00 S +Rule Palestine 2081 only - Jul 19 2:00 1:00 S Rule Palestine 2082 only - May 23 2:00 0 - -Rule Palestine 2082 only - Jul 4 2:00 1:00 S +Rule Palestine 2082 only - Jul 11 2:00 1:00 S Rule Palestine 2083 only - May 15 2:00 0 - -Rule Palestine 2083 only - Jun 19 2:00 1:00 S +Rule Palestine 2083 only - Jun 26 2:00 1:00 S Rule Palestine 2084 only - Apr 29 2:00 0 - -Rule Palestine 2084 only - Jun 10 2:00 1:00 S +Rule Palestine 2084 only - Jun 17 2:00 1:00 S Rule Palestine 2085 only - Apr 21 2:00 0 - -Rule Palestine 2085 only - Jun 2 2:00 1:00 S +Rule Palestine 2085 only - Jun 9 2:00 1:00 S Rule Palestine 2086 only - Apr 13 2:00 0 - -Rule Palestine 2086 only - May 18 2:00 1:00 S +Rule Palestine 2086 only - May 25 2:00 1:00 S # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -3629,7 +3651,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # Philippines -# From Paul Eggert (2018-11-18): +# From Paul Eggert (2024-01-21): # The Spanish initially used American (west-of-Greenwich) time. # It is unknown what time Manila kept when the British occupied it from # 1762-10-06 through 1764-04; for now assume it kept American time. @@ -3637,7 +3659,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's # History of the International Date Line -# https://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm +# https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm # The rest of the data entries are from Shanks & Pottenger. # From Jesper Nørgaard Welen (2006-04-26): @@ -4064,7 +4086,8 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 # The English-language name of Vietnam's most populous city is "Ho Chi Minh # City"; use Ho_Chi_Minh below to avoid a name of more than 14 characters. -# From Paul Eggert (2022-07-27) after a 2014 heads-up from Trần Ngọc Quân: +# From Paul Eggert (2024-01-14) after a 2014 heads-up from Trần Ngọc Quân +# and a 2024-01-14 heads-up from Đoàn Trần Công Danh: # Trần Tiến Bình's authoritative book "Lịch Việt Nam: thế kỷ XX-XXI (1901-2100)" # (Nhà xuất bản Văn Hoá - Thông Tin, Hanoi, 2005), pp 49-50, # is quoted verbatim in: @@ -4094,14 +4117,35 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2 # # Trần cites the following sources; it's unclear which supplied the info above. # -# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội, -# No. 9, Paris, February 1982. +# Hoàng Xuân Hãn: "Lịch và lịch Việt Nam". Tập san Khoa học Xã hội, +# No. 9, Paris, February 1982. +# +# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)", +# NXB Thống kê, Hanoi, 2000. # -# Lê Thành Lân: "Lịch và niên biểu lịch sử hai mươi thế kỷ (0001-2010)", -# NXB Thống kê, Hanoi, 2000. +# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu", +# NXB Thuận Hoá, Huế, 1995. # -# Lê Thành Lân: "Lịch hai thế kỷ (1802-2010) và các lịch vĩnh cửu", -# NXB Thuận Hoá, Huế, 1995. +# Here is the decision for the September 1945 transition: +# Võ Nguyên Giáp, Việt Nam Dân Quốc Công Báo, No. 1 (1945-09-29), page 13 +# http://baochi.nlv.gov.vn/baochi/cgi-bin/baochi?a=d&d=JwvzO19450929.2.5&dliv=none +# It says that on 1945-09-01 at 24:00, Vietnam moved back two hours, to +07. +# It also mentions a 1945-03-29 decree (by a Japanese Goveror-General) +# to set the time zone to +09, but does not say whether that decree +# merely legalized an earlier change to +09. +# +# July 1955 transition: +# Ngô Đình Diệm, Công Báo Việt Nam, No. 92 (1955-07-02), page 1780-1781 +# Ordinance (Dụ) No. 46 (1955-06-25) +# http://ddsnext.crl.edu/titles/32341#?c=0&m=29&s=0&cv=4&r=0&xywh=-89%2C342%2C1724%2C1216 +# It says that on 1955-07-01 at 01:00, South Vietnam moved back 1 hour (to +07). +# +# December 1959 transition: +# Ngô Đình Diệm, Công Báo Việt Nam Cộng Hòa, 1960 part 1 (1960-01-02), page 62 +# Decree (Sắc lệnh) No. 362-TTP (1959-12-30) +# http://ddsnext.crl.edu/titles/32341#?c=0&m=138&s=0&cv=793&r=0&xywh=-54%2C1504%2C1705%2C1202 +# It says that on 1959-12-31 at 23:00, South Vietnam moved forward 1 hour (to +08). + # Zone NAME STDOFF RULES FORMAT [UNTIL] #STDOFF 7:06:30.13 @@ -4109,9 +4153,9 @@ Zone Asia/Ho_Chi_Minh 7:06:30 - LMT 1906 Jul 1 7:06:30 - PLMT 1911 May 1 # Phù Liễn MT 7:00 - +07 1942 Dec 31 23:00 8:00 - +08 1945 Mar 14 23:00 - 9:00 - +09 1945 Sep 2 + 9:00 - +09 1945 Sep 1 24:00 7:00 - +07 1947 Apr 1 - 8:00 - +08 1955 Jul 1 + 8:00 - +08 1955 Jul 1 01:00 7:00 - +07 1959 Dec 31 23:00 8:00 - +08 1975 Jun 13 7:00 - +07 diff --git a/jdk/make/data/tzdata/australasia b/jdk/make/data/tzdata/australasia index 366cfd10cc1..624735be652 100644 --- a/jdk/make/data/tzdata/australasia +++ b/jdk/make/data/tzdata/australasia @@ -443,11 +443,11 @@ Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva # French Polynesia # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct # Rikitea +Zone Pacific/Gambier -8:59:48 - LMT 1912 Oct 1 # Rikitea -9:00 - -09 -Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct +Zone Pacific/Marquesas -9:18:00 - LMT 1912 Oct 1 -9:30 - -0930 -Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete +Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct 1 # Papeete -10:00 - -10 # Clipperton (near North America) is administered from French Polynesia; # it is uninhabited. @@ -825,7 +825,7 @@ Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5 # Solomon Is # excludes Bougainville, for which see Papua New Guinea # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara +Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct 1 # Honiara 11:00 - +11 # Tokelau @@ -986,6 +986,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. # https://www.jstor.org/stable/1774359 # +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. +# # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # @@ -2062,7 +2066,7 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # ordaining - by a masterpiece of diplomatic flattery - that # the Fourth of July should be celebrated twice in that year." # This happened in 1892, according to the Evening News (Sydney) of 1892-07-20. -# https://www.staff.science.uu.nl/~gent0113/idl/idl.htm +# https://webspace.science.uu.nl/~gent0113/idl/idl_alaska_samoa.htm # Although Shanks & Pottenger says they both switched to UT -11:30 # in 1911, and to -11 in 1950. many earlier sources give -11 diff --git a/jdk/make/data/tzdata/etcetera b/jdk/make/data/tzdata/etcetera index 8ae294f524a..27147715ef6 100644 --- a/jdk/make/data/tzdata/etcetera +++ b/jdk/make/data/tzdata/etcetera @@ -28,7 +28,7 @@ # These entries are for uses not otherwise covered by the tz database. # Their main practical use is for platforms like Android that lack -# support for POSIX-style TZ strings. On such platforms these entries +# support for POSIX.1-2017-style TZ strings. On such platforms these entries # can be useful if the timezone database is wrong or if a ship or # aircraft at sea is not in a timezone. diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe index e526048995d..853df30ef83 100644 --- a/jdk/make/data/tzdata/europe +++ b/jdk/make/data/tzdata/europe @@ -1013,9 +1013,34 @@ Zone Europe/Sofia 1:33:16 - LMT 1880 # Czech Republic (Czechia) # Slovakia # -# From Paul Eggert (2018-04-15): -# The source for Czech data is: Kdy začíná a končí letní čas. 2018-04-15. +# From Ivan Benovic (2024-01-30): +# https://www.slov-lex.sk/pravne-predpisy/SK/ZZ/1946/54/ +# (This is an official link to the Czechoslovak Summer Time Act of +# March 8, 1946 that authorizes the Czechoslovak government to set the +# exact dates of change to summer time and back to Central European Time. +# The act also implicitly confirms Central European Time as the +# official time zone of Czechoslovakia and currently remains in force +# in both the Czech Republic and Slovakia.) +# https://www.psp.cz/eknih/1945pns/tisky/t0216_00.htm +# (This is a link to the original legislative proposal dating back to +# February 22, 1946. The accompanying memorandum to the proposal says +# that an advisory committee on European railroad transportation that +# met in Brussels in October 1945 decided that the change of time +# should be carried out in all participating countries in a strictly +# coordinated manner....) +# +# From Paul Eggert (2024-01-30): +# The source for Czech data is: Kdy začíná a končí letní čas. # https://kalendar.beda.cz/kdy-zacina-a-konci-letni-cas +# Its main text disagrees with its quoted sources only in 1918, +# where the main text says spring and autumn transitions +# occurred at 02:00 and 03:00 respectively (as usual), +# whereas the 1918 source "Oznámení o zavedení letního času v roce 1918" +# says transitions were at 01:00 and 02:00 respectively. +# As the 1918 source appears to be a humorous piece, and it is +# unlikely that Prague would have disagreed with its neighbors by an hour, +# go with the main text for now. +# # We know of no English-language name for historical Czech winter time; # abbreviate it as "GMT", as it happened to be GMT. # diff --git a/jdk/make/data/tzdata/leapseconds b/jdk/make/data/tzdata/leapseconds index ab2c1af4bed..8e7df3de984 100644 --- a/jdk/make/data/tzdata/leapseconds +++ b/jdk/make/data/tzdata/leapseconds @@ -26,13 +26,10 @@ # This file is in the public domain. # This file is generated automatically from the data in the public-domain -# NIST format leap-seconds.list file, which can be copied from -# -# or . -# The NIST file is used instead of its IERS upstream counterpart +# NIST/IERS format leap-seconds.list file, which can be copied from # -# because under US law the NIST file is public domain -# whereas the IERS file's copyright and license status is unclear. +# or, in a variant with different comments, from +# . # For more about leap-seconds.list, please see # The NTP Timescale and Leap Seconds # . @@ -95,11 +92,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2024 Jun 28 00:00:00 +#Expires 2024 Dec 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1719532800 (2024-06-28 00:00:00 UTC) +#updated 1704708379 (2024-01-08 10:06:19 UTC) +#expires 1735344000 (2024-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C66 -# File expires on: 28 June 2024 +# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) +# File expires on 28 December 2024 diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica index b96269a0e26..a8b2ef3f7fa 100644 --- a/jdk/make/data/tzdata/northamerica +++ b/jdk/make/data/tzdata/northamerica @@ -1291,6 +1291,10 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00 # # [PDF] (1914-03) # +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. +# # See the 'europe' file for Greenland. # Canada @@ -1377,7 +1381,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00 # From Paul Eggert (2014-10-18): # H. David Matthews and Mary Vincent's map # "It's about TIME", _Canadian Geographic_ (September-October 1998) -# http://www.canadiangeographic.ca/Magazine/SO98/alacarte.asp +# https://web.archive.org/web/19990827055050/https://canadiangeographic.ca/SO98/geomap.htm # contains detailed boundaries for regions observing nonstandard # time and daylight saving time arrangements in Canada circa 1998. # @@ -1665,6 +1669,15 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # Some cities in the United States have pushed the deadline back # three weeks and will change over from daylight saving in October. +# From Chris Walton (2024-01-09): +# The [Toronto] changes in 1947, 1948, and 1949 took place at 2:00 a.m. local +# time instead of midnight.... Toronto Daily Star - ... +# April 2, 1947 - Page 39 ... April 7, 1948 - Page 13 ... +# April 2, 1949 - Page 1 ... April 7, 1949 - Page 24 ... +# November 25, 1949 - Page 52 ... April 21, 1950 - Page 14 ... +# September 19, 1950 - Page 46 ... September 20, 1950 - Page 3 ... +# November 24, 1950 - Page 21 + # From Arthur David Olson (2010-07-17): # # "Standard Time and Time Zones in Canada" appeared in @@ -1726,13 +1739,9 @@ Rule Toronto 1927 1937 - Sep Sun>=25 2:00 0 S Rule Toronto 1928 1937 - Apr Sun>=25 2:00 1:00 D Rule Toronto 1938 1940 - Apr lastSun 2:00 1:00 D Rule Toronto 1938 1939 - Sep lastSun 2:00 0 S -Rule Toronto 1945 1946 - Sep lastSun 2:00 0 S -Rule Toronto 1946 only - Apr lastSun 2:00 1:00 D -Rule Toronto 1947 1949 - Apr lastSun 0:00 1:00 D -Rule Toronto 1947 1948 - Sep lastSun 0:00 0 S -Rule Toronto 1949 only - Nov lastSun 0:00 0 S -Rule Toronto 1950 1973 - Apr lastSun 2:00 1:00 D -Rule Toronto 1950 only - Nov lastSun 2:00 0 S +Rule Toronto 1945 1948 - Sep lastSun 2:00 0 S +Rule Toronto 1946 1973 - Apr lastSun 2:00 1:00 D +Rule Toronto 1949 1950 - Nov lastSun 2:00 0 S Rule Toronto 1951 1956 - Sep lastSun 2:00 0 S # Shanks & Pottenger say Toronto ended DST a week early in 1971, # namely on 1971-10-24, but Mark Brader wrote (2003-05-31) that this @@ -3455,7 +3464,7 @@ Zone America/Jamaica -5:07:10 - LMT 1890 # Kingston # Martinique # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France - -4:04:20 - FFMT 1911 May # Fort-de-France MT + -4:04:20 - FFMT 1911 May 1 # Fort-de-France MT -4:00 - AST 1980 Apr 6 -4:00 1:00 ADT 1980 Sep 28 -4:00 - AST @@ -3562,7 +3571,7 @@ Zone America/Puerto_Rico -4:24:25 - LMT 1899 Mar 28 12:00 # San Juan # St Pierre and Miquelon # There are too many St Pierres elsewhere, so we'll use 'Miquelon'. # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre +Zone America/Miquelon -3:44:40 - LMT 1911 Jun 15 # St Pierre -4:00 - AST 1980 May -3:00 - -03 1987 -3:00 Canada -03/-02 diff --git a/jdk/make/data/tzdata/southamerica b/jdk/make/data/tzdata/southamerica index da2c6239262..d77acc08857 100644 --- a/jdk/make/data/tzdata/southamerica +++ b/jdk/make/data/tzdata/southamerica @@ -1593,8 +1593,11 @@ Zone Atlantic/Stanley -3:51:24 - LMT 1890 -3:00 - -03 # French Guiana +# For the 1911/1912 establishment of standard time in French possessions, see: +# Société Française de Physique, Recueil de constantes physiques (1913), +# page 752, 18b. # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone America/Cayenne -3:29:20 - LMT 1911 Jul +Zone America/Cayenne -3:29:20 - LMT 1911 Jul 1 -4:00 - -04 1967 Oct -3:00 - -03 diff --git a/jdk/make/mapfiles/libmanagement/mapfile-vers b/jdk/make/mapfiles/libmanagement/mapfile-vers index 7ef8f3ad514..1e1f52578df 100644 --- a/jdk/make/mapfiles/libmanagement/mapfile-vers +++ b/jdk/make/mapfiles/libmanagement/mapfile-vers @@ -89,6 +89,7 @@ SUNWprivate_1.1 { Java_sun_management_ThreadImpl_getThreadUserCpuTime1; Java_sun_management_ThreadImpl_getThreadAllocatedMemory0; Java_sun_management_ThreadImpl_getThreadAllocatedMemory1; + Java_sun_management_ThreadImpl_getTotalThreadAllocatedMemory; Java_sun_management_ThreadImpl_resetContentionTimes0; Java_sun_management_ThreadImpl_resetPeakThreadCount0; Java_sun_management_ThreadImpl_setThreadContentionMonitoringEnabled0; diff --git a/jdk/make/src/classes/build/tools/generatenimbus/PainterGenerator.java b/jdk/make/src/classes/build/tools/generatenimbus/PainterGenerator.java index 07b016d75ff..265ab3c9e65 100644 --- a/jdk/make/src/classes/build/tools/generatenimbus/PainterGenerator.java +++ b/jdk/make/src/classes/build/tools/generatenimbus/PainterGenerator.java @@ -57,6 +57,9 @@ * @author Jasper Potts */ public class PainterGenerator { + + private static final boolean debug = false; + //a handful of counters, incremented whenever the associated object type is encounted. //These counters form the basis of the field and method suffixes. //These are all 1 based, because I felt like it :-) @@ -384,16 +387,24 @@ private float encode(float x, float a, float b, float w) { } if (Float.isNaN(r)) { - System.err.println("[Error] Encountered NaN: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + if (debug) { + System.err.println("[Error] Encountered NaN: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + } return 0; } else if (Float.isInfinite(r)) { - System.err.println("[Error] Encountered Infinity: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + if (debug) { + System.err.println("[Error] Encountered Infinity: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + } return 0; } else if (r < 0) { - System.err.println("[Error] encoded value was less than 0: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + if (debug) { + System.err.println("[Error] encoded value was less than 0: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + } return 0; } else if (r > 3) { - System.err.println("[Error] encoded value was greater than 3: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + if (debug) { + System.err.println("[Error] encoded value was greater than 3: encode(" + x + ", " + a + ", " + b + ", " + w + ")"); + } return 3; } else { return r; diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CTextPipe.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CTextPipe.java index 797e26f3156..30bae2b256a 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CTextPipe.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CTextPipe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,10 +81,57 @@ public void drawString(final SunGraphics2D sg2d, final String s, final double x, } } - public void drawGlyphVector(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) { - final Font prevFont = sg2d.getFont(); - sg2d.setFont(gV.getFont()); + private boolean hasSlotData(GlyphVector gv) { + final int length = gv.getNumGlyphs(); + for (int i = 0; i < length; i++) { + if ((gv.getGlyphCode(i) & CompositeGlyphMapper.SLOTMASK) != 0) { + return true; + } + } + return false; + } + + private Font getSlotFont(Font font, int slot) { + Font2D f2d = FontUtilities.getFont2D(font); + if (f2d instanceof CFont) { + CompositeFont cf = ((CFont)f2d).getCompositeFont2D(); + PhysicalFont pf = cf.getSlotFont(slot); + Font f = new Font(pf.getFontName(null), + font.getStyle(), font.getSize()); + return f; + } + return null; + } + + private GlyphVector getGlyphVectorWithRange(final Font font, final GlyphVector gV, int start, int count) { + int[] glyphs = new int[count]; + for (int i = 0; i < count; i++) { + glyphs[i] = gV.getGlyphCode(start+i) & CompositeGlyphMapper.GLYPHMASK; + } + // Positions should be null to recalculate by native methods, + // if GV was segmented. + StandardGlyphVector sgv = new StandardGlyphVector(font, + gV.getFontRenderContext(), + glyphs, + null, // positions + null, // indices + gV.getLayoutFlags()); + return sgv; + } + + private int getLengthOfSameSlot(final GlyphVector gV, final int targetSlot, final int start, final int length) { + int count = 1; + for (; start + count < length; count++) { + int slot = (gV.getGlyphCode(start + count) & + CompositeGlyphMapper.SLOTMASK) >> 24; + if (targetSlot != slot) { + break; + } + } + return count; + } + private void drawGlyphVectorImpl(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) { final long nativeStrikePtr = getNativeStrikePtr(sg2d); if (OSXSurfaceData.IsSimpleColor(sg2d.paint) && nativeStrikePtr != 0) { final OSXSurfaceData surfaceData = (OSXSurfaceData)sg2d.getSurfaceData(); @@ -92,6 +139,31 @@ public void drawGlyphVector(final SunGraphics2D sg2d, final GlyphVector gV, fina } else { drawGlyphVectorAsShape(sg2d, gV, x, y); } + } + + public void drawGlyphVector(final SunGraphics2D sg2d, final GlyphVector gV, final float x, final float y) { + final Font prevFont = sg2d.getFont(); + sg2d.setFont(gV.getFont()); + + if (hasSlotData(gV)) { + final int length = gV.getNumGlyphs(); + float[] positions = gV.getGlyphPositions(0, length, null); + int start = 0; + while (start < length) { + int slot = (gV.getGlyphCode(start) & + CompositeGlyphMapper.SLOTMASK) >> 24; + sg2d.setFont(getSlotFont(gV.getFont(), slot)); + int count = getLengthOfSameSlot(gV, slot, start, length); + GlyphVector rangeGV = getGlyphVectorWithRange(sg2d.getFont(), + gV, start, count); + drawGlyphVectorImpl(sg2d, rangeGV, + x + positions[start * 2], + y + positions[start * 2 + 1]); + start += count; + } + } else { + drawGlyphVectorImpl(sg2d, gV, x, y); + } sg2d.setFont(prevFont); } diff --git a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java index b1868d5e592..10091860a56 100644 --- a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java +++ b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java @@ -109,6 +109,42 @@ public interface ThreadMXBean extends java.lang.management.ThreadMXBean { */ public long[] getThreadUserTime(long[] ids); + /** + * Returns an approximation of the total amount of memory, in bytes, allocated + * in heap memory by all threads since the Java virtual machine started. + * The returned value is an approximation because some Java virtual machine + * implementations may use object allocation mechanisms that result in a + * delay between the time an object is allocated and the time its size is + * recorded. + * + * @implSpec The default implementation throws {@code UnsupportedOperationException} + * if the Java virtual machine implementation does not support thread + * memory allocation measurement, and otherwise acts as though thread + * memory allocation measurement is disabled. + * + * @return an approximation of the total memory allocated, in bytes, in + * heap memory since the Java virtual machine was started, + * if thread memory allocation measurement is enabled; + * {@code -1} otherwise. + * + * @throws UnsupportedOperationException if the Java virtual + * machine implementation does not support thread memory allocation + * measurement. + * + * @see #isThreadAllocatedMemorySupported + * @see #isThreadAllocatedMemoryEnabled + * @see #setThreadAllocatedMemoryEnabled + * + * @since 8u412 + */ + public default long getTotalThreadAllocatedBytes() { + if (!isThreadAllocatedMemorySupported()) { + throw new UnsupportedOperationException( + "Thread allocated memory measurement is not supported."); + } + return -1; + } + /** * Returns an approximation of the total amount of memory, in bytes, * allocated in heap memory for the current thread. diff --git a/jdk/src/share/classes/sun/jvmstat/monitor/HostIdentifier.java b/jdk/src/share/classes/sun/jvmstat/monitor/HostIdentifier.java index 4ac28a1034a..25bc7445b6d 100644 --- a/jdk/src/share/classes/sun/jvmstat/monitor/HostIdentifier.java +++ b/jdk/src/share/classes/sun/jvmstat/monitor/HostIdentifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -112,6 +112,11 @@ private URI canonicalize(String uriString) throws URISyntaxException { return new URI(uriString); } + if (Character.isDigit(uriString.charAt(0))) { + // may be hostname or hostname:port since it starts with digits + uriString = "//" + uriString; + } + URI u = new URI(uriString); if (u.isAbsolute()) { diff --git a/jdk/src/share/classes/sun/management/ThreadImpl.java b/jdk/src/share/classes/sun/management/ThreadImpl.java index 4d25d7daddb..612821552a5 100644 --- a/jdk/src/share/classes/sun/management/ThreadImpl.java +++ b/jdk/src/share/classes/sun/management/ThreadImpl.java @@ -331,6 +331,13 @@ public void setThreadCpuTimeEnabled(boolean enable) { } } + public long getTotalThreadAllocatedBytes() { + if (isThreadAllocatedMemoryEnabled()) { + return getTotalThreadAllocatedMemory(); + } + return -1; + } + public long getCurrentThreadAllocatedBytes() { if (isThreadAllocatedMemoryEnabled()) { return getThreadAllocatedMemory0(0); @@ -507,6 +514,7 @@ private static native void getThreadInfo1(long[] ids, private static native void getThreadUserCpuTime1(long[] ids, long[] result); private static native long getThreadAllocatedMemory0(long id); private static native void getThreadAllocatedMemory1(long[] ids, long[] result); + private static native long getTotalThreadAllocatedMemory(); private static native void setThreadCpuTimeEnabled0(boolean enable); private static native void setThreadAllocatedMemoryEnabled0(boolean enable); private static native void setThreadContentionMonitoringEnabled0(boolean enable); diff --git a/jdk/src/share/javavm/export/jmm.h b/jdk/src/share/javavm/export/jmm.h index 23d8fa4061a..508b4c8cb1d 100644 --- a/jdk/src/share/javavm/export/jmm.h +++ b/jdk/src/share/javavm/export/jmm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -218,7 +218,8 @@ typedef struct { } dcmdArgInfo; typedef struct jmmInterface_1_ { - void* reserved1; + jlong (JNICALL *GetTotalThreadAllocatedMemory) + (JNIEnv *env); jlong (JNICALL *GetOneThreadAllocatedMemory) (JNIEnv *env, jlong thread_id); diff --git a/jdk/src/share/native/sun/management/ThreadImpl.c b/jdk/src/share/native/sun/management/ThreadImpl.c index b696f2f7de9..c92ec381d10 100644 --- a/jdk/src/share/native/sun/management/ThreadImpl.c +++ b/jdk/src/share/native/sun/management/ThreadImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -98,7 +98,7 @@ JNIEXPORT jlong JNICALL Java_sun_management_ThreadImpl_getThreadAllocatedMemory0 (JNIEnv *env, jclass cls, jlong tid) { - return jmm_interface->GetOneThreadAllocatedMemory(env, tid); + return jmm_interface->GetOneThreadAllocatedMemory(env, tid); } JNIEXPORT void JNICALL @@ -108,6 +108,13 @@ Java_sun_management_ThreadImpl_getThreadAllocatedMemory1 jmm_interface->GetThreadAllocatedMemory(env, ids, sizeArray); } +JNIEXPORT jlong JNICALL +Java_sun_management_ThreadImpl_getTotalThreadAllocatedMemory + (JNIEnv *env, jclass cls) +{ + return jmm_interface->GetTotalThreadAllocatedMemory(env); +} + JNIEXPORT jobjectArray JNICALL Java_sun_management_ThreadImpl_findMonitorDeadlockedThreads0 (JNIEnv *env, jclass cls) diff --git a/jdk/test/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java b/jdk/test/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java index bf4cdc5bb3a..2c4e8f54459 100644 --- a/jdk/test/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java +++ b/jdk/test/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ /* @test %W% %E% + @key headful @bug 6818312 @summary The size returned by SecurityWarning.getSize() should not be zero @author anthony.petrov@sun.com: area=awt.toplevel diff --git a/jdk/test/com/sun/awt/Translucency/WindowOpacity.java b/jdk/test/com/sun/awt/Translucency/WindowOpacity.java index a8391503238..f10182131f3 100644 --- a/jdk/test/com/sun/awt/Translucency/WindowOpacity.java +++ b/jdk/test/com/sun/awt/Translucency/WindowOpacity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ /* @test %W% %E% + @key headful @bug 6594131 @summary Tests the AWTUtilities.get/setWindowOpacity() methods @author anthony.petrov@...: area=awt.toplevel diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java index 9d954f92a85..d54bb06b587 100644 --- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 6173675 8231209 + * @bug 6173675 8231209 8304074 * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes * @author Paul Hohensee */ @@ -33,6 +33,7 @@ public class ThreadAllocatedMemory { private static com.sun.management.ThreadMXBean mbean = (com.sun.management.ThreadMXBean)ManagementFactory.getThreadMXBean(); + private static boolean testFailed = false; private static volatile boolean done = false; private static volatile boolean done1 = false; private static Object obj = new Object(); @@ -55,6 +56,13 @@ public static void main(String[] argv) // Test many threads that are not this one testGetThreadsAllocatedBytes(); + // Test cumulative Java thread allocation since JVM launch + testGetTotalThreadAllocatedBytes(); + + if (testFailed) { + throw new RuntimeException("TEST FAILED"); + } + System.out.println("Test passed"); } @@ -92,13 +100,15 @@ private static void testSupportEnableDisable() { } private static void testGetCurrentThreadAllocatedBytes() { + Thread curThread = Thread.currentThread(); + long size = mbean.getCurrentThreadAllocatedBytes(); - ensureValidSize(size); + ensureValidSize(curThread, size); // do some more allocation doit(); - checkResult(Thread.currentThread(), size, + checkResult(curThread, size, mbean.getCurrentThreadAllocatedBytes()); } @@ -107,7 +117,7 @@ private static void testCurrentThreadGetThreadAllocatedBytes() { long id = curThread.getId(); long size = mbean.getThreadAllocatedBytes(id); - ensureValidSize(size); + ensureValidSize(curThread, size); // do some more allocation doit(); @@ -119,7 +129,8 @@ private static void testGetThreadAllocatedBytes() throws Exception { // start a thread - done = false; done1 = false; + done = false; + done1 = false; Thread curThread = new MyThread("MyThread"); curThread.start(); long id = curThread.getId(); @@ -128,7 +139,7 @@ private static void testGetThreadAllocatedBytes() waitUntilThreadBlocked(curThread); long size = mbean.getThreadAllocatedBytes(id); - ensureValidSize(size); + ensureValidSize(curThread, size); // let thread go to do some more allocation synchronized (obj) { @@ -152,8 +163,7 @@ private static void testGetThreadAllocatedBytes() try { curThread.join(); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); - e.printStackTrace(System.out); + reportUnexpected(e, "during join"); } } @@ -161,7 +171,8 @@ private static void testGetThreadsAllocatedBytes() throws Exception { // start threads - done = false; done1 = false; + done = false; + done1 = false; for (int i = 0; i < NUM_THREADS; i++) { threads[i] = new MyThread("MyThread-" + i); threads[i].start(); @@ -172,7 +183,7 @@ private static void testGetThreadsAllocatedBytes() for (int i = 0; i < NUM_THREADS; i++) { sizes[i] = mbean.getThreadAllocatedBytes(threads[i].getId()); - ensureValidSize(sizes[i]); + ensureValidSize(threads[i], sizes[i]); } // let threads go to do some more allocation @@ -201,38 +212,106 @@ private static void testGetThreadsAllocatedBytes() try { threads[i].join(); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); - e.printStackTrace(System.out); + reportUnexpected(e, "during join"); break; } } } - private static void ensureValidSize(long size) { + private static void testGetTotalThreadAllocatedBytes() + throws Exception { + + // baseline should be positive + Thread curThread = Thread.currentThread(); + long cumulativeSize = mbean.getTotalThreadAllocatedBytes(); + if (cumulativeSize <= 0) { + throw new RuntimeException( + "Invalid allocated bytes returned for " + curThread.getName() + " = " + cumulativeSize); + } + + // start threads + done = false; + done1 = false; + for (int i = 0; i < NUM_THREADS; i++) { + threads[i] = new MyThread("MyThread-" + i); + threads[i].start(); + } + + // wait for threads to block after doing some allocation + waitUntilThreadsBlocked(); + + // check after threads are blocked + cumulativeSize = checkResult(curThread, cumulativeSize, mbean.getTotalThreadAllocatedBytes()); + + // let threads go to do some more allocation + synchronized (obj) { + done = true; + obj.notifyAll(); + } + + // wait for threads to get going again. we don't care if we + // catch them in mid-execution or if some of them haven't + // restarted after we're done sleeping. + goSleep(400); + + System.out.println("Done sleeping"); + + // check while threads are running + cumulativeSize = checkResult(curThread, cumulativeSize, mbean.getTotalThreadAllocatedBytes()); + + // let threads exit + synchronized (obj) { + done1 = true; + obj.notifyAll(); + } + + for (int i = 0; i < NUM_THREADS; i++) { + try { + threads[i].join(); + } catch (InterruptedException e) { + reportUnexpected(e, "during join"); + break; + } + } + + // check after threads exit + checkResult(curThread, cumulativeSize, mbean.getTotalThreadAllocatedBytes()); + } + + private static void ensureValidSize(Thread curThread, long size) { // implementation could have started measurement when // measurement was enabled, in which case size can be 0 if (size < 0) { throw new RuntimeException( - "Invalid allocated bytes returned = " + size); + "Invalid allocated bytes returned for thread " + + curThread.getName() + " = " + size); } } - private static void checkResult(Thread curThread, - long prev_size, long curr_size) { - if (curr_size < prev_size) { - throw new RuntimeException("Allocated bytes " + curr_size + - " expected >= " + prev_size); - } + private static long checkResult(Thread curThread, + long prevSize, long currSize) { System.out.println(curThread.getName() + - " Previous allocated bytes = " + prev_size + - " Current allocated bytes = " + curr_size); + " Previous allocated bytes = " + prevSize + + " Current allocated bytes = " + currSize); + if (currSize < prevSize) { + throw new RuntimeException("TEST FAILED: " + + curThread.getName() + + " previous allocated bytes = " + prevSize + + " > current allocated bytes = " + currSize); + } + return currSize; + } + + private static void reportUnexpected(Exception e, String when) { + System.out.println("Unexpected exception thrown " + when + "."); + e.printStackTrace(System.out); + testFailed = true; } private static void goSleep(long ms) throws Exception { try { Thread.sleep(ms); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); throw e; } } @@ -287,34 +366,23 @@ public void run() { try { obj.wait(); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); - e.printStackTrace(System.out); + reportUnexpected(e, "while !done"); break; } } } - long size1 = mbean.getThreadAllocatedBytes(getId()); + long prevSize = mbean.getThreadAllocatedBytes(getId()); ThreadAllocatedMemory.doit(); - long size2 = mbean.getThreadAllocatedBytes(getId()); - - System.out.println(getName() + ": " + - "ThreadAllocatedBytes = " + size1 + - " ThreadAllocatedBytes = " + size2); - - if (size1 > size2) { - throw new RuntimeException(getName() + - " ThreadAllocatedBytes = " + size1 + - " > ThreadAllocatedBytes = " + size2); - } + long currSize = mbean.getThreadAllocatedBytes(getId()); + checkResult(this, prevSize, currSize); synchronized (obj) { while (!done1) { try { obj.wait(); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); - e.printStackTrace(System.out); + reportUnexpected(e, "while !done1"); break; } } diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java index 980189098cb..d325d1dda66 100644 --- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -47,7 +47,6 @@ public static void main(String[] argv) return; } - // start threads, wait for them to block long[] ids = new long[NUM_THREADS]; @@ -59,7 +58,6 @@ public static void main(String[] argv) waitUntilThreadBlocked(); - // disable allocated memory measurement if (mbean.isThreadAllocatedMemoryEnabled()) { mbean.setThreadAllocatedMemoryEnabled(false); @@ -117,19 +115,9 @@ public static void main(String[] argv) // restarted after we're done sleeping. goSleep(400); - long[] sizes1 = mbean.getThreadAllocatedBytes(ids); - + long[] afterSizes = mbean.getThreadAllocatedBytes(ids); for (int i = 0; i < NUM_THREADS; i++) { - long newSize = sizes1[i]; - if (sizes[i] > newSize) { - throw new RuntimeException("TEST FAILED: " + - threads[i].getName() + - " previous allocated bytes = " + sizes[i] + - " > current allocated bytes = " + newSize); - } - System.out.println(threads[i].getName() + - " Previous allocated bytes = " + sizes[i] + - " Current allocated bytes = " + newSize); + checkResult(threads[i], sizes[i], afterSizes[i]); } try { @@ -147,7 +135,6 @@ public static void main(String[] argv) "Caught expected IllegalArgumentException: " + e.getMessage()); } - // let threads exit synchronized (obj) { done1 = true; @@ -158,9 +145,7 @@ public static void main(String[] argv) try { threads[i].join(); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); - e.printStackTrace(System.out); - testFailed = true; + reportUnexpected(e, "during join"); break; } } @@ -173,11 +158,30 @@ public static void main(String[] argv) } + private static void checkResult(Thread curThread, + long prevSize, long currSize) { + System.out.println(curThread.getName() + + " Previous allocated bytes = " + prevSize + + " Current allocated bytes = " + currSize); + if (currSize < prevSize) { + throw new RuntimeException("TEST FAILED: " + + curThread.getName() + + " previous allocated bytes = " + prevSize + + " > current allocated bytes = " + currSize); + + } + } + + private static void reportUnexpected(Exception e, String when) { + System.out.println("Unexpected exception thrown " + when + "."); + e.printStackTrace(System.out); + testFailed = true; + } + private static void goSleep(long ms) throws Exception { try { Thread.sleep(ms); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); throw e; } } @@ -221,9 +225,7 @@ public void run() { try { obj.wait(); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); - e.printStackTrace(System.out); - testFailed = true; + reportUnexpected(e, "while !done"); break; } } @@ -236,9 +238,7 @@ public void run() { try { obj.wait(); } catch (InterruptedException e) { - System.out.println("Unexpected exception is thrown."); - e.printStackTrace(System.out); - testFailed = true; + reportUnexpected(e, "while !done"); break; } } diff --git a/jdk/test/java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html b/jdk/test/java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html index 9b8277d1d16..d1d92a0ac2e 100644 --- a/jdk/test/java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html +++ b/jdk/test/java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html @@ -1,5 +1,5 @@