-
Notifications
You must be signed in to change notification settings - Fork 1k
make javaagent-tooling and testing-common indy-ready #15133
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
base: main
Are you sure you want to change the base?
Conversation
…nstrumentation into indy-other
| assertThat(SomeClass.isInstrumented()) | ||
| .describedAs("method return value should be preserved when exception is thrown in advice") | ||
| .isFalse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] in the past the method return value could be modified when advice throws an unexpected exception, now that the return value is modified through the advice method return value this is no longer possible, and thus we always get the original method return value here (and this is very probably a good thing).
| @Advice.OnMethodExit(suppress = Throwable.class) | ||
| public static void throwAnException(@Advice.Return(readOnly = false) boolean returnVal) { | ||
| returnVal = true; | ||
| public static boolean throwAnException() { | ||
| throw new IllegalStateException("Test Exception"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] with the original syntax, the method return value is altered even when the advice throws an exception, this is no longer the case with this syntax.
Part of #13031