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-MbPA32hFUzlqc5WZ&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/nsa/mr/client/MRClientBuilders.java
Line No-238
Change-Id: If5b14b4e2fe6964f4a02f980525b6bc1c8f95fdb
Issue-ID: DMAAP-360
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
*/
public MRBatchingPublisher 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." );
}