Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Conversation

@kppk
Copy link
Contributor

@kppk kppk commented Jun 23, 2015

Current implementation ExceptionMapperFactory#find method used sorted map to store the mappers by distance of the generic exception type from the actual type. If there were two exception mappers with the same generic type, the mappers got overwritten in that map. Also I noticed that the exception mappers order was changing with server restart making the behavior unpredictable.

This fix removed the sorted map, finds the mapper with the lowest distance doing the 'isMappable' check within the same loop.

…ltiple ExtendedExceptionMappers with same generic type
@jerseyrobot
Copy link
Contributor

Can one of the admins verify this patch?

@mpotociar
Copy link
Collaborator

Jenkins, please test this patch.

@mpotociar mpotociar added the OCA label Jun 23, 2015
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mgajdos mgajdos added this to the 2.19 milestone Jun 24, 2015
@mgajdos mgajdos self-assigned this Jun 24, 2015
@mgajdos
Copy link
Contributor

mgajdos commented Jun 24, 2015

Verified manually.

mgajdos added a commit that referenced this pull request Jun 24, 2015
JERSEY-2891: ExceptionMapper not chosen correctly in case of multiple ExtendedExceptionMappers with same generic type
@mgajdos mgajdos merged commit b0de20e into javaee:master Jun 24, 2015
@mgajdos
Copy link
Contributor

mgajdos commented Jun 24, 2015

Thanks for your contribution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants