Skip to content

Use binary names in GraalVmProcessor#3996

Merged
ppkarwasz merged 2 commits into2.xfrom
fix/2.x/3871_graalvm_binary_name
Dec 15, 2025
Merged

Use binary names in GraalVmProcessor#3996
ppkarwasz merged 2 commits into2.xfrom
fix/2.x/3871_graalvm_binary_name

Conversation

@ppkarwasz
Copy link
Copy Markdown
Contributor

@ppkarwasz ppkarwasz commented Dec 11, 2025

GraalVmProcessor currently emits canonical type names (JLS §6.7) for parameter types in the GraalVM reachability metadata. However, testing shows that GraalVM expects binary names (JLS §13.1) for reference types. For example:

  • Canonical: org.apache.logging.log4j.core.Filter.Result
  • Required (binary): org.apache.logging.log4j.core.Filter$Result

For array types, GraalVM accepts two forms:

  • The JVM descriptor form: [L<component_type>;
  • The Java-like form: <component_type>[]

This PR updates the processor to use binary names and emits the simpler Java-like syntax for arrays.

Fixes #3871

`GraalVmProcessor` currently emits canonical type names (JLS §6.7) for parameter types in the GraalVM reachability metadata.
However, testing shows that GraalVM expects **binary names** (JLS §13.1) for reference types. For example:

* Canonical: `org.apache.logging.log4j.core.Filter.Result`
* Required (binary): `org.apache.logging.log4j.core.Filter$Result`

For array types, GraalVM accepts two forms:

* The JVM descriptor form: `[L<component_type>;`
* The Java-like form: `<component_type>[]`

This PR updates the processor to use binary names and emits the simpler Java-like syntax for arrays.
@ppkarwasz
Copy link
Copy Markdown
Contributor Author

An integration test for this PR is contained in apache/logging-log4j-samples#385

@ppkarwasz ppkarwasz enabled auto-merge (squash) December 15, 2025 09:08
@ppkarwasz ppkarwasz merged commit 37a0383 into 2.x Dec 15, 2025
9 checks passed
@ppkarwasz ppkarwasz deleted the fix/2.x/3871_graalvm_binary_name branch December 15, 2025 09:56
@github-project-automation github-project-automation bot moved this from Approved to Merged in Log4j pull request tracker Dec 15, 2025
vy added a commit that referenced this pull request Dec 15, 2025
* Use binary names in `GraalVmProcessor`

`GraalVmProcessor` currently emits canonical type names (JLS §6.7) for parameter types in the GraalVM reachability metadata.
However, testing shows that GraalVM expects **binary names** (JLS §13.1) for reference types. For example:

* Canonical: `org.apache.logging.log4j.core.Filter.Result`
* Required (binary): `org.apache.logging.log4j.core.Filter$Result`

For array types, GraalVM accepts two forms:

* The JVM descriptor form: `[L<component_type>;`
* The Java-like form: `<component_type>[]`

This PR updates the processor to use binary names and emits the simpler Java-like syntax for arrays.

* Fix changelog entry type

---------

Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
@ppkarwasz
Copy link
Copy Markdown
Contributor Author

The integration test passed successfully: https://github.com/apache/logging-log4j2/actions/runs/20227947012

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

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Log4j2 metadata issues when ThresholdFilter is being used with GraalVM

2 participants