New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Needs for tracing return event for 'void' methods only #192
Comments
Could you clarify the request? Do you want to trace only 'void' returns or all returns, including 'void'? |
only void methods: methods that has been declared like cause right now there is possible to trace all methods including 'void' (without Return annotation), and any non void methods (with Return annotation), but there is impossible to trace only void return methods. |
There is a proposed solution in https://github.com/jbachorik/btrace/tree/anytype-void-return branch. In order to trace only void returning methods you will need to declare the
Please, verify whether this resolves your problems. |
@yburkouski Are you fine with the proposed solution? |
@jbachorik sorry for delay, I will test it tomorrow. |
@jbachorik works as expected. Thanks! |
With a 'location = @location(Kind.RETURN)' and '@return AnyType ret' I can trigger and get return from any methods except of constructors () and with 'void' return signature.
I suggest to use for this case a variant with '@return java.lang.Void ret' cause there is only 1 alternate: using '@location(Kind.RETURN)' without '@return' (it catches return method event for constructors and 'void' methods), but in this case it's impossible to get method return value. AnyType is not suitable for catching it because it would be impossible to tell 'void' from 'null' return.
I'm using this app for testing: https://github.com/yburkouski/Btrace-Test-App
The text was updated successfully, but these errors were encountered: