Use isEmpty() to check whether the collection is empty or not
Sonar Link:
https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.dmaapclient%3AdmaapClient&open=AV4-MbPA32hFUzlqc5WY&resolved=false&severities=MAJOR
Location:
src/main/java/org/onap/dmaap/mr/client/MRClientBuilders.java
Line No-152
Change-Id: I8e64ecb3f88df3e042f3c3cad249bb903ee24f95
Issue-ID: DMAAP-983
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
*/
public MRConsumer build ()
{
*/
public MRConsumer build ()
{
- if ( fHosts == null || fHosts.size() == 0 || fTopic == null )
+ if ( fHosts == null || fHosts.isEmpty() || fTopic == null )
{
throw new IllegalArgumentException ( "You must provide at least one host and a topic name." );
}
{
throw new IllegalArgumentException ( "You must provide at least one host and a topic name." );
}