Fixed some of the sonar issues
Issue-ID: DMAAP-1415
Change-Id: I07dbdc3fa6e478f811c28948991e9a32963113d1
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
final ArrayList<HttpHost> convertedHosts = new ArrayList<>();
for ( String host : hosts )
{
final ArrayList<HttpHost> convertedHosts = new ArrayList<>();
for ( String host : hosts )
{
- if ( host.length () == 0 ) continue;
+ if ( host.length () == 0 ){
+ continue;
+ }
+
convertedHosts.add ( hostForString ( host ) );
}
return convertedHosts;
convertedHosts.add ( hostForString ( host ) );
}
return convertedHosts;
*/
public static HttpHost hostForString ( String host )
{
*/
public static HttpHost hostForString ( String host )
{
- if ( host.length() < 1 ) throw new IllegalArgumentException ( "An empty host entry is invalid." );
+ if ( host.length() < 1 ){
+ throw new IllegalArgumentException ( "An empty host entry is invalid." );
+ }
String hostPart = host;
int port = kStdCambriaServicePort;
final int colon = host.indexOf ( ':' );
String hostPart = host;
int port = kStdCambriaServicePort;
final int colon = host.indexOf ( ':' );
- if ( colon == 0 ) throw new IllegalArgumentException ( "Host entry '" + host + "' is invalid." );
+ if ( colon == 0 ){
+ throw new IllegalArgumentException ( "Host entry '" + host + "' is invalid." );
+ }
+
if ( colon > 0 )
{
hostPart = host.substring ( 0, colon ).trim();
if ( colon > 0 )
{
hostPart = host.substring ( 0, colon ).trim();
public Set<String> jsonArrayToSet ( JSONArray a ) throws JSONException
{
public Set<String> jsonArrayToSet ( JSONArray a ) throws JSONException
{
- if ( a == null ) return null;
-
+ if ( a == null ){
+ return null;
+ }
+
final TreeSet<String> set = new TreeSet<>();
for ( int i=0; i<a.length (); i++ )
{
final TreeSet<String> set = new TreeSet<>();
for ( int i=0; i<a.length (); i++ )
{
*/
public message next () throws CambriaApiException
{
*/
public message next () throws CambriaApiException
{
- if ( fClosed ) return null;
-
+ if ( fClosed ){
+ return null;
+ }
+
try
{
final byte[] rawBytes = StreamTools.readBytes ( fStream );
try
{
final byte[] rawBytes = StreamTools.readBytes ( fStream );