RFR: 8268698: Use Objects.check{Index, FromToIndex, FromIndexSize} where possible
After JDK-8265518, it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase. ------------- Commit messages: - use checkIndex globally Changes: https://git.openjdk.java.net/jdk/pull/4507/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8268698 Stats: 206 lines in 34 files changed: 31 ins; 111 del; 64 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 16 Jun 2021 08:08:47 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
I skimmed through all these and the changes seem fine in principal. I have two mild concerns: 1. How does this change the class initialization order on VM startup? 2. Do any tests need adjusting due to potential changes in the exact message used by the IndexOutOfBoundsException? Thanks, David ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 17 Jun 2021 01:51:41 GMT, David Holmes <dholmes@openjdk.org> wrote:
I skimmed through all these and the changes seem fine in principal. I have two mild concerns:
1. How does this change the class initialization order on VM startup? 2. Do any tests need adjusting due to potential changes in the exact message used by the IndexOutOfBoundsException?
Thanks, David
Hi David, your concerns are reasonable. I think this change would not affect the class initialization order, because regardless of whether the patch is applied or not, `java -Xlog:class+load -version` prints identical class initialization order(for j.l.Objects and jdk.internal.util.Preconditions) as far as I can see. [class_load.log](https://github.com/openjdk/jdk/files/6667168/class_load.log). And tier1 tests are all passed w/o any modifications. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 16 Jun 2021 08:08:47 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Class loading order is different to class initialization order. There are a lot more tests than just tier1. :) I don't expect many, if any, tests to be looking for a specific IOOBE message, and I can't see an easy way to find such tests without running them. If core-libs folk are okay with this update then I guess we can just handle any test failures if they arise. But I'll run this through our tier 1-3 testing. Thanks, David ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 17 Jun 2021 05:16:14 GMT, David Holmes <dholmes@openjdk.org> wrote:
There are a lot more tests than just tier1. :) I don't expect many, if any, tests to be looking for a specific IOOBE message, and I can't see an easy way to find such tests without running them. If core-libs folk are okay with this update then I guess we can just handle any test failures if they arise. But I'll run this through our tier 1-3 testing.
It would be good to run tier 1-3. Off hand I can't think of any tests that are dependent on the exception message, I think I'm more concerned about changing behavior (once you throw a more specific IOOBE is some of the very core classes then it's hard to change it because libraries get dependent on the more specific exception). ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On 17/06/2021 8:50 pm, Alan Bateman wrote:
On Thu, 17 Jun 2021 05:16:14 GMT, David Holmes <dholmes@openjdk.org> wrote:
There are a lot more tests than just tier1. :) I don't expect many, if any, tests to be looking for a specific IOOBE message, and I can't see an easy way to find such tests without running them. If core-libs folk are okay with this update then I guess we can just handle any test failures if they arise. But I'll run this through our tier 1-3 testing.
It would be good to run tier 1-3. Off hand I can't think of any tests that are dependent on the exception message, I think I'm more concerned about changing behavior (once you throw a more specific IOOBE is some of the very core classes then it's hard to change it because libraries get dependent on the more specific exception).
tiers 1-3 on Linux-x64 passed okay. Any change to the exact type of exception thrown should be affirmed through a CSR request. Cheers, David
-------------
On Thu, 17 Jun 2021 05:16:14 GMT, David Holmes <dholmes@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Class loading order is different to class initialization order.
There are a lot more tests than just tier1. :) I don't expect many, if any, tests to be looking for a specific IOOBE message, and I can't see an easy way to find such tests without running them. If core-libs folk are okay with this update then I guess we can just handle any test failures if they arise. But I'll run this through our tier 1-3 testing.
Thanks, David
@dholmes-ora @AlanBateman @PaulSandoz do you have any comments on the latest version? Thanks. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Mon, 5 Jul 2021 06:01:23 GMT, Yi Yang <yyang@openjdk.org> wrote:
Class loading order is different to class initialization order.
There are a lot more tests than just tier1. :) I don't expect many, if any, tests to be looking for a specific IOOBE message, and I can't see an easy way to find such tests without running them. If core-libs folk are okay with this update then I guess we can just handle any test failures if they arise. But I'll run this through our tier 1-3 testing.
Thanks, David
@dholmes-ora @AlanBateman @PaulSandoz do you have any comments on the latest version? Thanks.
@kelthuzadx I did not see any response to my query about the change in initialization (not load) order. I also remain concerned about introducing cross dependencies between core classes (e.g. String now uses Precondition, so does that impact Precondition using String?) But these are things for the core-libs folk to be concerned about, or not. Cheers, David ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Mon, 5 Jul 2021 06:29:58 GMT, David Holmes <dholmes@openjdk.org> wrote:
@dholmes-ora @AlanBateman @PaulSandoz do you have any comments on the latest version? Thanks.
@kelthuzadx I did not see any response to my query about the change in initialization (not load) order. I also remain concerned about introducing cross dependencies between core classes (e.g. String now uses Precondition, so does that impact Precondition using String?) But these are things for the core-libs folk to be concerned about, or not.
Cheers, David
@dholmes-ora @AlanBateman @PaulSandoz do you have any comments on the latest version? Thanks.
Alan and Paul are currently on vacation. I'm reviewing it. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Mon, 5 Jul 2021 06:01:23 GMT, Yi Yang <yyang@openjdk.org> wrote:
Class loading order is different to class initialization order.
There are a lot more tests than just tier1. :) I don't expect many, if any, tests to be looking for a specific IOOBE message, and I can't see an easy way to find such tests without running them. If core-libs folk are okay with this update then I guess we can just handle any test failures if they arise. But I'll run this through our tier 1-3 testing.
Thanks, David
@dholmes-ora @AlanBateman @PaulSandoz do you have any comments on the latest version? Thanks.
@kelthuzadx I did not see any response to my query about the change in initialization (not load) order. I also remain concerned about introducing cross dependencies between core classes (e.g. String now uses Precondition, so does that impact Precondition using String?) But these are things for the core-libs folk to be concerned about, or not.
Cheers, David
Hi David, the following are initialization orders: $./java -Xlog:class+init -version [0.255s][info][class,init] 0 Initializing 'java/lang/Object'(no method) (0x0000000800000e18) [0.255s][info][class,init] 1 Initializing 'java/lang/CharSequence'(no method) (0x000000080006ba68) [0.255s][info][class,init] 2 Initializing 'java/lang/String' (0x000000080000e978) [0.255s][info][class,init] 3 Initializing 'java/util/Comparator'(no method) (0x00000008000fd760) [0.255s][info][class,init] 4 Initializing 'java/lang/String$CaseInsensitiveComparator'(no method) (0x0000000800130988) [0.255s][info][class,init] 5 Initializing 'java/lang/System' (0x0000000800008c68) [0.256s][info][class,init] 6 Initializing 'java/lang/reflect/AnnotatedElement'(no method) (0x0000000800001f88) [0.256s][info][class,init] 7 Initializing 'java/lang/reflect/Type'(no method) (0x0000000800002930) [0.256s][info][class,init] 8 Initializing 'java/lang/Class' (0x0000000800001830) [0.256s][info][class,init] 9 Initializing 'java/lang/ThreadGroup'(no method) (0x000000080001d348) [0.257s][info][class,init] 10 Initializing 'java/lang/Thread' (0x000000080001c470) [0.258s][info][class,init] 11 Initializing 'java/security/AccessController' (0x0000000800009a80) [0.258s][info][class,init] 12 Initializing 'java/security/AccessControlContext' (0x00000008000743c8) [0.258s][info][class,init] 13 Initializing 'java/lang/Module' (0x000000080000bab0) [0.259s][info][class,init] 14 Initializing 'java/lang/Module$ArchivedData' (0x00000008001a05a8) [0.259s][info][class,init] 15 Initializing 'jdk/internal/misc/CDS' (0x0000000800018bf8) [0.259s][info][class,init] 16 Initializing 'java/lang/Iterable'(no method) (0x000000080008be28) [0.259s][info][class,init] 17 Initializing 'java/util/Collection'(no method) (0x000000080008c028) [0.260s][info][class,init] 18 Initializing 'java/util/AbstractCollection'(no method) (0x00000008000381e0) [0.260s][info][class,init] 19 Initializing 'java/util/ImmutableCollections$AbstractImmutableCollection'(no method) (0x000000080008c2f8) [0.260s][info][class,init] 20 Initializing 'java/util/Set'(no method) (0x00000008000189f8) [0.260s][info][class,init] 21 Initializing 'java/util/ImmutableCollections$AbstractImmutableSet'(no method) (0x000000080008d018) [0.260s][info][class,init] 22 Initializing 'java/util/ImmutableCollections$Set12'(no method) (0x000000080008ba18) [0.369s][info][class,init] 23 Initializing 'jdk/internal/misc/UnsafeConstants' (0x00000008000b4ea0) [0.369s][info][class,init] 24 Initializing 'java/lang/reflect/AccessibleObject' (0x000000080005b4d8) [0.370s][info][class,init] 25 Initializing 'java/lang/reflect/ReflectAccess'(no method) (0x0000000800013610) [0.370s][info][class,init] 26 Initializing 'jdk/internal/access/SharedSecrets' (0x0000000800013408) [0.370s][info][class,init] 27 Initializing 'java/lang/invoke/MethodHandles' (0x0000000800131720) [0.371s][info][class,init] 28 Initializing 'java/lang/invoke/MemberName' (0x00000008000de230) [0.371s][info][class,init] 29 Initializing 'java/lang/invoke/MemberName$Factory' (0x0000000800023468) [0.372s][info][class,init] 30 Initializing 'java/security/Permission'(no method) (0x0000000800023020) [0.372s][info][class,init] 31 Initializing 'java/security/BasicPermission'(no method) (0x0000000800025de8) [0.372s][info][class,init] 32 Initializing 'java/lang/reflect/ReflectPermission'(no method) (0x0000000800025b98) [0.372s][info][class,init] 33 Initializing 'java/lang/StringLatin1' (0x0000000800022e18) [0.373s][info][class,init] 34 Initializing 'java/lang/invoke/MethodHandles$Lookup' (0x00000008000e3708) [0.373s][info][class,init] 35 Initializing 'java/util/Objects'(no method) (0x000000080008b810) [0.374s][info][class,init] 36 Initializing 'jdk/internal/reflect/Reflection' (0x000000080000fb28) [0.374s][info][class,init] 37 Initializing 'java/util/ImmutableCollections' (0x000000080008d420) [0.374s][info][class,init] 38 Initializing 'java/util/List'(no method) (0x000000080008e460) [0.374s][info][class,init] 39 Initializing 'java/util/ImmutableCollections$AbstractImmutableList'(no method) (0x000000080008c670) [0.374s][info][class,init] 40 Initializing 'java/util/ImmutableCollections$ListN'(no method) (0x00000008001d2ad0) [0.374s][info][class,init] 41 Initializing 'java/util/ImmutableCollections$SetN'(no method) (0x000000080018fd58) [0.375s][info][class,init] 42 Initializing 'java/util/Map'(no method) (0x0000000800018368) [0.375s][info][class,init] 43 Initializing 'java/util/AbstractMap'(no method) (0x0000000800057d08) [0.375s][info][class,init] 44 Initializing 'java/util/ImmutableCollections$AbstractImmutableMap'(no method) (0x000000080011aef8) [0.375s][info][class,init] 45 Initializing 'java/util/ImmutableCollections$MapN'(no method) (0x000000080018a888) [0.487s][info][class,init] 46 Initializing 'java/lang/Math' (0x0000000800027918) [0.488s][info][class,init] 47 Initializing 'java/lang/Number'(no method) (0x000000080003fd18) [0.488s][info][class,init] 48 Initializing 'java/lang/Float' (0x0000000800048978) [0.488s][info][class,init] 49 Initializing 'java/lang/Double' (0x000000080004a478) [0.488s][info][class,init] 50 Initializing 'java/util/HashMap'(no method) (0x000000080011a6a0) [0.489s][info][class,init] 51 Initializing 'java/lang/Integer' (0x000000080004bb58) [0.489s][info][class,init] 52 Initializing 'java/util/AbstractSet'(no method) (0x000000080011ced8) [0.489s][info][class,init] 53 Initializing 'java/util/ImmutableCollections$MapN$1'(no method) (0x00000008001e0f10) [0.489s][info][class,init] 54 Initializing 'java/util/Iterator'(no method) (0x00000008000047d8) [0.489s][info][class,init] 55 Initializing 'java/util/ImmutableCollections$MapN$MapNIterator'(no method) (0x00000008000192c0) [0.490s][info][class,init] 56 Initializing 'java/util/KeyValueHolder'(no method) (0x000000080016d540) [0.490s][info][class,init] 57 Initializing 'java/util/HashMap$Node'(no method) (0x000000080016c8f8) [0.491s][info][class,init] 58 Initializing 'java/util/concurrent/ConcurrentMap'(no method) (0x00000008001872d8) [0.491s][info][class,init] 59 Initializing 'java/util/concurrent/ConcurrentHashMap' (0x000000080000e3d0) [0.491s][info][class,init] 60 Initializing 'java/lang/Runtime' (0x000000080016c650) [0.491s][info][class,init] 61 Initializing 'java/io/ObjectStreamField'(no method) (0x00000008000fd960) [0.492s][info][class,init] 62 Initializing 'jdk/internal/misc/Unsafe' (0x0000000800010140) [0.493s][info][class,init] 63 Initializing 'jdk/internal/reflect/ReflectionFactory$GetReflectionFactoryAction'(no method) (0x0000000800146b08) [0.494s][info][class,init] 64 Initializing 'jdk/internal/reflect/ReflectionFactory' (0x000000080005a630) [0.494s][info][class,init] 65 Initializing 'java/lang/ref/Reference' (0x00000008000533f8) [0.494s][info][class,init] 66 Initializing 'java/lang/ref/Reference$ReferenceHandler' (0x0000000800054af8) [0.495s][info][class,init] 67 Initializing 'java/lang/ref/PhantomReference'(no method) (0x0000000800053640) [0.495s][info][class,init] 68 Initializing 'jdk/internal/ref/Cleaner' (0x00000008000548a0) [0.495s][info][class,init] 69 Initializing 'java/lang/ref/ReferenceQueue' (0x000000080005a1a8) [0.495s][info][class,init] 70 Initializing 'java/lang/ref/ReferenceQueue$Null'(no method) (0x000000080005a3e8) [0.495s][info][class,init] 71 Initializing 'java/lang/ref/ReferenceQueue$Lock'(no method) (0x00000008001f3cd8) [0.496s][info][class,init] 72 Initializing 'java/lang/ref/Reference$1'(no method) (0x000000080005aab0) [0.496s][info][class,init] 73 Initializing 'java/lang/reflect/Executable'(no method) (0x000000080005b798) [0.496s][info][class,init] 74 Initializing 'java/lang/reflect/Method'(no method) (0x000000080005c430) [0.496s][info][class,init] 75 Initializing 'java/lang/ref/FinalReference'(no method) (0x00000008000553d8) [0.496s][info][class,init] 76 Initializing 'java/lang/ref/Finalizer' (0x0000000800055620) [0.496s][info][class,init] 77 Initializing 'java/lang/ref/Finalizer$FinalizerThread'(no method) (0x000000080017e790) [0.497s][info][class,init] 78 Initializing 'java/lang/System$2'(no method) (0x0000000800015b68) [0.498s][info][class,init] 79 Initializing 'jdk/internal/util/SystemProps' (0x0000000800015960) [0.498s][info][class,init] 80 Initializing 'jdk/internal/util/SystemProps$Raw'(no method) (0x000000080009e300) [0.499s][info][class,init] 81 Initializing 'jdk/internal/misc/VM' (0x000000080000fd30) [0.500s][info][class,init] 82 Initializing 'java/lang/StringConcatHelper' (0x0000000800016308) [0.500s][info][class,init] 83 Initializing 'java/lang/Byte' (0x0000000800040330) [0.500s][info][class,init] 84 Initializing 'java/lang/VersionProps' (0x0000000800016100) [0.502s][info][class,init] 85 Initializing 'java/util/Arrays' (0x0000000800027b20) [0.502s][info][class,init] 86 Initializing 'java/lang/Character' (0x000000080003e1c8) [0.502s][info][class,init] 87 Initializing 'java/lang/CharacterData'(no method) (0x00000008000449a8) [0.503s][info][class,init] 88 Initializing 'java/lang/CharacterDataLatin1' (0x0000000800044638) [0.503s][info][class,init] 89 Initializing 'java/lang/Integer$IntegerCache' (0x000000080003fb10) [0.624s][info][class,init] 90 Initializing 'java/util/Dictionary'(no method) (0x0000000800016970) [0.624s][info][class,init] 91 Initializing 'java/util/Hashtable'(no method) (0x0000000800016bb0) [0.624s][info][class,init] 92 Initializing 'java/util/Properties' (0x0000000800016510) [0.624s][info][class,init] 93 Initializing 'java/util/HashMap$EntrySet'(no method) (0x00000008001f0b48) [0.624s][info][class,init] 94 Initializing 'java/util/HashMap$HashIterator'(no method) (0x00000008000199f0) [0.624s][info][class,init] 95 Initializing 'java/util/HashMap$EntryIterator'(no method) (0x0000000800019c00) [0.625s][info][class,init] 96 Initializing 'java/util/concurrent/ConcurrentHashMap$Node'(no method) (0x00000008001be7b8) [0.626s][info][class,init] 97 Initializing 'jdk/internal/util/StaticProperty' (0x00000008000197e8) [0.626s][info][class,init] 98 Initializing 'java/io/InputStream'(no method) (0x000000080001a100) [0.626s][info][class,init] 99 Initializing 'java/io/FileInputStream' (0x0000000800019e48) [0.627s][info][class,init] 100 Initializing 'java/io/FileDescriptor' (0x000000080001ac70) [0.627s][info][class,init] 101 Initializing 'java/io/FileDescriptor$1'(no method) (0x00000008001fe1d8) [0.627s][info][class,init] 102 Initializing 'java/io/OutputStream'(no method) (0x0000000800013cf8) [0.628s][info][class,init] 103 Initializing 'java/io/FileOutputStream' (0x000000080001ae80) [0.628s][info][class,init] 104 Initializing 'java/io/FilterInputStream'(no method) (0x000000080001b630) [0.628s][info][class,init] 105 Initializing 'java/io/BufferedInputStream' (0x000000080001b378) [0.628s][info][class,init] 106 Initializing 'java/io/FilterOutputStream'(no method) (0x0000000800013f70) [0.629s][info][class,init] 107 Initializing 'java/io/PrintStream'(no method) (0x0000000800013948) [0.629s][info][class,init] 108 Initializing 'java/io/BufferedOutputStream'(no method) (0x0000000800018568) [0.629s][info][class,init] 109 Initializing 'java/nio/charset/Charset' (0x000000080009e0a0) [0.629s][info][class,init] 110 Initializing 'java/nio/charset/spi/CharsetProvider'(no method) (0x00000008001f45c8) [0.629s][info][class,init] 111 Initializing 'sun/nio/cs/StandardCharsets' (0x00000008001f47e0) [0.629s][info][class,init] 112 Initializing 'java/lang/ThreadLocal' (0x0000000800027d28) [0.630s][info][class,init] 113 Initializing 'java/util/concurrent/atomic/AtomicInteger' (0x0000000800027f70) [0.630s][info][class,init] 114 Initializing 'sun/nio/cs/Unicode'(no method) (0x000000080009eba8) [0.630s][info][class,init] 115 Initializing 'sun/nio/cs/UTF_8' (0x000000080009ee28) [0.631s][info][class,init] 116 Initializing 'java/io/Writer'(no method) (0x00000008000fa5e0) [0.631s][info][class,init] 117 Initializing 'java/io/OutputStreamWriter'(no method) (0x00000008000fb258) [0.631s][info][class,init] 118 Initializing 'sun/nio/cs/StreamEncoder' (0x00000008000fc1e0) [0.632s][info][class,init] 119 Initializing 'java/nio/charset/CharsetEncoder' (0x00000008000f98c0) [0.632s][info][class,init] 120 Initializing 'sun/nio/cs/UTF_8$Encoder'(no method) (0x00000008010403e0) [0.632s][info][class,init] 121 Initializing 'java/nio/charset/CodingErrorAction' (0x00000008000b6120) [0.633s][info][class,init] 122 Initializing 'java/nio/Buffer' (0x000000080007e418) [0.635s][info][class,init] 123 Initializing 'jdk/internal/misc/ScopedMemoryAccess' (0x00000008000b52a8) [0.636s][info][class,init] 124 Initializing 'java/nio/Buffer$1'(no method) (0x00000008001d5338) [0.636s][info][class,init] 125 Initializing 'java/nio/ByteBuffer' (0x0000000800084418) [0.637s][info][class,init] 126 Initializing 'java/nio/HeapByteBuffer' (0x0000000800207160) [0.637s][info][class,init] 127 Initializing 'java/nio/ByteOrder' (0x000000080001bf60) [0.638s][info][class,init] 128 Initializing 'java/io/BufferedWriter' (0x000000080001c170) [0.638s][info][class,init] 129 Initializing 'java/lang/Terminator' (0x000000080001bd58) [0.638s][info][class,init] 130 Initializing 'java/lang/Terminator$1'(no method) (0x0000000800091328) [0.638s][info][class,init] 131 Initializing 'jdk/internal/misc/Signal' (0x0000000800091118) [0.639s][info][class,init] 132 Initializing 'java/util/Hashtable$Entry'(no method) (0x0000000800188278) [0.639s][info][class,init] 133 Initializing 'jdk/internal/misc/Signal$Handler' (0x0000000800091550) [0.639s][info][class,init] 134 Initializing 'jdk/internal/misc/Signal$NativeHandler'(no method) (0x000000080020dd80) [0.639s][info][class,init] 135 Initializing 'jdk/internal/misc/OSEnvironment'(no method) (0x0000000800037dc8) [0.640s][info][class,init] 136 Initializing 'java/lang/Throwable' (0x00000008000339d8) [0.640s][info][class,init] 137 Initializing 'java/util/Collections' (0x0000000800037bc0) [0.640s][info][class,init] 138 Initializing 'java/util/Collections$EmptySet'(no method) (0x000000080011d2e0) [0.640s][info][class,init] 139 Initializing 'java/util/AbstractList'(no method) (0x000000080008e660) [0.640s][info][class,init] 140 Initializing 'java/util/Collections$EmptyList'(no method) (0x00000008001c97d0) [0.641s][info][class,init] 141 Initializing 'java/util/Collections$EmptyMap'(no method) (0x0000000800058498) [0.641s][info][class,init] 142 Initializing 'java/lang/Error'(no method) (0x0000000800035558) [0.641s][info][class,init] 143 Initializing 'java/lang/VirtualMachineError'(no method) (0x00000008000357b8) [0.641s][info][class,init] 144 Initializing 'java/lang/OutOfMemoryError'(no method) (0x0000000800099da8) [0.641s][info][class,init] 145 Initializing 'java/lang/Exception'(no method) (0x0000000800033c38) [0.641s][info][class,init] 146 Initializing 'java/lang/RuntimeException'(no method) (0x0000000800034e08) [0.641s][info][class,init] 147 Initializing 'java/lang/NullPointerException'(no method) (0x0000000800099950) [0.641s][info][class,init] 148 Initializing 'java/lang/ClassCastException'(no method) (0x000000080009a5f8) [0.641s][info][class,init] 149 Initializing 'java/lang/ArrayStoreException'(no method) (0x0000000800035ed8) [0.641s][info][class,init] 150 Initializing 'java/lang/ArithmeticException'(no method) (0x00000008000996f0) [0.641s][info][class,init] 151 Initializing 'java/lang/StackOverflowError'(no method) (0x0000000800035a18) [0.641s][info][class,init] 152 Initializing 'java/lang/IllegalMonitorStateException'(no method) (0x00000008000570e0) [0.641s][info][class,init] 153 Initializing 'java/lang/IllegalArgumentException'(no method) (0x0000000800035068) [0.643s][info][class,init] 154 Initializing 'java/lang/invoke/MethodHandle' (0x00000008000c8200) [0.644s][info][class,init] 155 Initializing 'java/lang/invoke/MethodHandleStatics' (0x000000080001e260) [0.644s][info][class,init] 156 Initializing 'sun/security/action/GetPropertyAction'(no method) (0x00000008000fa3a8) [0.644s][info][class,init] 157 Initializing 'java/lang/Boolean' (0x0000000800038f10) [0.645s][info][class,init] 158 Initializing 'java/lang/invoke/ResolvedMethodName'(no method) (0x00000008000e1fc0) [0.645s][info][class,init] 159 Initializing 'java/lang/invoke/MethodHandleNatives' (0x00000008000e22b0) [0.645s][info][class,init] 160 Initializing 'jdk/internal/module/ModuleBootstrap' (0x000000080001e058) [0.646s][info][class,init] 161 Initializing 'sun/invoke/util/VerifyAccess' (0x000000080007a938) [0.646s][info][class,init] 162 Initializing 'java/lang/reflect/Modifier'(no method) (0x000000080007a730) [0.647s][info][class,init] 163 Initializing 'java/lang/module/ModuleDescriptor' (0x000000080013a608) [0.647s][info][class,init] 164 Initializing 'java/lang/module/ModuleDescriptor$1'(no method) (0x000000080007a258) [0.647s][info][class,init] 165 Initializing 'java/io/File' (0x0000000800079ec0) [0.648s][info][class,init] 166 Initializing 'java/io/DefaultFileSystem'(no method) (0x00000008000afa80) [0.648s][info][class,init] 167 Initializing 'java/io/FileSystem' (0x00000008000adb08) [0.648s][info][class,init] 168 Initializing 'java/io/UnixFileSystem' (0x00000008000addf0) [0.649s][info][class,init] 169 Initializing 'java/lang/AbstractStringBuilder' (0x000000080006c268) [0.649s][info][class,init] 170 Initializing 'java/lang/StringBuilder'(no method) (0x000000080000f478) [0.650s][info][class,init] 171 Initializing 'jdk/internal/util/ArraysSupport' (0x00000008000ad900) [0.650s][info][class,init] 172 Initializing 'jdk/internal/module/ModulePatcher' (0x00000008001945b0) [0.651s][info][class,init] 173 Initializing 'jdk/internal/module/ModuleBootstrap$Counters' (0x0000000800192aa8) [0.651s][info][class,init] 174 Initializing 'jdk/internal/module/ArchivedBootLayer' (0x0000000800192890) [0.651s][info][class,init] 175 Initializing 'java/lang/ModuleLayer' (0x0000000800175c40) [0.651s][info][class,init] 176 Initializing 'java/lang/module/Configuration' (0x000000080018e820) [0.918s][info][class,init] 177 Initializing 'jdk/internal/loader/AbstractClassLoaderValue' (0x000000080018eeb0) [0.918s][info][class,init] 178 Initializing 'jdk/internal/loader/ClassLoaderValue'(no method) (0x000000080018f0f8) [0.918s][info][class,init] 179 Initializing 'java/util/ImmutableCollections$List12'(no method) (0x000000080008cb40) [0.918s][info][class,init] 180 Initializing 'java/lang/module/ResolvedModule'(no method) (0x00000008001917c8) [0.918s][info][class,init] 181 Initializing 'java/lang/module/ModuleReference'(no method) (0x00000008000d1f40) [0.918s][info][class,init] 182 Initializing 'jdk/internal/module/ModuleReferenceImpl'(no method) (0x000000080018bf00) [0.918s][info][class,init] 183 Initializing 'java/lang/module/ModuleDescriptor$Version'(no method) (0x000000080018ceb8) [0.918s][info][class,init] 184 Initializing 'java/util/ArrayList' (0x000000080000dea8) [0.919s][info][class,init] 185 Initializing 'java/lang/module/ModuleDescriptor$Requires' (0x0000000800178b80) [0.919s][info][class,init] 186 Initializing 'java/lang/Enum'(no method) (0x0000000800007880) [0.919s][info][class,init] 187 Initializing 'java/lang/module/ModuleDescriptor$Requires$Modifier' (0x0000000800094980) [0.919s][info][class,init] 188 Initializing 'java/lang/module/ModuleDescriptor$Exports'(no method) (0x0000000800178958) [0.919s][info][class,init] 189 Initializing 'java/lang/module/ModuleDescriptor$Provides'(no method) (0x000000080018d0e0) [0.919s][info][class,init] 190 Initializing 'java/net/URI' (0x0000000800192228) [0.920s][info][class,init] 191 Initializing 'java/net/URI$1'(no method) (0x000000080022bb10) [0.920s][info][class,init] 192 Initializing 'jdk/internal/module/SystemModuleFinders$2'(no method) (0x000000080018bcc8) [0.920s][info][class,init] 193 Initializing 'jdk/internal/module/SystemModuleFinders$3'(no method) (0x00000008001947c0) [0.920s][info][class,init] 194 Initializing 'jdk/internal/module/ModuleTarget'(no method) (0x0000000800225ca0) [0.920s][info][class,init] 195 Initializing 'jdk/internal/module/ModuleHashes'(no method) (0x00000008001941a0) [0.920s][info][class,init] 196 Initializing 'java/util/Collections$UnmodifiableMap'(no method) (0x0000000800213c70) [0.920s][info][class,init] 197 Initializing 'java/lang/module/ModuleDescriptor$Opens'(no method) (0x0000000800178730) [0.920s][info][class,init] 198 Initializing 'java/util/HashSet' (0x000000080011cac8) [0.920s][info][class,init] 199 Initializing 'java/lang/ClassLoader' (0x0000000800008e70) [0.921s][info][class,init] 200 Initializing 'java/security/SecureClassLoader' (0x0000000800009450) [0.921s][info][class,init] 201 Initializing 'java/lang/ClassLoader$ParallelLoaders' (0x000000080000f270) [0.921s][info][class,init] 202 Initializing 'java/util/WeakHashMap' (0x0000000800057948) [0.922s][info][class,init] 203 Initializing 'java/util/Collections$SetFromMap'(no method) (0x000000080021a8c8) [0.922s][info][class,init] 204 Initializing 'java/util/WeakHashMap$KeySet'(no method) (0x000000080017b698) [0.922s][info][class,init] 205 Initializing 'java/lang/ref/WeakReference'(no method) (0x0000000800055a20) [0.922s][info][class,init] 206 Initializing 'java/util/WeakHashMap$Entry'(no method) (0x00000008000576a8) [0.923s][info][class,init] 207 Initializing 'jdk/internal/loader/BuiltinClassLoader' (0x0000000800009748) [0.923s][info][class,init] 208 Initializing 'jdk/internal/loader/ArchivedClassLoaders' (0x00000008001bda48) [0.923s][info][class,init] 209 Initializing 'jdk/internal/loader/ClassLoaders$BootClassLoader'(no method) (0x00000008001be2c8) [0.923s][info][class,init] 210 Initializing 'java/security/ProtectionDomain' (0x000000080000ec18) [0.923s][info][class,init] 211 Initializing 'java/security/ProtectionDomain$JavaSecurityAccessImpl'(no method) (0x000000080017b240) [0.923s][info][class,init] 212 Initializing 'java/security/CodeSource'(no method) (0x000000080000ee38) [0.923s][info][class,init] 213 Initializing 'java/security/Principal'(no method) (0x000000080017be08) [0.923s][info][class,init] 214 Initializing 'java/security/ProtectionDomain$Key'(no method) (0x000000080017b038) [0.923s][info][class,init] 215 Initializing 'jdk/internal/loader/NativeLibraries' (0x000000080000f060) [0.924s][info][class,init] 216 Initializing 'java/util/ArrayDeque'(no method) (0x0000000800169620) [0.924s][info][class,init] 217 Initializing 'jdk/internal/module/ServicesCatalog' (0x000000080013cb28) [0.924s][info][class,init] 218 Initializing 'java/util/concurrent/CopyOnWriteArrayList'(no method) (0x0000000800231220) [0.924s][info][class,init] 219 Initializing 'jdk/internal/module/ServicesCatalog$ServiceProvider'(no method) (0x0000000800231730) [0.924s][info][class,init] 220 Initializing 'jdk/internal/loader/ClassLoaders$PlatformClassLoader' (0x00000008000990b8) [0.924s][info][class,init] 221 Initializing 'jdk/internal/loader/BuiltinClassLoader$LoadedModule'(no method) (0x000000080018ec80) [1.051s][info][class,init] 222 Initializing 'jdk/internal/loader/ClassLoaders$AppClassLoader' (0x0000000800096cc0) [1.176s][info][class,init] 223 Initializing 'jdk/internal/loader/BootLoader' (0x000000080013c1d8) [1.176s][info][class,init] 224 Initializing 'jdk/internal/loader/ClassLoaders' (0x000000080000ff38) [1.177s][info][class,init] 225 Initializing 'jdk/internal/loader/URLClassPath' (0x00000008001b60c8) [1.178s][info][class,init] 226 Initializing 'java/net/URL' (0x0000000800075b88) [1.178s][info][class,init] 227 Initializing 'java/net/URL$DefaultFactory' (0x0000000800094250) [1.178s][info][class,init] 228 Initializing 'java/net/URL$3'(no method) (0x0000000800093e28) [1.179s][info][class,init] 229 Initializing 'java/io/File$PathStatus' (0x0000000800094738) [1.180s][info][class,init] 230 Initializing 'sun/net/www/ParseUtil' (0x0000000800093c20) [1.180s][info][class,init] 231 Initializing 'java/util/HexFormat' (0x0000000800096088) [1.181s][info][class,init] 232 Initializing 'java/net/URLStreamHandler'(no method) (0x00000008001b3148) [1.181s][info][class,init] 233 Initializing 'sun/net/www/protocol/file/Handler'(no method) (0x00000008001b38f8) [1.182s][info][class,init] 234 Initializing 'sun/net/util/IPAddressUtil' (0x0000000800090688) [1.183s][info][class,init] 235 Initializing 'jdk/internal/util/Preconditions'(no method) (0x0000000800090480) [1.184s][info][class,init] 236 Initializing 'java/lang/invoke/StringConcatFactory' (0x000000080001e468) [1.185s][info][class,init] 237 Initializing 'java/util/function/Function'(no method) (0x00000008001151e8) [1.185s][info][class,init] 238 Initializing 'java/lang/invoke/StringConcatFactory$1'(no method) (0x0000000800235200) [1.185s][info][class,init] 239 Initializing 'java/lang/invoke/StringConcatFactory$2'(no method) (0x0000000800235770) [1.185s][info][class,init] 240 Initializing 'java/lang/invoke/StringConcatFactory$3'(no method) (0x0000000800043b98) [1.187s][info][class,init] 241 Initializing 'java/nio/CharBuffer' (0x0000000800081918) [1.187s][info][class,init] 242 Initializing 'java/nio/HeapCharBuffer' (0x0000000800081f90) [1.188s][info][class,init] 243 Initializing 'java/nio/charset/CoderResult' (0x00000008000b5a90) openjdk version "18-internal" 2022-03-15 OpenJDK Runtime Environment (slowdebug build 18-internal+0-adhoc.qingfengyy.jdktip) OpenJDK 64-Bit Server VM (slowdebug build 18-internal+0-adhoc.qingfengyy.jdktip, mixed mode, sharing) [1.192s][info][class,init] 244 Initializing 'java/lang/Shutdown' (0x0000000800050c98) [1.192s][info][class,init] 245 Initializing 'java/lang/Shutdown$Lock'(no method) (0x00000008000264d8) $./java -Xlog:class+init -version [0.020s][info][class,init] 0 Initializing java/lang/Object'java/lang/Object'(no method) (0x0000000800000d68) [0.020s][info][class,init] 1 Initializing java/lang/CharSequence'java/lang/CharSequence'(no method) (0x0000000800065478) [0.020s][info][class,init] 2 Initializing java/lang/String'java/lang/String' (0x000000080000e4a0) [0.020s][info][class,init] 3 Initializing java/util/Comparator'java/util/Comparator'(no method) (0x00000008000ea748) [0.020s][info][class,init] 4 Initializing java/lang/String$CaseInsensitiveComparator'java/lang/String$CaseInsensitiveComparator'(no method) (0x000000080011ba70) [0.020s][info][class,init] 5 Initializing java/lang/System'java/lang/System' (0x00000008000088f8) [0.020s][info][class,init] 6 Initializing java/lang/reflect/AnnotatedElement'java/lang/reflect/AnnotatedElement'(no method) (0x0000000800001eb0) [0.020s][info][class,init] 7 Initializing java/lang/reflect/Type'java/lang/reflect/Type'(no method) (0x00000008000027e0) [0.020s][info][class,init] 8 Initializing java/lang/Class'java/lang/Class' (0x0000000800001750) [0.020s][info][class,init] 9 Initializing java/lang/ThreadGroup'java/lang/ThreadGroup'(no method) (0x000000080001c1e8) [0.020s][info][class,init] 10 Initializing java/lang/Thread'java/lang/Thread' (0x000000080001b3d0) [0.020s][info][class,init] 11 Initializing java/security/AccessController'java/security/AccessController' (0x0000000800009738) [0.020s][info][class,init] 12 Initializing java/security/AccessControlContext'java/security/AccessControlContext' (0x000000080006d2c8) [0.020s][info][class,init] 13 Initializing java/lang/Module'java/lang/Module' (0x000000080000b5c0) [0.021s][info][class,init] 14 Initializing java/lang/Module$ArchivedData'java/lang/Module$ArchivedData' (0x0000000800186270) [0.021s][info][class,init] 15 Initializing jdk/internal/misc/CDS'jdk/internal/misc/CDS' (0x0000000800017d08) [0.021s][info][class,init] 16 Initializing java/lang/Iterable'java/lang/Iterable'(no method) (0x0000000800082f10) [0.021s][info][class,init] 17 Initializing java/util/Collection'java/util/Collection'(no method) (0x0000000800083118) [0.021s][info][class,init] 18 Initializing java/util/AbstractCollection'java/util/AbstractCollection'(no method) (0x00000008000357c8) [0.021s][info][class,init] 19 Initializing java/util/ImmutableCollections$AbstractImmutableCollection'java/util/ImmutableCollections$AbstractImmutableCollection'(no method) (0x00000008000833d0) [0.021s][info][class,init] 20 Initializing java/util/Set'java/util/Set'(no method) (0x0000000800017b00) [0.021s][info][class,init] 21 Initializing java/util/ImmutableCollections$AbstractImmutableSet'java/util/ImmutableCollections$AbstractImmutableSet'(no method) (0x0000000800084108) [0.021s][info][class,init] 22 Initializing java/util/ImmutableCollections$Set12'java/util/ImmutableCollections$Set12'(no method) (0x0000000800082af8) [0.021s][info][class,init] 23 Initializing jdk/internal/misc/UnsafeConstants'jdk/internal/misc/UnsafeConstants' (0x00000008000a7ff0) [0.021s][info][class,init] 24 Initializing java/lang/reflect/AccessibleObject'java/lang/reflect/AccessibleObject' (0x0000000800056450) [0.021s][info][class,init] 25 Initializing java/lang/reflect/ReflectAccess'java/lang/reflect/ReflectAccess'(no method) (0x0000000800012c50) [0.021s][info][class,init] 26 Initializing jdk/internal/access/SharedSecrets'jdk/internal/access/SharedSecrets' (0x0000000800012a40) [0.021s][info][class,init] 27 Initializing java/lang/invoke/MethodHandles'java/lang/invoke/MethodHandles' (0x000000080011c780) [0.021s][info][class,init] 28 Initializing java/lang/invoke/MemberName'java/lang/invoke/MemberName' (0x00000008000cdbb8) [0.021s][info][class,init] 29 Initializing java/lang/invoke/MemberName$Factory'java/lang/invoke/MemberName$Factory' (0x0000000800021bb0) [0.021s][info][class,init] 30 Initializing java/security/Permission'java/security/Permission'(no method) (0x0000000800021758) [0.021s][info][class,init] 31 Initializing java/security/BasicPermission'java/security/BasicPermission'(no method) (0x0000000800024338) [0.021s][info][class,init] 32 Initializing java/lang/reflect/ReflectPermission'java/lang/reflect/ReflectPermission'(no method) (0x00000008000240e0) [0.021s][info][class,init] 33 Initializing java/lang/StringLatin1'java/lang/StringLatin1' (0x0000000800021548) [0.022s][info][class,init] 34 Initializing java/lang/invoke/MethodHandles$Lookup'java/lang/invoke/MethodHandles$Lookup' (0x00000008000d2af8) [0.022s][info][class,init] 35 Initializing java/util/Objects'java/util/Objects'(no method) (0x00000008000828e8) [0.022s][info][class,init] 36 Initializing jdk/internal/reflect/Reflection'jdk/internal/reflect/Reflection' (0x000000080000f688) [0.022s][info][class,init] 37 Initializing java/util/ImmutableCollections'java/util/ImmutableCollections' (0x0000000800084518) [0.022s][info][class,init] 38 Initializing java/util/List'java/util/List'(no method) (0x0000000800085330) [0.022s][info][class,init] 39 Initializing java/util/ImmutableCollections$AbstractImmutableList'java/util/ImmutableCollections$AbstractImmutableList'(no method) (0x0000000800083750) [0.022s][info][class,init] 40 Initializing java/util/ImmutableCollections$ListN'java/util/ImmutableCollections$ListN'(no method) (0x0000000800170ea0) [0.022s][info][class,init] 41 Initializing java/util/ImmutableCollections$SetN'java/util/ImmutableCollections$SetN'(no method) (0x0000000800170a88) [0.022s][info][class,init] 42 Initializing java/util/Map'java/util/Map'(no method) (0x00000008000174b0) [0.022s][info][class,init] 43 Initializing java/util/AbstractMap'java/util/AbstractMap'(no method) (0x0000000800052fb8) [0.022s][info][class,init] 44 Initializing java/util/ImmutableCollections$AbstractImmutableMap'java/util/ImmutableCollections$AbstractImmutableMap'(no method) (0x00000008001706e0) [0.022s][info][class,init] 45 Initializing java/util/ImmutableCollections$MapN'java/util/ImmutableCollections$MapN'(no method) (0x0000000800172340) [0.022s][info][class,init] 46 Initializing java/lang/Math'java/lang/Math' (0x0000000800025dc8) [0.022s][info][class,init] 47 Initializing java/lang/Number'java/lang/Number'(no method) (0x000000080003cc38) [0.022s][info][class,init] 48 Initializing java/lang/Float'java/lang/Float' (0x0000000800044c98) [0.022s][info][class,init] 49 Initializing java/lang/Double'java/lang/Double' (0x0000000800046560) [0.022s][info][class,init] 50 Initializing java/util/HashMap'java/util/HashMap'(no method) (0x00000008000efe78) [0.022s][info][class,init] 51 Initializing java/lang/Integer'java/lang/Integer' (0x0000000800047a18) [0.022s][info][class,init] 52 Initializing java/util/AbstractSet'java/util/AbstractSet'(no method) (0x0000000800109688) [0.022s][info][class,init] 53 Initializing java/util/ImmutableCollections$MapN$1'java/util/ImmutableCollections$MapN$1'(no method) (0x00000008001c28d8) [0.022s][info][class,init] 54 Initializing java/util/Iterator'java/util/Iterator'(no method) (0x0000000800004680) [0.022s][info][class,init] 55 Initializing java/util/ImmutableCollections$MapN$MapNIterator'java/util/ImmutableCollections$MapN$MapNIterator'(no method) (0x00000008000183c8) [0.022s][info][class,init] 56 Initializing java/util/KeyValueHolder'java/util/KeyValueHolder'(no method) (0x0000000800155370) [0.022s][info][class,init] 57 Initializing java/util/HashMap$Node'java/util/HashMap$Node'(no method) (0x0000000800154778) [0.023s][info][class,init] 58 Initializing java/util/concurrent/ConcurrentMap'java/util/concurrent/ConcurrentMap'(no method) (0x000000080016d3b0) [0.023s][info][class,init] 59 Initializing java/util/concurrent/ConcurrentHashMap'java/util/concurrent/ConcurrentHashMap' (0x000000080000def0) [0.023s][info][class,init] 60 Initializing java/lang/Runtime'java/lang/Runtime' (0x00000008001544c8) [0.023s][info][class,init] 61 Initializing java/io/ObjectStreamField'java/io/ObjectStreamField'(no method) (0x00000008000ea950) [0.023s][info][class,init] 62 Initializing jdk/internal/misc/Unsafe'jdk/internal/misc/Unsafe' (0x000000080000fcb8) [0.023s][info][class,init] 63 Initializing jdk/internal/reflect/ReflectionFactory$GetReflectionFactoryAction'jdk/internal/reflect/ReflectionFactory$GetReflectionFactoryAction'(no method) (0x00000008001308b8) [0.023s][info][class,init] 64 Initializing jdk/internal/reflect/ReflectionFactory'jdk/internal/reflect/ReflectionFactory' (0x00000008000556c0) [0.023s][info][class,init] 65 Initializing java/lang/ref/Reference'java/lang/ref/Reference' (0x000000080004e880) [0.023s][info][class,init] 66 Initializing java/lang/ref/Reference$ReferenceHandler'java/lang/ref/Reference$ReferenceHandler' (0x000000080004ff10) [0.023s][info][class,init] 67 Initializing java/lang/ref/PhantomReference'java/lang/ref/PhantomReference'(no method) (0x000000080004ead0) [0.023s][info][class,init] 68 Initializing jdk/internal/ref/Cleaner'jdk/internal/ref/Cleaner' (0x000000080004fcb0) [0.023s][info][class,init] 69 Initializing java/lang/ref/ReferenceQueue'java/lang/ref/ReferenceQueue' (0x0000000800055228) [0.023s][info][class,init] 70 Initializing java/lang/ref/ReferenceQueue$Null'java/lang/ref/ReferenceQueue$Null'(no method) (0x0000000800055470) [0.023s][info][class,init] 71 Initializing java/lang/ref/ReferenceQueue$Lock'java/lang/ref/ReferenceQueue$Lock'(no method) (0x00000008001d49d8) [0.023s][info][class,init] 72 Initializing java/lang/ref/Reference$1'java/lang/ref/Reference$1'(no method) (0x0000000800055af8) [0.023s][info][class,init] 73 Initializing java/lang/reflect/Executable'java/lang/reflect/Executable'(no method) (0x0000000800056718) [0.023s][info][class,init] 74 Initializing java/lang/reflect/Method'java/lang/reflect/Method'(no method) (0x00000008000573d0) [0.023s][info][class,init] 75 Initializing java/lang/ref/FinalReference'java/lang/ref/FinalReference'(no method) (0x0000000800050768) [0.023s][info][class,init] 76 Initializing java/lang/ref/Finalizer'java/lang/ref/Finalizer' (0x00000008000509b8) [0.023s][info][class,init] 77 Initializing java/lang/ref/Finalizer$FinalizerThread'java/lang/ref/Finalizer$FinalizerThread'(no method) (0x00000008000d2f70) [0.024s][info][class,init] 78 Initializing java/lang/System$2'java/lang/System$2'(no method) (0x0000000800014f90) [0.024s][info][class,init] 79 Initializing jdk/internal/util/SystemProps'jdk/internal/util/SystemProps' (0x0000000800014d80) [0.024s][info][class,init] 80 Initializing jdk/internal/misc/VM'jdk/internal/misc/VM' (0x000000080000f898) [0.024s][info][class,init] 81 Initializing jdk/internal/util/SystemProps$Raw'jdk/internal/util/SystemProps$Raw'(no method) (0x0000000800094718) [0.024s][info][class,init] 82 Initializing java/lang/StringConcatHelper'java/lang/StringConcatHelper' (0x0000000800015740) [0.024s][info][class,init] 83 Initializing java/lang/Byte'java/lang/Byte' (0x000000080003d268) [0.024s][info][class,init] 84 Initializing java/lang/VersionProps'java/lang/VersionProps' (0x0000000800015530) [0.024s][info][class,init] 85 Initializing java/util/Arrays'java/util/Arrays' (0x0000000800025fd8) [0.025s][info][class,init] 86 Initializing java/lang/Character'java/lang/Character' (0x000000080003b0f0) [0.025s][info][class,init] 87 Initializing java/lang/CharacterData'java/lang/CharacterData'(no method) (0x0000000800041218) [0.025s][info][class,init] 88 Initializing java/lang/CharacterDataLatin1'java/lang/CharacterDataLatin1' (0x0000000800040ea0) [0.025s][info][class,init] 89 Initializing java/lang/Integer$IntegerCache'java/lang/Integer$IntegerCache' (0x000000080003ca28) [0.025s][info][class,init] 90 Initializing java/util/Dictionary'java/util/Dictionary'(no method) (0x0000000800015db8) [0.025s][info][class,init] 91 Initializing java/util/Hashtable'java/util/Hashtable'(no method) (0x0000000800016000) [0.025s][info][class,init] 92 Initializing java/util/Properties'java/util/Properties' (0x0000000800015950) [0.025s][info][class,init] 93 Initializing java/util/HashMap$EntrySet'java/util/HashMap$EntrySet'(no method) (0x00000008001d1a30) [0.025s][info][class,init] 94 Initializing java/util/HashMap$HashIterator'java/util/HashMap$HashIterator'(no method) (0x0000000800018af0) [0.025s][info][class,init] 95 Initializing java/util/HashMap$EntryIterator'java/util/HashMap$EntryIterator'(no method) (0x0000000800018d08) [0.025s][info][class,init] 96 Initializing java/util/concurrent/ConcurrentHashMap$Node'java/util/concurrent/ConcurrentHashMap$Node'(no method) (0x00000008001a2628) [0.025s][info][class,init] 97 Initializing jdk/internal/util/StaticProperty'jdk/internal/util/StaticProperty' (0x00000008000188e0) [0.025s][info][class,init] 98 Initializing java/io/InputStream'java/io/InputStream'(no method) (0x0000000800019218) [0.025s][info][class,init] 99 Initializing java/io/FileInputStream'java/io/FileInputStream' (0x0000000800018f58) [0.025s][info][class,init] 100 Initializing java/io/FileDescriptor'java/io/FileDescriptor' (0x0000000800019ca8) [0.025s][info][class,init] 101 Initializing java/io/FileDescriptor$1'java/io/FileDescriptor$1'(no method) (0x00000008001ddf68) [0.025s][info][class,init] 102 Initializing java/io/OutputStream'java/io/OutputStream'(no method) (0x0000000800013348) [0.025s][info][class,init] 103 Initializing java/io/FileOutputStream'java/io/FileOutputStream' (0x0000000800019ec0) [0.025s][info][class,init] 104 Initializing java/io/FilterInputStream'java/io/FilterInputStream'(no method) (0x000000080001a620) [0.025s][info][class,init] 105 Initializing java/io/BufferedInputStream'java/io/BufferedInputStream' (0x000000080001a360) [0.025s][info][class,init] 106 Initializing java/io/FilterOutputStream'java/io/FilterOutputStream'(no method) (0x00000008000135c8) [0.025s][info][class,init] 107 Initializing java/io/PrintStream'java/io/PrintStream'(no method) (0x0000000800012f90) [0.025s][info][class,init] 108 Initializing java/io/BufferedOutputStream'java/io/BufferedOutputStream'(no method) (0x00000008000176b8) [0.026s][info][class,init] 109 Initializing java/nio/charset/Charset'java/nio/charset/Charset' (0x00000008000944b0) [0.026s][info][class,init] 110 Initializing java/nio/charset/spi/CharsetProvider'java/nio/charset/spi/CharsetProvider'(no method) (0x00000008001d5290) [0.026s][info][class,init] 111 Initializing sun/nio/cs/StandardCharsets'sun/nio/cs/StandardCharsets' (0x00000008001d54b0) [0.026s][info][class,init] 112 Initializing java/lang/ThreadLocal'java/lang/ThreadLocal' (0x00000008000261e8) [0.026s][info][class,init] 113 Initializing java/util/concurrent/atomic/AtomicInteger'java/util/concurrent/atomic/AtomicInteger' (0x0000000800026438) [0.026s][info][class,init] 114 Initializing sun/nio/cs/Unicode'sun/nio/cs/Unicode'(no method) (0x0000000800094f30) [0.026s][info][class,init] 115 Initializing sun/nio/cs/UTF_8'sun/nio/cs/UTF_8' (0x00000008000951b8) [0.026s][info][class,init] 116 Initializing java/io/Writer'java/io/Writer'(no method) (0x00000008000e7ae0) [0.026s][info][class,init] 117 Initializing java/io/OutputStreamWriter'java/io/OutputStreamWriter'(no method) (0x00000008000e8660) [0.026s][info][class,init] 118 Initializing sun/nio/cs/StreamEncoder'sun/nio/cs/StreamEncoder' (0x00000008000e9490) [0.026s][info][class,init] 119 Initializing java/nio/charset/CharsetEncoder'java/nio/charset/CharsetEncoder' (0x00000008000e6e98) [0.026s][info][class,init] 120 Initializing sun/nio/cs/UTF_8$Encoder'sun/nio/cs/UTF_8$Encoder'(no method) (0x0000000800c403f0) [0.026s][info][class,init] 121 Initializing java/nio/charset/CodingErrorAction'java/nio/charset/CodingErrorAction' (0x00000008000a9278) [0.026s][info][class,init] 122 Initializing java/nio/Buffer'java/nio/Buffer' (0x00000008000767a8) [0.027s][info][class,init] 123 Initializing jdk/internal/misc/ScopedMemoryAccess'jdk/internal/misc/ScopedMemoryAccess' (0x00000008000a83e0) [0.027s][info][class,init] 124 Initializing java/nio/Buffer$1'java/nio/Buffer$1'(no method) (0x00000008001b7460) [0.027s][info][class,init] 125 Initializing java/nio/ByteBuffer'java/nio/ByteBuffer' (0x000000080007c050) [0.027s][info][class,init] 126 Initializing java/nio/HeapByteBuffer'java/nio/HeapByteBuffer' (0x00000008001e5660) [0.027s][info][class,init] 127 Initializing java/nio/ByteOrder'java/nio/ByteOrder' (0x000000080001aeb0) [0.027s][info][class,init] 128 Initializing java/io/BufferedWriter'java/io/BufferedWriter' (0x000000080001b0c8) [0.027s][info][class,init] 129 Initializing java/lang/Terminator'java/lang/Terminator' (0x000000080001aca0) [0.027s][info][class,init] 130 Initializing java/lang/Terminator$1'java/lang/Terminator$1'(no method) (0x0000000800087e58) [0.027s][info][class,init] 131 Initializing jdk/internal/misc/Signal'jdk/internal/misc/Signal' (0x0000000800087c40) [0.027s][info][class,init] 132 Initializing java/util/Hashtable$Entry'java/util/Hashtable$Entry'(no method) (0x000000080016e1d8) [0.027s][info][class,init] 133 Initializing jdk/internal/misc/Signal$Handler'jdk/internal/misc/Signal$Handler' (0x0000000800088088) [0.027s][info][class,init] 134 Initializing jdk/internal/misc/Signal$NativeHandler'jdk/internal/misc/Signal$NativeHandler'(no method) (0x00000008001eb878) [0.027s][info][class,init] 135 Initializing jdk/internal/misc/OSEnvironment'jdk/internal/misc/OSEnvironment'(no method) (0x00000008000353a0) [0.027s][info][class,init] 136 Initializing java/lang/Throwable'java/lang/Throwable' (0x00000008000310c0) [0.027s][info][class,init] 137 Initializing java/util/Collections'java/util/Collections' (0x0000000800035190) [0.027s][info][class,init] 138 Initializing java/util/Collections$EmptySet'java/util/Collections$EmptySet'(no method) (0x0000000800109a98) [0.027s][info][class,init] 139 Initializing java/util/AbstractList'java/util/AbstractList'(no method) (0x0000000800085538) [0.027s][info][class,init] 140 Initializing java/util/Collections$EmptyList'java/util/Collections$EmptyList'(no method) (0x00000008001acf38) [0.027s][info][class,init] 141 Initializing java/util/Collections$EmptyMap'java/util/Collections$EmptyMap'(no method) (0x0000000800053758) [0.027s][info][class,init] 142 Initializing java/lang/Error'java/lang/Error'(no method) (0x0000000800032b90) [0.027s][info][class,init] 143 Initializing java/lang/VirtualMachineError'java/lang/VirtualMachineError'(no method) (0x0000000800032df8) [0.027s][info][class,init] 144 Initializing java/lang/OutOfMemoryError'java/lang/OutOfMemoryError'(no method) (0x0000000800090428) [0.027s][info][class,init] 145 Initializing java/lang/Exception'java/lang/Exception'(no method) (0x0000000800031328) [0.027s][info][class,init] 146 Initializing java/lang/RuntimeException'java/lang/RuntimeException'(no method) (0x0000000800032470) [0.027s][info][class,init] 147 Initializing java/lang/NullPointerException'java/lang/NullPointerException'(no method) (0x000000080008ffc0) [0.027s][info][class,init] 148 Initializing java/lang/ClassCastException'java/lang/ClassCastException'(no method) (0x0000000800090c18) [0.027s][info][class,init] 149 Initializing java/lang/ArrayStoreException'java/lang/ArrayStoreException'(no method) (0x0000000800033530) [0.027s][info][class,init] 150 Initializing java/lang/ArithmeticException'java/lang/ArithmeticException'(no method) (0x000000080008fd58) [0.027s][info][class,init] 151 Initializing java/lang/StackOverflowError'java/lang/StackOverflowError'(no method) (0x0000000800033060) [0.027s][info][class,init] 152 Initializing java/lang/IllegalMonitorStateException'java/lang/IllegalMonitorStateException'(no method) (0x0000000800052390) [0.027s][info][class,init] 153 Initializing java/lang/IllegalArgumentException'java/lang/IllegalArgumentException'(no method) (0x00000008000326d8) [0.028s][info][class,init] 154 Initializing java/lang/invoke/MethodHandle'java/lang/invoke/MethodHandle' (0x00000008000b93d0) [0.028s][info][class,init] 155 Initializing java/lang/invoke/MethodHandleStatics'java/lang/invoke/MethodHandleStatics' (0x000000080001d020) [0.028s][info][class,init] 156 Initializing sun/security/action/GetPropertyAction'sun/security/action/GetPropertyAction'(no method) (0x00000008000e78a0) [0.028s][info][class,init] 157 Initializing java/lang/Boolean'java/lang/Boolean' (0x00000008000363d8) [0.028s][info][class,init] 158 Initializing java/lang/invoke/ResolvedMethodName'java/lang/invoke/ResolvedMethodName'(no method) (0x00000008000d13b0) [0.028s][info][class,init] 159 Initializing java/lang/invoke/MethodHandleNatives'java/lang/invoke/MethodHandleNatives' (0x00000008000d1698) [0.028s][info][class,init] 160 Initializing jdk/internal/module/ModuleBootstrap'jdk/internal/module/ModuleBootstrap' (0x000000080001ce10) [0.029s][info][class,init] 161 Initializing sun/invoke/util/VerifyAccess'sun/invoke/util/VerifyAccess' (0x0000000800073250) [0.029s][info][class,init] 162 Initializing java/lang/reflect/Modifier'java/lang/reflect/Modifier'(no method) (0x0000000800073040) [0.029s][info][class,init] 163 Initializing java/lang/module/ModuleDescriptor'java/lang/module/ModuleDescriptor' (0x0000000800124e20) [0.029s][info][class,init] 164 Initializing java/lang/module/ModuleDescriptor$1'java/lang/module/ModuleDescriptor$1'(no method) (0x0000000800072b58) [0.029s][info][class,init] 165 Initializing java/io/File'java/io/File' (0x00000008000727b8) [0.029s][info][class,init] 166 Initializing java/io/DefaultFileSystem'java/io/DefaultFileSystem'(no method) (0x00000008000a4818) [0.029s][info][class,init] 167 Initializing java/io/FileSystem'java/io/FileSystem' (0x00000008000a2b00) [0.029s][info][class,init] 168 Initializing java/io/UnixFileSystem'java/io/UnixFileSystem' (0x00000008000a2df0) [0.029s][info][class,init] 169 Initializing java/lang/AbstractStringBuilder'java/lang/AbstractStringBuilder' (0x0000000800065f28) [0.029s][info][class,init] 170 Initializing java/lang/StringBuilder'java/lang/StringBuilder'(no method) (0x000000080000efc8) [0.029s][info][class,init] 171 Initializing jdk/internal/util/ArraysSupport'jdk/internal/util/ArraysSupport' (0x00000008000a28f0) [0.029s][info][class,init] 172 Initializing jdk/internal/module/ModulePatcher'jdk/internal/module/ModulePatcher' (0x000000080017b118) [0.029s][info][class,init] 173 Initializing jdk/internal/module/ModuleBootstrap$Counters'jdk/internal/module/ModuleBootstrap$Counters' (0x0000000800179690) [0.029s][info][class,init] 174 Initializing jdk/internal/module/ArchivedBootLayer'jdk/internal/module/ArchivedBootLayer' (0x0000000800179470) [0.029s][info][class,init] 175 Initializing java/lang/ModuleLayer'java/lang/ModuleLayer' (0x000000080015d020) [0.029s][info][class,init] 176 Initializing java/lang/module/Configuration'java/lang/module/Configuration' (0x0000000800175a90) [0.029s][info][class,init] 177 Initializing jdk/internal/loader/AbstractClassLoaderValue'jdk/internal/loader/AbstractClassLoaderValue' (0x0000000800176138) [0.029s][info][class,init] 178 Initializing jdk/internal/loader/ClassLoaderValue'jdk/internal/loader/ClassLoaderValue'(no method) (0x0000000800176388) [0.029s][info][class,init] 179 Initializing java/util/ImmutableCollections$List12'java/util/ImmutableCollections$List12'(no method) (0x0000000800083c28) [0.029s][info][class,init] 180 Initializing java/lang/module/ResolvedModule'java/lang/module/ResolvedModule'(no method) (0x0000000800178410) [0.029s][info][class,init] 181 Initializing java/lang/module/ModuleReference'java/lang/module/ModuleReference'(no method) (0x00000008000c26a0) [0.029s][info][class,init] 182 Initializing jdk/internal/module/ModuleReferenceImpl'jdk/internal/module/ModuleReferenceImpl'(no method) (0x0000000800173380) [0.030s][info][class,init] 183 Initializing java/lang/module/ModuleDescriptor$Version'java/lang/module/ModuleDescriptor$Version'(no method) (0x0000000800174260) [0.030s][info][class,init] 184 Initializing java/util/ArrayList'java/util/ArrayList' (0x000000080000d9c0) [0.030s][info][class,init] 185 Initializing java/lang/module/ModuleDescriptor$Requires'java/lang/module/ModuleDescriptor$Requires' (0x000000080015fd68) [0.030s][info][class,init] 186 Initializing java/lang/Enum'java/lang/Enum'(no method) (0x0000000800007540) [0.030s][info][class,init] 187 Initializing java/lang/module/ModuleDescriptor$Requires$Modifier'java/lang/module/ModuleDescriptor$Requires$Modifier' (0x000000080008b318) [0.030s][info][class,init] 188 Initializing java/lang/module/ModuleDescriptor$Provides'java/lang/module/ModuleDescriptor$Provides'(no method) (0x0000000800174490) [0.030s][info][class,init] 189 Initializing java/net/URI'java/net/URI' (0x0000000800178df0) [0.030s][info][class,init] 190 Initializing java/net/URI$1'java/net/URI$1'(no method) (0x00000008002076e8) [0.030s][info][class,init] 191 Initializing jdk/internal/module/SystemModuleFinders$2'jdk/internal/module/SystemModuleFinders$2'(no method) (0x0000000800173140) [0.030s][info][class,init] 192 Initializing jdk/internal/module/SystemModuleFinders$3'jdk/internal/module/SystemModuleFinders$3'(no method) (0x000000080017b330) [0.030s][info][class,init] 193 Initializing java/lang/module/ModuleDescriptor$Exports'java/lang/module/ModuleDescriptor$Exports'(no method) (0x000000080015fb38) [0.030s][info][class,init] 194 Initializing jdk/internal/module/ModuleTarget'jdk/internal/module/ModuleTarget'(no method) (0x0000000800201e38) [0.030s][info][class,init] 195 Initializing jdk/internal/module/ModuleHashes'jdk/internal/module/ModuleHashes'(no method) (0x000000080017acf8) [0.030s][info][class,init] 196 Initializing java/util/Collections$UnmodifiableMap'java/util/Collections$UnmodifiableMap'(no method) (0x00000008001f1118) [0.030s][info][class,init] 197 Initializing java/lang/module/ModuleDescriptor$Opens'java/lang/module/ModuleDescriptor$Opens'(no method) (0x000000080015f908) [0.030s][info][class,init] 198 Initializing java/util/HashSet'java/util/HashSet' (0x0000000800109270) [0.030s][info][class,init] 199 Initializing java/lang/ClassLoader'java/lang/ClassLoader' (0x0000000800008b08) [0.030s][info][class,init] 200 Initializing java/security/SecureClassLoader'java/security/SecureClassLoader' (0x00000008000090f8) [0.030s][info][class,init] 201 Initializing java/lang/ClassLoader$ParallelLoaders'java/lang/ClassLoader$ParallelLoaders' (0x000000080000edb8) [0.030s][info][class,init] 202 Initializing java/util/WeakHashMap'java/util/WeakHashMap' (0x0000000800052bf0) [0.030s][info][class,init] 203 Initializing java/util/Collections$SetFromMap'java/util/Collections$SetFromMap'(no method) (0x00000008001f7808) [0.030s][info][class,init] 204 Initializing java/util/WeakHashMap$KeySet'java/util/WeakHashMap$KeySet'(no method) (0x00000008001626b0) [0.030s][info][class,init] 205 Initializing java/lang/ref/WeakReference'java/lang/ref/WeakReference'(no method) (0x0000000800050d80) [0.030s][info][class,init] 206 Initializing java/util/WeakHashMap$Entry'java/util/WeakHashMap$Entry'(no method) (0x0000000800052948) [0.030s][info][class,init] 207 Initializing jdk/internal/loader/BuiltinClassLoader'jdk/internal/loader/BuiltinClassLoader' (0x00000008000093f8) [0.030s][info][class,init] 208 Initializing jdk/internal/loader/ArchivedClassLoaders'jdk/internal/loader/ArchivedClassLoaders' (0x00000008001a1958) [0.030s][info][class,init] 209 Initializing jdk/internal/loader/ClassLoaders$BootClassLoader'jdk/internal/loader/ClassLoaders$BootClassLoader'(no method) (0x00000008001a2150) [0.030s][info][class,init] 210 Initializing java/security/ProtectionDomain'java/security/ProtectionDomain' (0x000000080000e748) [0.030s][info][class,init] 211 Initializing java/security/ProtectionDomain$JavaSecurityAccessImpl'java/security/ProtectionDomain$JavaSecurityAccessImpl'(no method) (0x0000000800162248) [0.030s][info][class,init] 212 Initializing java/security/CodeSource'java/security/CodeSource'(no method) (0x000000080000e970) [0.030s][info][class,init] 213 Initializing java/security/Principal'java/security/Principal'(no method) (0x0000000800162db8) [0.030s][info][class,init] 214 Initializing java/security/ProtectionDomain$Key'java/security/ProtectionDomain$Key'(no method) (0x0000000800162038) [0.030s][info][class,init] 215 Initializing jdk/internal/loader/NativeLibraries'jdk/internal/loader/NativeLibraries' (0x000000080000eba0) [0.030s][info][class,init] 216 Initializing java/util/ArrayDeque'java/util/ArrayDeque'(no method) (0x00000008001518f0) [0.030s][info][class,init] 217 Initializing jdk/internal/module/ServicesCatalog'jdk/internal/module/ServicesCatalog' (0x0000000800127108) [0.031s][info][class,init] 218 Initializing java/util/concurrent/CopyOnWriteArrayList'java/util/concurrent/CopyOnWriteArrayList'(no method) (0x000000080020c928) [0.031s][info][class,init] 219 Initializing jdk/internal/module/ServicesCatalog$ServiceProvider'jdk/internal/module/ServicesCatalog$ServiceProvider'(no method) (0x000000080020ce40) [0.031s][info][class,init] 220 Initializing jdk/internal/loader/ClassLoaders$PlatformClassLoader'jdk/internal/loader/ClassLoaders$PlatformClassLoader' (0x000000080008f768) [0.031s][info][class,init] 221 Initializing jdk/internal/loader/BuiltinClassLoader$LoadedModule'jdk/internal/loader/BuiltinClassLoader$LoadedModule'(no method) (0x0000000800175f00) [0.031s][info][class,init] 222 Initializing jdk/internal/loader/ClassLoaders$AppClassLoader'jdk/internal/loader/ClassLoaders$AppClassLoader' (0x000000080008d498) [0.031s][info][class,init] 223 Initializing jdk/internal/loader/BootLoader'jdk/internal/loader/BootLoader' (0x00000008001267b0) [0.031s][info][class,init] 224 Initializing jdk/internal/loader/ClassLoaders'jdk/internal/loader/ClassLoaders' (0x000000080000faa8) [0.031s][info][class,init] 225 Initializing jdk/internal/loader/URLClassPath'jdk/internal/loader/URLClassPath' (0x000000080019a988) [0.031s][info][class,init] 226 Initializing java/net/URL'java/net/URL' (0x000000080006e8e0) [0.031s][info][class,init] 227 Initializing java/net/URL$DefaultFactory'java/net/URL$DefaultFactory' (0x000000080008abf0) [0.031s][info][class,init] 228 Initializing java/net/URL$3'java/net/URL$3'(no method) (0x000000080008a7b8) [0.031s][info][class,init] 229 Initializing java/io/File$PathStatus'java/io/File$PathStatus' (0x000000080008b0c8) [0.031s][info][class,init] 230 Initializing sun/net/www/ParseUtil'sun/net/www/ParseUtil' (0x000000080008a5a8) [0.031s][info][class,init] 231 Initializing java/util/HexFormat'java/util/HexFormat' (0x000000080008c9e8) [0.031s][info][class,init] 232 Initializing java/net/URLStreamHandler'java/net/URLStreamHandler'(no method) (0x0000000800197d98) [0.031s][info][class,init] 233 Initializing sun/net/www/protocol/file/Handler'sun/net/www/protocol/file/Handler'(no method) (0x0000000800198480) [0.031s][info][class,init] 234 Initializing sun/net/util/IPAddressUtil'sun/net/util/IPAddressUtil' (0x00000008000872f8) [0.032s][info][class,init] 235 Initializing jdk/internal/util/Preconditions'jdk/internal/util/Preconditions'(no method) (0x00000008000870e8) [0.032s][info][class,init] 236 Initializing java/lang/invoke/StringConcatFactory'java/lang/invoke/StringConcatFactory' (0x000000080001d230) [0.032s][info][class,init] 237 Initializing java/util/function/Function'java/util/function/Function'(no method) (0x00000008001034f8) [0.032s][info][class,init] 238 Initializing java/lang/invoke/StringConcatFactory$1'java/lang/invoke/StringConcatFactory$1'(no method) (0x0000000800210430) [0.032s][info][class,init] 239 Initializing java/lang/invoke/StringConcatFactory$2'java/lang/invoke/StringConcatFactory$2'(no method) (0x0000000800210978) [0.032s][info][class,init] 240 Initializing java/lang/invoke/StringConcatFactory$3'java/lang/invoke/StringConcatFactory$3'(no method) (0x0000000800040450) [0.032s][info][class,init] 241 Initializing java/nio/CharBuffer'java/nio/CharBuffer' (0x00000008000798f8) [0.032s][info][class,init] 242 Initializing java/nio/HeapCharBuffer'java/nio/HeapCharBuffer' (0x0000000800079f80) [0.032s][info][class,init] 243 Initializing java/nio/charset/CoderResult'java/nio/charset/CoderResult' (0x00000008000a8bd0) openjdk version "18-internal" 2022-03-15 OpenJDK Runtime Environment (build 18-internal+0-adhoc.qingfengyy.jdktip) OpenJDK 64-Bit Server VM (build 18-internal+0-adhoc.qingfengyy.jdktip, mixed mode, sharing) [0.033s][info][class,init] 244 Initializing java/lang/Shutdown'java/lang/Shutdown' (0x000000080004c3a0) [0.033s][info][class,init] 245 Initializing java/lang/Shutdown$Lock'java/lang/Shutdown$Lock'(no method) (0x0000000800024a40) It looks this patch will not affect the initialization order. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 16 Jun 2021 08:08:47 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
I looked through the changes in java.base and only spotted one case where a different (and more specific) exception is thrown. The changes to to files in java.util.zip lead to annoying long lines so would be good to fix all those. src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 471:
469: */ 470: public int offsetByCodePoints(int index, int codePointOffset) { 471: checkOffset(index, count);
String.offsetByCodePoints is specified to throw IOOBE. checkOffset may throw the more specific StringIndexOutOfBoundsException. That's a compatible change but I worry that we might want to throw the less specific exception in the further because code. I only mention is because there have been cases in java.lang where IOOBE was specified and AIOOBE by the implementation and it has been problematic to touch the implementation as a result. src/java.base/share/classes/java/util/Base64.java line 934:
932: if (closed) 933: throw new IOException("Stream is closed"); 934: Preconditions.checkFromIndexSize(len, off, b.length, (xa, xb) -> new ArrayIndexOutOfBoundsException());
You might to split this really long line to avoid inconsistent line length in this source file. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 17 Jun 2021 10:21:35 GMT, Alan Bateman <alanb@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
src/java.base/share/classes/java/util/Base64.java line 934:
932: if (closed) 933: throw new IOException("Stream is closed"); 934: Preconditions.checkFromIndexSize(len, off, b.length, (xa, xb) -> new ArrayIndexOutOfBoundsException());
You might want to split this really long line too, to avoid inconsistent line length in this source file.
I would suggest factoring out `(xa, xb) -> new ArrayIndexOutOfBoundsException()` as a reusable component on `Preconditions`, and maybe even supplying an exception message (since it is rather useful, and way better than no message). See the usages of `Preconditions.outOfBoundsExceptionFormatter` (where there just happens to be many repeated cases of supplying AIOOBE with a message, that could also be consolidated, separate fix perhaps). ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 17 Jun 2021 15:45:47 GMT, Paul Sandoz <psandoz@openjdk.org> wrote:
src/java.base/share/classes/java/util/Base64.java line 934:
932: if (closed) 933: throw new IOException("Stream is closed"); 934: Preconditions.checkFromIndexSize(len, off, b.length, (xa, xb) -> new ArrayIndexOutOfBoundsException());
You might want to split this really long line too, to avoid inconsistent line length in this source file.
I would suggest factoring out `(xa, xb) -> new ArrayIndexOutOfBoundsException()` as a reusable component on `Preconditions`, and maybe even supplying an exception message (since it is rather useful, and way better than no message).
See the usages of `Preconditions.outOfBoundsExceptionFormatter` (where there just happens to be many repeated cases of supplying AIOOBE with a message, that could also be consolidated, separate fix perhaps).
Ok, I've replaced Preconditions.checkFromIndexSize(len, off, b.length, (xa, xb) -> new ArrayIndexOutOfBoundsException()); with Preconditions.checkFromIndexSize(len, off, b.length, Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new)); ---- I am curious about the motivations of current APIs: public static <X extends RuntimeException> int checkIndex(int index, int length, BiFunction<String, List<Number>, X> oobef) { if (index < 0 || index >= length) throw outOfBoundsCheckIndex(oobef, index, length); return index; } Are they over-engineered? When I checked all checkIndex-like patterns in the whole jdk codebase, I found that in most cases, providing an API that accepts custom exception should be enough for scalability: int checkIndex(int index, int length, IndexOutOfBoundException iooe) { if (index < 0 || index >= length) throw iooe; return index; } In addition to the ease-of-use problem, there is another problem with the current API design. Some methods in j.l.String are good replacement candidates for Preconditions.check{Index,...}: https://github.com/openjdk/jdk/blob/a051e735cda0d5ee5cb6ce0738aa549a7319a28c... But we **can not** do such replacement after my practice. The third parameter of Preconditions.checkIndex is a BiFunction, which can be passed a lambda as its argument. The generated lambda method exercises many other codes like MethodHandles, j.l.Package, etc, eventually it called j.l.String.checkIndex itself, so if we replace j.l.String.checkIndex with `Preconditions.checkIndex(a,b,(x1,x2)->....)`, a StackOverflowError would occur at VM startup. If there is an API that accepts user-defined exceptions, I think we can apply Preconditions in more places. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 17 Jun 2021 10:19:43 GMT, Alan Bateman <alanb@openjdk.org> wrote:
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
restore IndexOfOufBoundsException; split exception line
src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 471:
469: */ 470: public int offsetByCodePoints(int index, int codePointOffset) { 471: checkOffset(index, count);
String.offsetByCodePoints is specified to throw IOOBE. checkOffset may throw the more specific StringIndexOutOfBoundsException. That's a compatible change but I worry that we might want to throw the less specific exception in the future. I only mention it because there have been cases in java.lang where IOOBE was specified and AIOOBE by the implementation and it has been problematic to touch the implementation as a result.
Yes, changing the type of thrown exception may break something. And as David said, this also requires a CSR approval, which is a relatively long process, so I restored the original code. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision: restore IndexOfOufBoundsException; split exception line ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/593bf995..ec0a4d44 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=00-01 Stats: 30 lines in 8 files changed: 15 ins; 2 del; 13 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
On Fri, 18 Jun 2021 05:54:01 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
restore IndexOfOufBoundsException; split exception line
_Mailing list message from [David Holmes](mailto:david.holmes@oracle.com) on [serviceability-dev](mailto:serviceability-dev@mail.openjdk.java.net):_
On 17/06/2021 8:50 pm, Alan Bateman wrote:
On Thu, 17 Jun 2021 05:16:14 GMT, David Holmes <dholmes at openjdk.org> wrote:
There are a lot more tests than just tier1. :) I don't expect many, if any, tests to be looking for a specific IOOBE message, and I can't see an easy way to find such tests without running them. If core-libs folk are okay with this update then I guess we can just handle any test failures if they arise. But I'll run this through our tier 1-3 testing.
It would be good to run tier 1-3. Off hand I can't think of any tests that are dependent on the exception message, I think I'm more concerned about changing behavior (once you throw a more specific IOOBE is some of the very core classes then it's hard to change it because libraries get dependent on the more specific exception).
tiers 1-3 on Linux-x64 passed okay.
Any change to the exact type of exception thrown should be affirmed through a CSR request.
Cheers, David
Thank you David for running these tests! ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Fri, 18 Jun 2021 05:54:01 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
restore IndexOfOufBoundsException; split exception line
@kahatlen for cases earlier in VM startup you need to avoid method references and lambda expressions. See the implementation of `outOfBoundsExceptionFormatter`, and see the usage in `VarHandle` for two examples. Custom exception formaters should ideally be constants held in static final fields. I think the API complexity comes down to whether it is necessary to preserve existing exception messages or not when converting existing code to use the precondition methods. The API is designed to do that and composes reasonably well for default exception messages with a non-default exceptions. We could argue (i would!) it is preferable to have a consistent exception messages for index out of bounds exceptions, thereby we could collapse and simplify, but this is sometimes considered a change in behaviour. src/java.base/share/classes/java/util/Base64.java line 935:
933: throw new IOException("Stream is closed"); 934: Preconditions.checkFromIndexSize(len, off, b.length, 935: Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new));
`outOfBoundsExceptionFormatter` will allocate. Store the result of `Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new))` in a public static final on `Preconditions`, and replace the method ref with a inner class (thereby making it usable earlier at VM startup. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Fri, 18 Jun 2021 18:03:44 GMT, Paul Sandoz <psandoz@openjdk.org> wrote:
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
restore IndexOfOufBoundsException; split exception line
src/java.base/share/classes/java/util/Base64.java line 935:
933: throw new IOException("Stream is closed"); 934: Preconditions.checkFromIndexSize(len, off, b.length, 935: Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new));
`outOfBoundsExceptionFormatter` will allocate. Store the result of `Preconditions.outOfBoundsExceptionFormatter(ArrayIndexOutOfBoundsException::new))` in a public static final on `Preconditions`, and replace the method ref with a inner class (thereby making it usable earlier at VM startup.
Thanks for the clarification! Fixed. This incremental change does many stuff: - Create inner classes and public static final fields within Preconditions - Use Preconditions.check* in j.l.String - Use Preconditions.*IOOBE_FORMATTER in java.util.zip.* classes - Use Preconditions.*IOOBE_FORMATTER in java.util.Base64 - Use Preconditions.*IOOBE_FORMATTER in X-VarHandle.java.template and X-VarHandleByteArrayView.java.template - Use Preconditions.*IOOBE_FORMATTER in sun.security.provider.DigestBase - Use Preconditions.*IOOBE_FORMATTER in sun.security.util.ArrayUtil ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision: new Preconditions.IOOBE_FORMATTER ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/ec0a4d44..c1dd2f76 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=01-02 Stats: 129 lines in 13 files changed: 43 ins; 40 del; 46 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision: format ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/c1dd2f76..154989a0 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=02-03 Stats: 15 lines in 1 file changed: 4 ins; 1 del; 10 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision: more replacements ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/154989a0..c8b2106e Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=03-04 Stats: 59 lines in 8 files changed: 11 ins; 37 del; 11 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision: more replacement 2 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/c8b2106e..3a8875ec Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=04-05 Stats: 32 lines in 2 files changed: 1 ins; 20 del; 11 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
On Mon, 21 Jun 2021 05:17:09 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
more replacement 2
All the updates to the check* methods look ok (requires some careful looking!). I cannot recall what others said about the change in exception messages. @jddarcy any advice here? src/java.base/share/classes/jdk/internal/util/Preconditions.java line 78:
76: = Preconditions.outOfBoundsExceptionFormatter(new StringIndexOutOfBoundsExceptionProducer()); 77: 78: public static final BiFunction<String, List<Number>, StringIndexOutOfBoundsException> AIOOBE_FORMATTER
Using incorrect exception type. Suggest you embed as inner class rather than separate declaration, since they are only used in one place. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Mon, 21 Jun 2021 20:49:56 GMT, Paul Sandoz <psandoz@openjdk.org> wrote:
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
more replacement 2
src/java.base/share/classes/jdk/internal/util/Preconditions.java line 78:
76: = Preconditions.outOfBoundsExceptionFormatter(new StringIndexOutOfBoundsExceptionProducer()); 77: 78: public static final BiFunction<String, List<Number>, StringIndexOutOfBoundsException> AIOOBE_FORMATTER
Using incorrect exception type. Suggest you embed as inner class rather than separate declaration, since they are only used in one place.
Fixed. FYI: Current exception message looks like this: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: Range [3, 1) out of bounds for length 6 at CheckIndex$StringIndexOutOfBoundsExceptionProducer.apply(CheckIndex.java:77) at CheckIndex$StringIndexOutOfBoundsExceptionProducer.apply(CheckIndex.java:72) at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:159) at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:156) at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:62) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:76) at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:295) at CheckIndex.main(CheckIndex.java:110) I think now it expresses more exception information than before(and more consistent). ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On 6/21/2021 2:02 PM, Paul Sandoz wrote:
On Mon, 21 Jun 2021 05:17:09 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase. Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
more replacement 2 All the updates to the check* methods look ok (requires some careful looking!).
I cannot recall what others said about the change in exception messages. @jddarcy any advice here?
Generally, the JDK does not have the text of exception message as a supported interface meant to be relied on by users. This doesn't stop developers from occasionally parsing those messages, but that is usually a sign of a missing API which we try to rectify more directly. HTH, -Joe
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision: correct exception type; use anonymous inner classes ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/3a8875ec..2330ee38 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=05-06 Stats: 21 lines in 1 file changed: 0 ins; 9 del; 12 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
On Tue, 22 Jun 2021 02:39:01 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
correct exception type; use anonymous inner classes
I found that after solving the problem that Preconditions cannot be used during the VM startup, a series of functions such as String.checkIndex/checkOffset/.. can also be harmlessly replaced, but this changeset is somewhat large and may overwrite the previous review progress. If it will confuse the current review progress for reviewers involving in this PR, I'd like to file a new PR to do this change later. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Tue, 22 Jun 2021 02:58:28 GMT, Yi Yang <yyang@openjdk.org> wrote:
I found that after solving the problem that Preconditions cannot be used during the VM startup, a series of functions such as String.checkIndex/checkOffset/.. can also be harmlessly replaced, but this changeset is somewhat large and may overwrite the previous review progress. If it will confuse the current review progress for reviewers involving in this PR, I'd like to file a new PR to do this change later.
Yes, I think that helps to review. It's often easier, review-wise, to have separate PRs for specific areas, rather than keep expanding an existing PR. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision: tests rely on IOOBE exception message ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/2330ee38..ab1b509d Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=07 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=06-07 Stats: 104 lines in 2 files changed: 18 ins; 2 del; 84 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 23 Jun 2021 03:54:55 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
tests rely on IOOBE exception message
I suggest to separate the client changes (both src and test) in a separate PR for the client review. I review the rest of the files, which looks okay to me. I will take another pass carefully. src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java needs to be updated in JSR 166 upstream repo. Better to file a separate issue for this change to ensure that gets fixed in the upstream project. test/jdk/java/lang/StringBuffer/Exceptions.java line 73:
71: new StringBuffer(); 72: } 73: });
Nit: The above formatting (line 70-97) is inconsistent with the formatting in line 110-124. It'd be good to use the same formatting. test/jdk/java/lang/StringBuilder/Exceptions.java line 73:
71: new StringBuilder(); 72: } 73: });
Nit: it'd be good to make the formatting of all calls to tryCatch method consistent. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Tue, 6 Jul 2021 19:06:43 GMT, Mandy Chung <mchung@openjdk.org> wrote:
Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
tests rely on IOOBE exception message
test/jdk/java/lang/StringBuffer/Exceptions.java line 73:
71: new StringBuffer(); 72: } 73: });
Nit: The above formatting (line 70-97) is inconsistent with the formatting in line 110-124. It'd be good to use the same formatting.
Hi Mandy, thanks for reviewing this.
I suggest to separate the client changes (both src and test) in a separate PR for the client review.
Does "client changes" means changes involving src/java.desktop and test/java/awt?
src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java needs to be updated in JSR 166 upstream repo. Better to file a separate issue for this change to ensure that gets fixed in the upstream project.
Can you please paste a link for that? I'm not sure where I can find JSR 166 upstream repo..
Nit: The above formatting (line 70-97) is inconsistent with the formatting in line 110-124. It'd be good to use the same formatting.
Restored. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 7 Jul 2021 02:10:10 GMT, Yi Yang <yyang@openjdk.org> wrote:
Does "client changes" means changes involving src/java.desktop and test/java/awt?
src/java.desktop, test/java/awt, and test/javax/imageio ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 7 Jul 2021 16:22:25 GMT, Mandy Chung <mchung@openjdk.org> wrote:
Hi Mandy, thanks for reviewing this.
I suggest to separate the client changes (both src and test) in a separate PR for the client review.
Does "client changes" means changes involving src/java.desktop and test/java/awt?
src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java needs to be updated in JSR 166 upstream repo. Better to file a separate issue for this change to ensure that gets fixed in the upstream project.
Can you please paste a link for that? I'm not sure where I can find JSR 166 upstream repo..
Nit: The above formatting (line 70-97) is inconsistent with the formatting in line 110-124. It'd be good to use the same formatting.
Restored.
Does "client changes" means changes involving src/java.desktop and test/java/awt?
src/java.desktop, test/java/awt, and test/javax/imageio
src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java needs to be updated in JSR 166 upstream repo. Better to file a separate issue for this change to ensure that gets fixed in the upstream project.
Can you please paste a link for that? I'm not sure where I can find JSR 166 upstream repo..
What I meant is to file a JBS issue for this change and revert the change in this patch. That can be fixed when the next JSR 166 changes are imported to JDK. I wasn't sure if this is the right repo: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/ ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 7 Jul 2021 17:08:19 GMT, Mandy Chung <mchung@openjdk.org> wrote:
Does "client changes" means changes involving src/java.desktop and test/java/awt?
src/java.desktop, test/java/awt, and test/javax/imageio
src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java needs to be updated in JSR 166 upstream repo. Better to file a separate issue for this change to ensure that gets fixed in the upstream project.
Can you please paste a link for that? I'm not sure where I can find JSR 166 upstream repo..
What I meant is to file a JBS issue for this change and revert the change in this patch. That can be fixed when the next JSR 166 changes are imported to JDK.
I wasn't sure if this is the right repo: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/
Okay. I've filed https://bugs.openjdk.java.net/browse/JDK-8270057 and https://bugs.openjdk.java.net/browse/JDK-8270058 for JSR 166 and client code respectively. These codes have been restored. (Sorry for force-pushing, my mistake..) ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with four additional commits since the last revision: - restore code format - restore code format - restore code format - restore code format ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/ab1b509d..f43ffc3a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=08 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=07-08 Stats: 58 lines in 2 files changed: 0 ins; 10 del; 48 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has updated the pull request incrementally with two additional commits since the last revision: - restore code format - restore code format ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/f43ffc3a..903f0305 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=09 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=08-09 Stats: 36 lines in 2 files changed: 0 ins; 6 del; 30 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: restore JSR166; restore java.desktop ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4507/files - new: https://git.openjdk.java.net/jdk/pull/4507/files/903f0305..a9e7dbc8 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=10 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4507&range=09-10 Stats: 49 lines in 7 files changed: 24 ins; 7 del; 18 mod Patch: https://git.openjdk.java.net/jdk/pull/4507.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4507/head:pull/4507 PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 8 Jul 2021 03:12:24 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
restore JSR166; restore java.desktop
Looks good. Thanks for separating the other files from this patch. I also did a test run on tier1-3 that looks clean. ------------- Marked as reviewed by mchung (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 8 Jul 2021 03:12:24 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.
I'm not familiar with the review process of core-lib group. Is it sufficient for merging with one approval? Should I have more reviews for this? 🤔 ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Mon, 12 Jul 2021 05:21:34 GMT, Yi Yang <yyang@openjdk.org> wrote:
I'm not familiar with the review process of core-lib group. Is it sufficient for merging with one approval? Should I have more reviews for this? 🤔
It depends on the change. For this patch, it's good to get another reviewer to look through it. ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 8 Jul 2021 03:12:24 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
restore JSR166; restore java.desktop
Looks good. ------------- Marked as reviewed by rriggs (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4507
On Thu, 8 Jul 2021 03:12:24 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
Yi Yang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.
Thanks Mandy and Roger for reviews! ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
On Wed, 16 Jun 2021 08:08:47 GMT, Yi Yang <yyang@openjdk.org> wrote:
After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
This pull request has now been integrated. Changeset: afe957cd Author: Yi Yang <yyang@openjdk.org> URL: https://git.openjdk.java.net/jdk/commit/afe957cd9741810a113ea165a635a117c0ea... Stats: 357 lines in 40 files changed: 73 ins; 171 del; 113 mod 8268698: Use Objects.check{Index,FromToIndex,FromIndexSize} for java.base Reviewed-by: mchung, rriggs ------------- PR: https://git.openjdk.java.net/jdk/pull/4507
participants (8)
-
Alan Bateman
-
David Holmes
-
David Holmes
-
Joe Darcy
-
Mandy Chung
-
Paul Sandoz
-
Roger Riggs
-
Yi Yang