Skip to content

Conversation

Alexandra-Myers
Copy link

The Issue

A NullPointerException is triggered when Adapter tries to patch a ModifyExpressionValue that uses "CONSTANT" as a target as it fails to find the value for target() in the at annotation within the call to MethodContext.getInjectionPointMethodQualifier().

The Proposal

As a ModifyExpressionValue's return value for the mixin method must return the same as its target, rather than using the target's descriptor to get the expected return type, it should be expected to be equivalent to the return type for the mixin method. Therefore, the change is to use the mixin method's descriptor in order to ensure it is never null.

Possible Side Effects

If it were somehow the case that the return type did not match the target for the ModifyExpressionValue it might be possible for this to cause incorrect behaviour, although it seems unlikely.

Alternatives

I had considered instead finding some way to account for specifically the types of the target method, however after careful consideration I figured this solution out as it was far simpler and cleaner than checking what type the target returned.

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