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

Allow primitive type for @Recover method parameter #247

Closed
wants to merge 1 commit into from

Conversation

leeyohan93
Copy link
Contributor

@leeyohan93 leeyohan93 commented Jun 15, 2021

I want to use the primitive type when I specify the Recover method.

But I could only use the wrapped type like below and I simply fixed this part.

I simply fixed this part, so I think you can fix it a better.

Thank you.

@Retryable(recover = "barRecover")
public int foo(int number);

@Recover
public int fooRecover(Throwable throwable, Integer number);

@Recover
public int barRecover(Throwable throwable, Integer number);

@pivotal-cla
Copy link

@leeyohan93 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@leeyohan93 Thank you for signing the Contributor License Agreement!

@@ -152,7 +165,9 @@ private boolean compareParameters(Object[] args, int argCount, Class<?>[] parame
if (argument == null) {
continue;
}
if (!parameterTypes[i].isAssignableFrom(argument.getClass())) {
Class<?> parameterType = parameterTypes[i];
parameterType = parameterType.isPrimitive() ? wrappers.get(parameterType) : parameterType;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if ClassUtils.resolvePrimitiveIfNecessary(Class<?> clazz) can be used instead...

@artembilan artembilan added this to the 1.3.3 milestone Apr 13, 2022
@artembilan
Copy link
Member

Merged as 4b298b3.

@leeyohan93 ,

thank you for the contribution; looking forward for more!

@artembilan artembilan closed this Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants