Skip to content

Conversation

@laurit
Copy link
Contributor

@laurit laurit commented Nov 10, 2025

Instead of bumping class version to 1.7 so invokedynamic instruction could be used this PR introduces a more conservative approach. If class version supports invokedynamic we'll add the invokedynamic instruction as we do now. If the class version does not support invokedynamic we generate an helper class that contains the invokedynamic instruction in a static method and invoke that method via invokestatic. This way we don't have to worry about jvm class file parsing being more strict for newer class versions or building the stack map etc.

@laurit laurit marked this pull request as ready for review November 10, 2025 15:09
@laurit laurit requested a review from a team as a code owner November 10, 2025 15:09
Comment on lines +149 to +150
boolean allowClassVersionChange =
config.getBoolean("otel.javaagent.experimental.allow-class-version-change", false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for now left a flag for switching back to changing the class version, if there is no interest in keeping it could remove it

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.

1 participant