Skip to content

fix(java): guard LambdaGetterJsonAccessor and LambdaSetterJsonAccessor with GraalvmSupport.isGraalBuildTime() - #4060

Open
zhfeng wants to merge 1 commit into
apache:mainfrom
zhfeng:fix/lambda-native-image
Open

zhfeng wants to merge 1 commit into
apache:mainfrom
zhfeng:fix/lambda-native-image

Conversation

@zhfeng

@zhfeng zhfeng commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Description

Prevent LambdaMetafactory from creating runtime classes during GraalVM Native Image compilation. Classes cannot be defined at runtime by default in AOT compilation.

Fix

Add check to both and to ensure lambda classes are only created during GraalVM build time (via the Native Image Feature), not at runtime.

Fixes #4059

@zhfeng
zhfeng requested a review from chaokunyang as a code owner September 19, 2026 06:11
@zhfeng
zhfeng force-pushed the fix/lambda-native-image branch from fea063f to 57f7611 Compare September 19, 2026 06:24
…r with GraalvmSupport.isGraalBuildTime()

    Prevent LambdaMetafactory from creating runtime classes during GraalVM Native Image
    compilation. Classes cannot be defined at runtime by default in AOT compilation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] LambdaGetterJsonAccessor and LambdaSetterJsonAccessor break GraalVM Native Image builds

1 participant