[
https://issues.apache.org/jira/browse/SLING-10840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17421977#comment-17421977
]
Bertrand Delacretaz commented on SLING-10840:
---------------------------------------------
As stated in the docs at
[https://sling.apache.org/documentation/bundles/servlet-helpers.html] I think
one good reason to use the servlet helpers bundle in production is the
{{SlingInternalRequest}} and {{ServletInternalRequest}} helpers, which make
internal requests simple and clean.
I think these services correctly hide their implementation details, returning a
{{SlingHttpServletResponse}} for example, so changing the underlying
request/response objects should be possible if needed.
Maybe these services should have been implemented in a different bundle which
only exports the package that allows using them. The servlets helpers bundle
also exports the {{org.apache.sling.servlethelpers}} package, which IIUC
contains the problematic classes discussed here.
> Sling Servlet Helpers implements @ProviderType interfaces
> ---------------------------------------------------------
>
> Key: SLING-10840
> URL: https://issues.apache.org/jira/browse/SLING-10840
> Project: Sling
> Issue Type: Bug
> Components: General
> Affects Versions: Servlet Helpers 1.4.2
> Reporter: David Gonzalez
> Priority: Major
>
> When using the Sling Servlet Helpers bundle/API, code quality scans detect
> that implentations in the Sling Servlet Helpers bundle implement
> @ProviderType interfaces from OTHER Sling bundles, which is not correct. Here
> are some fo the examples (though probably not exhaustive) I found when
> attempting to use ths Servlet Helpers library.
>
> |The product interface org.apache.sling.api.request.RequestParameter
> annotated with @ProviderType should not be implemented by custom code.
> Detected in org.apache.sling.servlethelpers.MockRequestParameter contained in
> /apps/asset-share-commons-vendor-packages/application/install/org.apache.sling.servlet-helpers-1.4.2.jar.|
> |The product interface org.apache.sling.api.request.RequestParameterMap
> annotated with @ProviderType should not be implemented by custom code.
> Detected in org.apache.sling.servlethelpers.MockRequestParameterMap contained
> in
> /apps/asset-share-commons-vendor-packages/application/install/org.apache.sling.servlet-helpers-1.4.2.jar.|
> |The product interface org.apache.sling.api.request.RequestPathInfo annotated
> with @ProviderType should not be implemented by custom code. Detected in
> org.apache.sling.servlethelpers.MockRequestPathInfo contained in
> /apps/asset-share-commons-vendor-packages/application/install/org.apache.sling.servlet-helpers-1.4.2.jar.|
> |The product interface org.apache.sling.api.request.RequestProgressTracker
> annotated with @ProviderType should not be implemented by custom code.
> Detected in org.apache.sling.servlethelpers.MockRequestProgressTracker
> contained in
> /apps/asset-share-commons-vendor-packages/application/install/org.apache.sling.servlet-helpers-1.4.2.jar.|
> |The product interface org.apache.sling.api.SlingHttpServletRequest annotated
> with @ProviderType should not be implemented by custom code. Detected in
> org.apache.sling.servlethelpers.MockSlingHttpServletRequest contained in
> /apps/asset-share-commons-vendor-packages/application/install/org.apache.sling.servlet-helpers-1.4.2.jar.|
> |The product interface org.apache.sling.api.SlingHttpServletResponse
> annotated with @ProviderType should not be implemented by custom code.
> Detected in org.apache.sling.servlethelpers.MockSlingHttpServletResponse
> contained in
> /apps/asset-share-commons-vendor-packages/application/install/org.apache.sling.servlet-helpers-1.4.2.jar.|
> |The product interface org.apache.sling.api.resource.Resource annotated with
> @ProviderType should not be implemented by custom code. Detected in
> org.apache.sling.servlethelpers.internalrequests.ServletResolutionResource
> contained in
> /apps/asset-share-commons-vendor-packages/application/install/org.apache.sling.servlet-helpers-1.4.2.jar.|
> Perhaps there needs to be Wrappers for all these classes that are
> @ConsumerTypes?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)