Source:
<code>public KieServerControllerServiceResponse executeCommand(final KieServerControllerDescriptorCommand command) { if (command == null) { return new KieServerControllerServiceResponse(ResponseType.FAILURE, "Command can not be null"); } try { Object result = null; Object handler = null; if (SpecManagementService.class.getName().equals(command.getService())) { handler = specManagementService; } else if (RuntimeManagementService.class.getName().equals(command.getService())) { handler = runtimeManagementService; } else if (RuleCapabilitiesService.class.getName().equals(command.getService())) { handler = ruleCapabilitiesService; } else { throw new IllegalStateException("Unable to find handler for " + command.getService() + " service"); } LOGGER.debug("Service handler: {}", handler); LOGGER.debug("Command arguments size: {}", command.getArguments().size()); List<Object> arguments = new ArrayList<>(); for (Object arg : command.getArguments()) { LOGGER.debug("Before :: Argument with type and value {}", arg == null ? "null" : arg.getClass(), arg); if (arg instanceof Wrapped) { arg = ((Wrapped) arg).unwrap(); } LOGGER.debug("After :: Argument with type and value {}", arg == null ? "null" : arg.getClass(), arg); arguments.add(arg); } LOGGER.debug("About to execute operation on with args {}", command.getMethod(), handler, arguments); result = MethodUtils.invokeMethod(handler, command.getMethod(), arguments.toArray()); LOGGER.debug("Handler returned response {}", handler, result); return new KieServerControllerServiceResponse(ResponseType.SUCCESS, "", result); } catch (InvocationTargetException e) { <START> e.printStackTrace(); <END> LOGGER.error("Failed to invoke service method", e); return new KieServerControllerServiceResponse(ResponseType.FAILURE, e.getTargetException().getMessage()); } catch (Throwable e) { e.printStackTrace(); LOGGER.error("Error while processing command", command, e); return new KieServerControllerServiceResponse(ResponseType.FAILURE, e.getMessage()); } }</code><technical_language>this print stack trace twice, it</technical_language>

Target:
public KieServerControllerServiceResponse executeCommand(final KieServerControllerDescriptorCommand command) { if (command == null) { return new KieServerControllerServiceResponse(ResponseType.FAILURE, "Command can not be null"); } try { Object result = null; Object handler = null; if (SpecManagementService.class.getName().equals(command.getService())) { handler = specManagementService; } else if (RuntimeManagementService.class.getName().equals(command.getService())) { handler = runtimeManagementService; } else if (RuleCapabilitiesService.class.getName().equals(command.getService())) { handler = ruleCapabilitiesService; } else { throw new IllegalStateException("Unable to find handler for " + command.getService() + " service"); } LOGGER.debug("Service handler: {}", handler); LOGGER.debug("Command arguments size: {}", command.getArguments().size()); List<Object> arguments = new ArrayList<>(); for (Object arg : command.getArguments()) { LOGGER.debug("Before :: Argument with type and value {}", arg == null ? "null" : arg.getClass(), arg); if (arg instanceof Wrapped) { arg = ((Wrapped) arg).unwrap(); } LOGGER.debug("After :: Argument with type and value {}", arg == null ? "null" : arg.getClass(), arg); arguments.add(arg); } LOGGER.debug("About to execute operation on with args {}", command.getMethod(), handler, arguments); result = MethodUtils.invokeMethod(handler, command.getMethod(), arguments.toArray()); LOGGER.debug("Handler returned response {}", handler, result); return new KieServerControllerServiceResponse(ResponseType.SUCCESS, "", result); } catch (InvocationTargetException e) { LOGGER.error("Failed to invoke service method", e); return new KieServerControllerServiceResponse(ResponseType.FAILURE, e.getTargetException().getMessage()); } catch (Throwable e) { LOGGER.error("Error while processing command", command, e); return new KieServerControllerServiceResponse(ResponseType.FAILURE, e.getMessage()); } }