Improve @WebParam class loading in JsonRpcBasicServer #314
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve @WebParam class loading in JsonRpcBasicServer
javax.jws.WebParam
class is part of JDK in Java 1.8, and it is always present.If Jakarta variant is also present in classpath, then needs to be loaded first,
otherwise it will be overridden by
javax.jws.WebParam
from JDK 1.8.Tests are successful when JDK 11+ is used, because
javax.jws.WebParam
is no longer present by default,and proper class is loaded.
There may be applications where both
javax.jws.WebParam
andjakarta.jws.WebParam
are present.This new implementation tries to load both classes and use them in the detection of method parameters.
This means that older code, which uses
javax.jws.WebParam
, should be fine even if application has newer dependency versions, wherejakarta.jws.WebParam
is also included.When JDK 11+ is used and there are
jakarta.jws.WebParam
annotated parameters present in the application,then a jar containing
javax.jws.WebParam
class should be explicitly included into classpath.This probably fixes problems in issue #310
Test issues in #310 can be reproduced with JDK 1.8.