RFR: 8321413: IllegalArgumentException: Code length outside the allowed range while creating a jlink image [v12]
Henry Jen
henryjen at openjdk.org
Fri Dec 13 23:46:36 UTC 2024
On Fri, 13 Dec 2024 23:24:33 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> Henry Jen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Move up Snippet setup as a builder
>
> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Snippets.java line 221:
>
>> 219: Snippet[] loadElementSnippets;
>> 220:
>> 221: public ArraySnippetBuilder(ClassDesc elementType) {
>
> If pagination is activated, the caller should set up the pagination threshold, page size, method name prefix. What happens if page size or method name prefix is not set?
>
> One alternative is to have 2 constructors - the default constructor for no pagination and another constructor takes several required parameters for pagination for example
>
> // return a builder with pagination activated and default threshold be PAGING_THRESHOLD
> public ArraySnippetBuilder(ClassDesc elementType, String methodNamePrefix, int pageSize) {
> ...
> }
>
>
> Can call `pagingThreshold(newThreshold)` to set a different threshold.
I am planning to provides default value for those and validation when build.
Same applies to classBuilder, as it's optional and depending on whether helper methods is needed.
Additional constructors would be nice to have, as we can add for types and perhaps a tested page size.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21022#discussion_r1884654319
More information about the core-libs-dev
mailing list