Skip to content

[CALCITE-6393] Byte code of SqlFunctions is invalid#5091

Merged
rubenada merged 1 commit into
apache:mainfrom
rubenada:CALCITE-6393
Jul 11, 2026
Merged

[CALCITE-6393] Byte code of SqlFunctions is invalid#5091
rubenada merged 1 commit into
apache:mainfrom
rubenada:CALCITE-6393

Conversation

@rubenada

Copy link
Copy Markdown
Contributor

Jira Link

CALCITE-6393

Changes Proposed

Use a static method (instead of a lambda) for ARRAY_CARTESIAN_PRODUCT. This avoids a JDK 8 and 11 bug that produces invalid bytecode regarding checkerframework annotations.
Verified using bytecode checker proposed in #5090

More info: Body of the ARRAY_CARTESIAN_PRODUCT lambda extracted into an ordinary static method so that its @Nullable type annotations on doubly-nested type arguments (e.g. List<Enumerator<@Nullable Object>>) are attached the method's attribute table rather than to the enclosing <clinit>. This works around a javac bug in which type annotations declared inside a lambda body are emitted into the enclosing <clinit> attribute table with the lambda's own bytecode PCs and local-variable slots, producing malformed RuntimeVisibleTypeAnnotations entries that ASM's ClassRemapper rejects.

@thomasrebele thomasrebele left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, @rubenada! LGTM.

@sonarqubecloud

Copy link
Copy Markdown

@rubenada rubenada added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Jul 10, 2026
@rubenada rubenada merged commit a8e88d1 into apache:main Jul 11, 2026
35 checks passed
@rubenada

Copy link
Copy Markdown
Contributor Author

Thanks @thomasrebele , @xiedeyantu for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants