mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[DURACOM-109] added checkstyle rules to forbid usage of HttpClientBuilder.create()
This commit is contained in:

committed by
Elios Buzo

parent
644d15f881
commit
ca671b2aa0
@@ -7,4 +7,5 @@
|
||||
<!-- TODO: We should have these turned on. But, currently there's a known bug with indentation checks
|
||||
on JMockIt Expectations blocks and similar. See https://github.com/checkstyle/checkstyle/issues/3739 -->
|
||||
<suppress checks="Indentation" files="src[/\\]test[/\\]java"/>
|
||||
<suppress checks="Regexp" files="DSpaceHttpClientFactory\.java"/>
|
||||
</suppressions>
|
||||
|
@@ -136,5 +136,22 @@ For more information on CheckStyle configurations below, see: http://checkstyle.
|
||||
<module name="OneStatementPerLine"/>
|
||||
<!-- Require that "catch" statements are not empty (must at least contain a comment) -->
|
||||
<module name="EmptyCatchBlock"/>
|
||||
|
||||
<!-- Require to use DSpaceHttpClientFactory.getClient() statement instead of creating directly the client -->
|
||||
<module name="Regexp">
|
||||
<property name="format" value="HttpClientBuilder\.create\s*\(\s*\)" />
|
||||
<property name="message" value="Use DSpaceHttpClientFactory.getClient() instead of HttpClientBuilder.create()" />
|
||||
<property name="illegalPattern" value="true"/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
<!-- Require to use DSpaceHttpClientFactory.getClient() statement instead of creating directly the client -->
|
||||
<module name="Regexp">
|
||||
<property name="format" value="HttpClients\.createDefault\s*\(\s*\)" />
|
||||
<property name="message" value="Use DSpaceHttpClientFactory.getClient() instead of HttpClients.createDefault()" />
|
||||
<property name="illegalPattern" value="true"/>
|
||||
<property name="ignoreComments" value="true"/>
|
||||
</module>
|
||||
|
||||
|
||||
</module>
|
||||
</module>
|
||||
|
Reference in New Issue
Block a user