NullPointerException might be thrown as cres is nullable here
Sonar Link:
https://sonar.onap.org/component_issues/index?id=org.onap.portal%3Aonap-portal-parent#resolved=false|severities=BLOCKER
Location:
/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyUtil.java
Line No-72
Change-Id: I14dc792fb67198ebcbabfe80d90c48389af6cc91
Issue-ID: PORTAL-153
Signed-off-by: Havaldar Girish <hg0071052@techmahindra.com>
public static PolicyResponseWrapper wrapResponse (ClientResponse cres) {
String resp_str = "";
public static PolicyResponseWrapper wrapResponse (ClientResponse cres) {
String resp_str = "";
if ( cres != null ) {
resp_str = cres.readEntity(String.class);
if ( cres != null ) {
resp_str = cres.readEntity(String.class);
+ statuscode = cres.getStatus();
- int statuscode = cres.getStatus();
PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, statuscode );
return (w);
}
PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, statuscode );
return (w);
}