Skip to content
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

Issue #70 - Detect kotlin coroutine calls. #84

Merged
merged 7 commits into from
Jun 14, 2020

Conversation

croudet
Copy link
Contributor

@croudet croudet commented Jun 12, 2020

No description provided.

@croudet croudet force-pushed the Issue#70 branch 4 times, most recently from 57ef10a to 506d03c Compare June 12, 2020 19:22
} else {
// last argument
final String[] argumentNames = context.getArgumentNames();
final MutableArgumentValue<?> argument = context.getParameters().get(argumentNames[argumentNames.length - 1]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context.getParameters() is relatively expensive, and you don't need the MutableArgument value for these case. Use getParameterValues()[argumentNames.length - 1] instead which will provide better performance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return result;
}

private static boolean isKotlinContinuation(MethodInvocationContext<Object, Object> context) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe for this you can just call context.getExecutableMethod().isSuspend()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@graemerocher
Copy link
Contributor

Couple of changes, thanks for the contribution!

@croudet
Copy link
Contributor Author

croudet commented Jun 13, 2020

Are we sure that the last argument will always be of type CustomContinuation?

@graemerocher graemerocher merged commit 137958d into micronaut-projects:master Jun 14, 2020
@graemerocher
Copy link
Contributor

Thanks for the contribution!

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.

2 participants