final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
- } catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage(), jpe);
} catch (Exception e) {
LOGGER.debug("Error converting json to string " + e.getMessage(), e);
}
final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
- } catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage(), jpe);
} catch (Exception e) {
LOGGER.debug("Error converting json to string " + e.getMessage(), e);
}
try {
msoHeatUtils.createStack("DOESNOTEXIST", "test", "stackName", "test", new HashMap<>(),
Boolean.TRUE, 10);
- } catch (MsoCloudSiteNotFound e) {
-
- } catch (java.lang.NullPointerException npe) {
+ } catch (MsoCloudSiteNotFound | NullPointerException e) {
}
- }
+ }
@Test
public final void testCreateStackFailedConnectionHeatClient()
LOGGER.info(MessageEnum.RA_RESPONSE_FROM_SDNC, responseContent, "SDNC", "");
return createResponseFromContent(statusCode, statusMessage, responseContent, rt);
- } catch (SocketTimeoutException e) {
- String errMsg = "Request to SDNC timed out";
- logError(errMsg, e);
- return createErrorResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg, rt);
-
- } catch (ConnectTimeoutException e) {
+ } catch (SocketTimeoutException | ConnectTimeoutException e) {
String errMsg = "Request to SDNC timed out";
logError(errMsg, e);
return createErrorResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg, rt);
method = null;
return createResponse(statusCode, responseContent);
- } catch(SocketTimeoutException e) {
- String errMsg = "Request to VFC timed out";
- logError(errMsg, e);
- return createResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg);
-
- } catch(ConnectTimeoutException e) {
+ } catch(SocketTimeoutException | ConnectTimeoutException e) {
String errMsg = "Request to VFC timed out";
logError(errMsg, e);
return createResponse(HttpURLConnection.HTTP_CLIENT_TIMEOUT, errMsg);
final Object obj = JSON_MAPPER.treeToValue(node, Object.class);
final String json = JSON_MAPPER.writeValueAsString(obj);
return json;
- } catch (JsonParseException jpe) {
- LOGGER.debug("Error converting json to string " + jpe.getMessage(),jpe);
} catch (Exception e) {
LOGGER.debug("Error converting json to string " + e.getMessage(),e);
}
JSONObject json = new JSONObject();\r
try {\r
json = new JSONObject(mapper.writeValueAsString(this));\r
- } catch (JsonGenerationException e) {\r
- LOGGER.debug("Exception :",e);\r
- } catch (JsonMappingException e) {\r
- LOGGER.debug("Exception :",e);\r
} catch (JSONException e) {\r
LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
jsonString = mapper.writeValueAsString(list);\r
} catch (JsonGenerationException e) {\r
LOGGER.debug("Exception :",e);\r
- } catch (JsonMappingException e) {\r
- LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
LOGGER.debug("Exception :",e);\r
}\r
JSONObject json = new JSONObject();\r
try {\r
json = new JSONObject(mapper.writeValueAsString(this));\r
- } catch (JsonGenerationException e) {\r
- LOGGER.debug("Exception :",e);\r
- } catch (JsonMappingException e) {\r
- LOGGER.debug("Exception :",e);\r
} catch (JSONException e) {\r
LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
jsonString = mapper.writeValueAsString(list);\r
} catch (JsonGenerationException e) {\r
LOGGER.debug("Exception :",e);\r
- } catch (JsonMappingException e) {\r
- LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
LOGGER.debug("Exception :",e);\r
}\r
method = MsoLogger.class.getDeclaredMethod("prepareMsg", String.class, String.class, String.class);
method.setAccessible(true);
return (String)method.invoke(msoLogger, arg1, arg2, arg3);
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalArgumentException | IllegalAccessException | SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- return null;
+ return null;
}
// User reflection to invoke to avoid change the publicity of the method
method = MsoLogger.class.getDeclaredMethod(methodName, String.class);
method.setAccessible(true);
return method.invoke(msoLogger, arg);
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalArgumentException | IllegalAccessException | SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- return null;
+ return null;
}
}