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

Fallback validation should blow up if the fallback method isn't from … #123

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

manovotn
Copy link
Contributor

@manovotn manovotn commented Oct 11, 2019

…same class, super class or implemented interface.

Fixes #122

The tests for this are the TCKs alone because with changes merged in microprofile/microprofile-fault-tolerance#455, smallrye now fails the test in question.

…same class, super class or implemented interface.
@kenfinnigan kenfinnigan merged commit 47c8238 into smallrye:master Oct 11, 2019

// gather all interface methods based on declaring class
Set<String> allInterfaceMethodNames = new HashSet<>();
for (Class<?> clazz : declaringClass.getInterfaces()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this perhaps include super-interfaces of declaringClass.getInterfaces()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think spec allows that. Quoting:

The named fallback method must be on the same class, a superclass or an implemented interface of the class which declares the annotated method

From implemented interface of the class... I assume it has to be on an interface that directly implemented by given class.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that's probably yet another vague formulation in the spec, but fair enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be the case, to be fair I am learning about FT spec "on the fly" so take what I say with a pinch of salt ;)

@Ladicek
Copy link
Contributor

Ladicek commented Oct 14, 2019

Otherwise looking good.

@Ladicek Ladicek added this to the 2.0.13 milestone Oct 16, 2019
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.

Fallback validation shouldn't allow to define fallback method on a subclass
3 participants