Ignore the signature-polymorphic MethodHandle in Animal Sniffer - #719
Merged
garydgregory merged 1 commit intoAug 29, 2026
Merged
Conversation
javac records the ad-hoc call-site descriptor for MethodHandle's invokers (invokeExact, invoke), which no signature database lists, so the Animal Sniffer check on JDK 8 flags every such call site as an undefined reference even though the invokers exist on all supported targets (Java 7+). Assisted-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ErRKq7RUeQ9LGrSboSUyYm
Member
|
@ppkarwasz Using: On GH CI here on Windows and Java 8, I see the same as above, using: What do you see and where? |
Member
|
Oh, I see, you disabled it... ok. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MethodHandle's invokers (invokeExact,invoke) are signature-polymorphic: javac records the ad-hoc call-site descriptor in the bytecode, which no signature database lists, so the Animal Sniffer check on JDK 8 flags every such call site as an undefined reference — even though the invokers exist on all supported targets (Java 7+).Seen in practice on apache/commons-xml#57, where six
invokeExactcall sites fail the JDK 8 CI legs; the workaround there is the same<ignore>java.lang.invoke.MethodHandle</ignore>in the component's own pom, which this change makes unnecessary for all components.Only
java.lang.invoke.MethodHandleis ignored:VarHandleis deliberately not listed, since it does not exist on a Java 8 target and a reference to it would be a real incompatibility.🤖 Generated with Claude Code