Fixed sonar code-smells/issues accross this file
Issue-ID: DMAAP-703
Change-Id: Ibf844f824a2d21edb0055702a685bff98c52f768
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
import javax.net.ssl.SSLException;
import org.apache.commons.codec.binary.Base64;
import javax.net.ssl.SSLException;
import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
import org.onap.dmaap.dbcapi.model.ApiError;
import org.onap.dmaap.dbcapi.model.MR_Cluster;
import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
import org.onap.dmaap.dbcapi.model.ApiError;
import org.onap.dmaap.dbcapi.model.MR_Cluster;
return(true);
} catch (Exception e) {
logger.error("Unexpected error during openConnection of " + pURL );
return(true);
} catch (Exception e) {
logger.error("Unexpected error during openConnection of " + pURL );
+ logger.error("Error", e);;
return(true);
} catch (Exception e) {
logger.error("Unexpected error during openConnection of " + pURL );
return(true);
} catch (Exception e) {
logger.error("Unexpected error during openConnection of " + pURL );
+ logger.error("error", e);
} catch (ProtocolException pe) {
// Rcvd error instead of 100-Continue
} catch (ProtocolException pe) {
// Rcvd error instead of 100-Continue
- try {
- // work around glitch in Java 1.7.0.21 and likely others
- // without this, Java will connect multiple times to the server to run the same request
- uc.setDoOutput(false);
- } catch (Exception e) {
- }
+ callSetDoOutputOnError();
+
} catch ( SSLException se ) {
} catch ( SSLException se ) {
+ logger.error("Error", se);
response.setCode(500);
response.setMessage( se.getMessage());
return response;
response.setCode(500);
response.setMessage( se.getMessage());
return response;
response.setCode(500);
response.setMessage( "Unable to read response");
logger.warn( response.getMessage() );
response.setCode(500);
response.setMessage( "Unable to read response");
logger.warn( response.getMessage() );
+ logger.error("Error", e);
}
}
finally {
try {
uc.disconnect();
}
}
finally {
try {
uc.disconnect();
- } catch ( Exception e ) {}
+ } catch ( Exception e ) {
+ logger.error("Error", e);
+ }
+
+ public void callSetDoOutputOnError() {
+ try {
+ // work around glitch in Java 1.7.0.21 and likely others
+ // without this, Java will connect multiple times to the server to run the same request
+ uc.setDoOutput(false);
+ } catch (Exception e) {
+ logger.error("Error", e);
+ }
+ }