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

TRUNK-3383 HandlerUtil.getPreferredHandler(Class<H> handlerType, Class<T... #346

Closed
wants to merge 1 commit into from

Conversation

akolodziejski
Copy link
Contributor

...> type) throws an exception if top-ranked handlers have the same order ranking

TRUNK-3383 HandlerUtil.getPreferredHandler(Class handlerType, Class type) throws an exception if top-ranked handlers have the same order ranking

…s<T> type) throws an exception if top-ranked handlers have the same order ranking

TRUNK-3383 HandlerUtil.getPreferredHandler(Class<H> handlerType, Class<T> type) throws an exception if top-ranked handlers have the same order ranking

TRUNK-3383 HandlerUtil.getPreferredHandler(Class<H> handlerType, Class<T> type) throws an exception if top-ranked handlers have the same order ranking

if (mostSpecificSupportsInFirstHandler.isAssignableFrom(mostSpecificSupportsInSecondHandler)) {
return secondHandler;
} else {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be:

else if (mostSpecificSupportsInSecondHandler.isAssignableFrom(mostSpecificSupportsInFirstHandler))

Because the supported classes won't always be sub and super class to each other, here you are assuming it is e.g Patient and Person but it could be Patient and Encounter, i think you should still throw the exception as before if none of the classes is a subclass of the other when the order is the same

@dkayiwa
Copy link
Member

dkayiwa commented Jan 23, 2014

Closing because author abandoned it.

@dkayiwa dkayiwa closed this Jan 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants