Fix API annotations discardable instrumentation#2682
Conversation
| * </p> | ||
| */ | ||
| boolean discardable() default true; | ||
| String discardable() default "true"; |
There was a problem hiding this comment.
This would be a breaking change.
Maybe there's a way to use a non-constant stack manipulation here:
And use the wrapper type Boolean as a method argument here:
There was a problem hiding this comment.
This would be a breaking change.
It was added in 1.32.0 for a specific user request, I think we can get away with that. Otherwise, it is currently a breaking change...
Maybe there's a way to use a non-constant stack manipulation
Hmm, interesting. I am not familiar with that enough. Are you proposing to work this area so that the advice is supplied with a different default, other than null? I'll look into it. The problem is that I cannot use a generic default to any boolean attribute, because the default in this case needs to be true, so I will have to do something specific for this attribute
There was a problem hiding this comment.
@felixbarny it worked! Thanks a lot ❤️
And use the wrapper type
Booleanas a method argument here
This causes a VerifyError, probably because of what Byte Buddy makes of it at runtime, that mismatches the co.elastic.apm.api.Traced#discardable() signature. However, using the primitive boolean here works.
e36102f to
89dc581
Compare
What does this PR do?
Fixes an issue that was introduced through #2632 by the addition of the
discardableattributes to the@CaptureSpanand@Tracedannotations.The application error looks as follows:
The annotations instrumentation is tolerant to addition of annotation attributes, assigning such with
null. The issue in this case is that the new attributes are ofbooleantype, which is not assignable fromnull.Checklist