Fix Request: AvoidSaajSoapMessaging
jborgers opened this issue · 2 comments
Reported:
The rules tells us to use AxiomSoapMessageFactory instead of SaajSoapMessageFactory. But, AxiomSoapMessageFactory has been removed from spring-ws.
The rule still gives valid advice, namely to use a system property to prevent TransformerFactoryImpl from scanning the classpath for every call. But, the advice to use Axiom is no longer valid, so better to remove that.
When solved, the violation can be suppressed. However, since it is on an import statement, the preferred way of suppressing with @SuppressWarnings does not work. Change to violate on its use instead, with a constructor or so.
Suppression is possible like:
import org.springframework.ws.soap.saaj.SaajSoapMessage; //NOSONAR //NOPMD - suppressed AvoidSaajSoapMessaging - TODO explain reason for suppression like: we added proper system properties to solve this
In the code example we should add the possibility to set the properties programmatically. This might be a better solution in many cases.