RFR: 8308899: Introduce Classfile.Context and improve Classfile.Option(s) [v18]
Adam Sotona
asotona at openjdk.org
Wed Jun 14 08:06:34 UTC 2023
On Thu, 1 Jun 2023 19:25:19 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/classfile/Classfile.java line 55:
>>
>>> 53:
>>> 54: static Classfile of() {
>>> 55: return new ClassfileImpl();
>>
>> We can create a static final field in `ClassfileImpl` holding a default instance equivalent to that created by `new ClassfileImpl()` and have the `of()` factory return that instance instead.
>
> Global static default context will hold global shared cached class hierarchy resolver and that we want to avoid.
As the default CHR stays static instance and it is no more cached, we can have also static holder for the default Classfile instance now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14180#discussion_r1229182694
More information about the core-libs-dev
mailing list